Skip to content

Commit 3c11a2f

Browse files
jamiscomandeo-mongoneilshwekyp-mongo
authored
RUBY-3275 backport CI changes to 2.18 (#2727)
* RUBY-3232 Switch to supported build hosts (#2712) * Bump to latest toolchain and clean up specs to use consistent (and modern) build hosts * fix config validation errors * don't try to run ruby 2.7 on ubuntu2204 * bump submodule to get updated toolchain version * rhel84 -> rhel80 * keep tweaking * add "require_solo" helper * for testing: pointing spec/shared at my own branch * update spec/shared again to fix typo * bump spec/shared version again to prevent apt-get install from prompting * make sure cmake is installed for FLE runs * don't test on 3.2 yet (broken tests) * make sure we check for cmake BEFORE the bundle is installed * use MDB 5.x for testing certain auth mechanisms this is because run-tests.sh uses `mongo` to configure the MDB instance for certain auth mechanisms, which isn't shipped in MDB 6+. * try building the native extension for mongo_kerberos * remove jruby-9.4 for now to see if things pass any better with 9.3 * bump spec/shared to get updated server registry (for aarch64 versions) * update serverless to use rhel80 * move the install_cmake function to spec/shared, and make sure it gets called in run-tests-gcp * don't run zstd tests on jruby (no support) * bump spec/shared to get updated target arch selection * replace jruby 9.4 with 9.3 in sample_rubies list * bump spec/shared again * make sure kerberos stuff doesn't get confused by the BUNDLE_GEMFILE variable * don't test jruby on arm for now * don't assume x86_64 architecture * fix invalid config * jruby-9.3 isn't being built for ubuntu/debian :/ * need to build the bundle for the kerberos gem before compiling it * bump spec/shared to latest from my branch * jruby-9.3 is being built as a recent ruby now * don't include ruby-3.2 in supported rubies (yet) * rebuild config.yml * bump spec/shared * leaving out debian11 for now; we have ubuntu2204, which is closely related * the file is /etc/os-release, not /etc/os_release * remove jruby from FLE tests * comment out the failing tests (and reference the corresponding Jira tickets) this will at least let us get this "build hosts" effort sorted * forgot to comment out 'latest' * cmake is only needed if the helper is being installed Co-authored-by: Dmitry Rybakov <dmitry.rybakov@mongodb.com> * bump spec/shared --------- Co-authored-by: Dmitry Rybakov <dmitry.rybakov@mongodb.com> * more cleanup from the merge * more merge confusion * update all of the .evergreen folder * bump ruby versions in README * RUBY-3216 Skip failing view spec (#2701) * remove azure/gcp tests taken from master * no sdam_unified_spec in 2.18-stable * RUBY-3275 Update Atlas certificate (#2735) * RUBY-3275 Update Atlas certificate * Add a custom error message * bump drivers-evergreen-tools to try and make GH actions pass * need to update the GH actions definition, too * nix the rspec-mocks-diag gem so we can run more recent rspec all this to fix a ruby 3.2 incompatibility * disambiguate options hash vs keyword args * handle expection with kwargs * RUBY-3117 investigate and fix test failures as a result of removing validating_keys (#2620) * RUBY-3117 investigate and fix test failures as a result of removing validating_keys * RUBY-3117 remove all references to BSON::Config.validating_keys? * Update gemfiles/bson_master.gemfile Co-authored-by: Oleg Pudeyev <39304720+p-mongo@users.noreply.github.com> Co-authored-by: Oleg Pudeyev <39304720+p-mongo@users.noreply.github.com> * trying to get the web identity spec to pass * no web-identity tests for 2.18-stable * add an explicit dependency on nokogiri aws wants an XML parser * Let's not test 2.18-stable against MDB 7+ * remove unsupported configurations for 2.18-stable --------- Co-authored-by: Dmitry Rybakov <dmitry.rybakov@mongodb.com> Co-authored-by: Neil Shweky <neilshweky@gmail.com> Co-authored-by: Oleg Pudeyev <39304720+p-mongo@users.noreply.github.com>
1 parent 7fdb1f6 commit 3c11a2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1095
-2277
lines changed

.evergreen/auth_aws

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.mod/drivers-evergreen-tools/.evergreen/auth_aws

.evergreen/aws

Lines changed: 62 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,32 @@ $: << File.join(File.dirname(__FILE__), '../spec')
55
require 'support/aws_utils'
66
require 'optparse'
77

8-
options = {}
9-
OptionParser.new do |opts|
10-
opts.banner = "Usage: aws [options] command ..."
8+
def parse_options
9+
options = {}
10+
OptionParser.new do |opts|
11+
opts.banner = "Usage: aws [options] command ..."
1112

12-
opts.on("-a", "--access-key-id=ID", "AWS access key ID") do |v|
13-
options[:access_key_id] = v
14-
end
15-
16-
opts.on("-s", "--secret-access-key=SECRET", "AWS secret access key") do |v|
17-
options[:secret_access_key] = v
18-
end
13+
opts.on("-a", "--access-key-id=ID", "AWS access key ID") do |v|
14+
options[:access_key_id] = v
15+
end
1916

20-
opts.on("-r", "--region=REGION", "AWS region") do |v|
21-
options[:region] = v
22-
end
17+
opts.on("-s", "--secret-access-key=SECRET", "AWS secret access key") do |v|
18+
options[:secret_access_key] = v
19+
end
2320

24-
# launch-ecs options
25-
opts.on('--ec2', 'Use EC2 launch type instead of Fargate') do |v|
26-
options[:ec2] = true
27-
end
28-
end.parse!
21+
opts.on("-r", "--region=REGION", "AWS region") do |v|
22+
options[:region] = v
23+
end
2924

30-
case cmd = ARGV.shift
31-
when 'setup-resources'
32-
AwsUtils::Provisioner.new.setup_aws_auth_resources
33-
when 'reset-keys'
34-
AwsUtils::Provisioner.new.reset_keys
35-
when 'assume-role'
36-
arn = ARGV.shift
25+
# launch-ecs options
26+
opts.on('--ec2', 'Use EC2 launch type instead of Fargate') do |v|
27+
options[:ec2] = true
28+
end
29+
end.parse!
30+
options
31+
end
3732

33+
def assume_role(arn, options)
3834
orchestrator = AwsUtils::Orchestrator.new(**options)
3935
if arn.nil?
4036
arn = AwsUtils::Inspector.new(**options).assume_role_arn
@@ -43,39 +39,36 @@ when 'assume-role'
4339
puts "AWS_ACCESS_KEY_ID=#{credentials.access_key_id}"
4440
puts "AWS_SECRET_ACCESS_KEY=#{credentials.secret_access_key}"
4541
puts "AWS_SESSION_TOKEN=#{credentials.session_token}"
46-
#puts "EXPIRATION=#{credentials.expiration.utc.strftime('%Y%m%dT%H%M%SZ')}"
4742
puts
48-
when 'set-instance-profile'
49-
instance_id = ARGV.shift
43+
end
44+
45+
def set_instance_profile(instance_id, options)
5046
unless instance_id
5147
raise 'Instance id is required'
5248
end
53-
5449
orchestrator = AwsUtils::Orchestrator.new(**options)
5550
orchestrator.set_instance_profile(instance_id)
56-
when 'clear-instance-profile'
57-
instance_id = ARGV.shift
51+
end
52+
53+
def clear_instance_profile(instance_id, options)
5854
unless instance_id
5955
raise 'Instance id is required'
6056
end
6157

6258
orchestrator = AwsUtils::Orchestrator.new(**options)
6359
orchestrator.clear_instance_profile(instance_id)
64-
when 'key-pairs'
65-
AwsUtils::Inspector.new(**options).list_key_pairs
66-
when 'launch-ec2'
67-
public_key_path, = ARGV
60+
end
61+
62+
def launch_ec2(public_key_path, options)
6863
unless public_key_path
6964
raise "Public key path must be given"
7065
end
7166

7267
orchestrator = AwsUtils::Orchestrator.new(**options)
7368
orchestrator.provision_auth_ec2_instance(public_key_path: public_key_path)
74-
when 'stop-ec2'
75-
orchestrator = AwsUtils::Orchestrator.new(**options)
76-
orchestrator.terminate_auth_ec2_instance
77-
when 'launch-ecs'
78-
public_key_path, = ARGV
69+
end
70+
71+
def launch_ecs(public_key_path, options)
7972
unless public_key_path
8073
raise "Public key path must be given"
8174
end
@@ -84,6 +77,35 @@ when 'launch-ecs'
8477
orchestrator.provision_auth_ecs_task(
8578
public_key_path: public_key_path,
8679
)
80+
end
81+
82+
options = parse_options
83+
84+
case cmd = ARGV.shift
85+
when 'setup-resources'
86+
AwsUtils::Provisioner.new.setup_aws_auth_resources
87+
when 'reset-keys'
88+
AwsUtils::Provisioner.new.reset_keys
89+
when 'assume-role'
90+
arn = ARGV.shift
91+
assume_role(arn, options)
92+
when 'set-instance-profile'
93+
instance_id = ARGV.shift
94+
set_instance_profile(instance_id, options)
95+
when 'clear-instance-profile'
96+
instance_id = ARGV.shift
97+
clear_instance_profile(instance_id, options)
98+
when 'key-pairs'
99+
AwsUtils::Inspector.new(**options).list_key_pairs
100+
when 'launch-ec2'
101+
public_key_path, = ARGV
102+
launch_ec2(public_key_path, options)
103+
when 'stop-ec2'
104+
orchestrator = AwsUtils::Orchestrator.new(**options)
105+
orchestrator.terminate_auth_ec2_instance
106+
when 'launch-ecs'
107+
public_key_path, = ARGV
108+
launch_ecs(public_key_path, options)
87109
when 'stop-ecs'
88110
orchestrator = AwsUtils::Orchestrator.new(**options)
89111
orchestrator.terminate_auth_ecs_task

0 commit comments

Comments
 (0)