Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STL-716: Allow LCM Bricks run with C9S and java11 #1991

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
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-jre-centos9:202403271423.8c7c22c

ARG RVM_VERSION=stable
ARG JRUBY_VERSION=9.4.1.0

LABEL image_name="GDC LCM Bricks"
LABEL maintainer="LCM <[email protected]>"
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-jre-centos9:202312060945.d0814f3"

# 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

Expand All @@ -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 \
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.7.71
3.7.72
2 changes: 1 addition & 1 deletion gooddata.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +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_datawarehouse', '~> 0.0.11' if RUBY_PLATFORM == 'java'
s.add_dependency 'gooddata_datawarehouse', '~> 0.0.12' if RUBY_PLATFORM == 'java'
s.add_dependency 'highline', '= 2.0.0.pre.develop.14'
s.add_dependency 'json_pure', '~> 2.6'
s.add_dependency 'multi_json', '~> 1.12'
Expand Down
3 changes: 2 additions & 1 deletion lib/gooddata/cloud_resources/mssql/mssql_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def initialize(options = {})
raise('Missing connection info for MSSQL client')
end

# When update driver class then also updating driver class using in connection(..) method below
Java.com.microsoft.sqlserver.jdbc.SQLServerDriver
end

Expand Down Expand Up @@ -90,7 +91,7 @@ def connect
prop.setProperty('userName', authentication['userName'])
prop.setProperty('password', authentication['password'])

@connection = java.sql.DriverManager.getConnection(connection_string, prop)
@connection = com.microsoft.sqlserver.jdbc.SQLServerDriver.new.connect(@url, prop)
end

def validate
Expand Down
3 changes: 2 additions & 1 deletion lib/gooddata/cloud_resources/mysql/mysql_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def initialize(options = {})
raise('Missing connection info for Mysql client')
end

# When update driver class then also updating driver class using in connection(..) method below
Java.com.mysql.jdbc.Driver
end

Expand Down Expand Up @@ -84,7 +85,7 @@ def connect
prop = java.util.Properties.new
prop.setProperty('user', @authentication['basic']['userName'])
prop.setProperty('password', @authentication['basic']['password'])
@connection = java.sql.DriverManager.getConnection(@url, prop)
@connection = com.mysql.jdbc.Driver.new.connect(@url, prop)
@connection.set_auto_commit(false)
end

Expand Down
3 changes: 2 additions & 1 deletion lib/gooddata/cloud_resources/postgresql/postgresql_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def initialize(options = {})
raise('Missing connection info for Postgres client')
end

# When update driver class then also updating driver class using in connection(..) method below
Java.org.postgresql.Driver
end

Expand Down Expand Up @@ -86,7 +87,7 @@ def connect
prop.setProperty('password', @authentication['basic']['password'])
prop.setProperty('schema', @schema)

@connection = java.sql.DriverManager.getConnection(@url, prop)
@connection = org.postgresql.Driver.new.connect(@url, prop)
statement = @connection.create_statement
statement.execute("#{POSTGRES_SET_SCHEMA_COMMAND} #{@schema}")
@connection.set_auto_commit(false)
Expand Down
3 changes: 2 additions & 1 deletion lib/gooddata/cloud_resources/redshift/redshift_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def initialize(options = {})
end
@debug = options['debug'] == true || options['debug'] == 'true'

# When update driver class then also updating driver class using in connection(..) method below
Java.com.amazon.redshift.jdbc42.Driver
end

Expand Down Expand Up @@ -83,7 +84,7 @@ def connect
prop.setProperty('DbUser', @authentication['iam']['dbUser'])
end

@connection = java.sql.DriverManager.getConnection(full_url, prop)
@connection = com.amazon.redshift.jdbc42.Driver.new.connect(@url, prop)
end

private
Expand Down
3 changes: 2 additions & 1 deletion lib/gooddata/cloud_resources/snowflake/snowflake_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def initialize(options = {})

end

# When update driver class then also updating driver class using in connection(..) method below
Java.net.snowflake.client.jdbc.SnowflakeDriver
end

Expand Down Expand Up @@ -80,7 +81,7 @@ def connect
prop.setProperty('warehouse', @warehouse)
prop.setProperty('db', @database)

@connection = java.sql.DriverManager.getConnection(@url, prop)
@connection = com.snowflake.client.jdbc.SnowflakeDriver.new.connect(@url, prop)
end

def build_url(url)
Expand Down
2 changes: 1 addition & 1 deletion lib/gooddata/models/metadata/label.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_valid_elements(*args)
params[:offset] = offset
params[:limit] = paging_limit
results, = valid_elements params
all_valid_elements << results['validElements']['items'].select do |i|
all_valid_elements += results['validElements']['items'].select do |i|
i['element']['title'] == params[:filter]
end

Expand Down
3 changes: 2 additions & 1 deletion spec/lcm/integration/spec/others/data_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down