From 0e1d960f1a4ed39f41c5aa0a462eb6358be69bf7 Mon Sep 17 00:00:00 2001 From: Hung Nguyen Date: Thu, 8 Aug 2024 14:08:14 +0700 Subject: [PATCH] STL-716: Allow LCM Bricks run with C9S and java11 --- Dockerfile | 12 +++--------- VERSION | 2 +- gooddata.gemspec | 1 + lib/gooddata/lcm/lcm2.rb | 6 ++++++ spec/lcm/integration/spec/others/data_helper_spec.rb | 3 ++- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 87acc3b90..ca52f9fd7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM 020413372491.dkr.ecr.us-east-1.amazonaws.com/tools/gdc-java-8-jdk-centos9:202311071405.4d8c665 +FROM 020413372491.dkr.ecr.us-east-1.amazonaws.com/tools/gdc-java-11-jdk-centos9:202405311102.6ba3dcf ARG RVM_VERSION=stable ARG JRUBY_VERSION=9.4.1.0 @@ -6,10 +6,10 @@ ARG JRUBY_VERSION=9.4.1.0 LABEL image_name="GDC LCM Bricks" LABEL maintainer="LCM " LABEL git_repository_url="https://github.com/gooddata/gooddata-ruby/" -LABEL parent_image="020413372491.dkr.ecr.us-east-1.amazonaws.com/tools/gdc-java-8-jdk-centos9:202311071405.4d8c665" +LABEL parent_image="020413372491.dkr.ecr.us-east-1.amazonaws.com/tools/gdc-java-11-jdk-centos9:202405311102.6ba3dcf" # which is required by RVM -RUN yum install -y which patch make git maven procps \ +RUN yum install -y which patch make unzip gnupg git maven procps gzip \ && yum clean all \ && rm -rf /var/cache/yum @@ -33,9 +33,6 @@ RUN rvm install jruby-${JRUBY_VERSION} && gem update --system \ && gem install bundler -v 2.4.6 \ && gem install rake -v 13.0.6 -# Make sure java default running with java8 -RUN update-alternatives --set java java-1.8.0-openjdk.x86_64 - WORKDIR /src RUN groupadd -g 48 apache \ @@ -80,9 +77,6 @@ RUN cp -rf ci/mysql/target/*.jar ./lib/gooddata/cloud_resources/mysql/drivers/ RUN bundle install -# Check to make sure Java version is always Java8 -RUN java_version=$(java -version 2>&1) && echo "$java_version" | grep 'version.*1.8' || (echo "Java version is not 1.8" && exit 1) - ARG GIT_COMMIT=unspecified ARG BRICKS_VERSION=unspecified LABEL git_commit=$GIT_COMMIT diff --git a/VERSION b/VERSION index ad70aa422..1d8ffbdf5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.7.68 +3.7.69 diff --git a/gooddata.gemspec b/gooddata.gemspec index 700428a84..44a6e1d40 100644 --- a/gooddata.gemspec +++ b/gooddata.gemspec @@ -75,6 +75,7 @@ Gem::Specification.new do |s| s.add_dependency 'azure-storage-blob', '~> 2.0' s.add_dependency 'nokogiri', '~> 1', '>= 1.10.8' s.add_dependency 'gli', '~> 2.15' + s.add_dependency 'gooddata-dss-jdbc', '~> 0.2.7' if RUBY_PLATFORM == 'java' s.add_dependency 'gooddata_datawarehouse', '~> 0.0.11' if RUBY_PLATFORM == 'java' s.add_dependency 'highline', '= 2.0.0.pre.develop.14' s.add_dependency 'json_pure', '~> 2.6' diff --git a/lib/gooddata/lcm/lcm2.rb b/lib/gooddata/lcm/lcm2.rb index e0faeab85..dbdcf889f 100644 --- a/lib/gooddata/lcm/lcm2.rb +++ b/lib/gooddata/lcm/lcm2.rb @@ -5,6 +5,7 @@ # LICENSE file in the root directory of this source tree. require 'terminal-table' +require 'jdbc/dss' if RUBY_PLATFORM == 'java' require 'gooddata/extensions/class' require 'gooddata/extensions/true' @@ -188,6 +189,11 @@ def respond_to_missing?(name, *_args) MODE_NAMES = MODES.keys class << self + if RUBY_PLATFORM == 'java' + Jdbc::DSS.load_driver + Java.com.gooddata.dss.jdbc.driver.DssDriver + end + def convert_params(params) # Symbolize all keys GoodData::Helpers.symbolize_keys!(params) diff --git a/spec/lcm/integration/spec/others/data_helper_spec.rb b/spec/lcm/integration/spec/others/data_helper_spec.rb index 056fedb5a..30bb337ad 100644 --- a/spec/lcm/integration/spec/others/data_helper_spec.rb +++ b/spec/lcm/integration/spec/others/data_helper_spec.rb @@ -296,7 +296,8 @@ expect(data).to eq File.open(file_path).read end - it 'connect to mysql mongobi with BASIC authentication' do + # Disable test for MongoBI + xit 'connect to mysql mongobi with BASIC authentication' do data_helper = GoodData::Helpers::DataSource.new(mysql_mongobi_basic_params['input_source']) file_path = data_helper.realize(mysql_mongobi_basic_params) data = File.open('spec/data/mysql_mongobi_data.csv').read