Skip to content

Commit

Permalink
SERVER-32437 add Amazon Linux 2 platform support
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhark committed Apr 4, 2018
1 parent f8a4166 commit cbf3e53
Show file tree
Hide file tree
Showing 6 changed files with 210 additions and 15 deletions.
5 changes: 5 additions & 0 deletions buildscripts/package_test/.kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ platforms:
image_id: ami-c481fad3
transport:
username: ec2-user
- name: amazon2
driver:
image_id: ami-428aa838
transport:
username: ec2-user
- name: debian71
driver:
image_id: ami-4b124a22
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,46 @@
its('exit_status') { should eq 0 }
end

describe service('mongod') do
it { should be_running }
# Inspec treats all amazon linux as upstart, we explicitly make it use
# systemd_service https://github.com/chef/inspec/issues/2639
if (os[:name] == 'amazon' and os[:release] == '2.0')
describe systemd_service('mongod') do
it { should be_running }
end
else
describe service('mongod') do
it { should be_running }
end
end

describe command("#{service} mongod stop") do
its('exit_status') { should eq 0 }
end

describe service('mongod') do
it { should_not be_running }
if (os[:name] == 'amazon' and os[:release] == '2.0')
describe systemd_service('mongod') do
it { should_not be_running }
end
else
describe service('mongod') do
it { should_not be_running }
end
end

describe command("#{service} mongod restart") do
its('exit_status') { should eq 0 }
end

describe service('mongod') do
it { should be_running }
if (os[:name] == 'amazon' and os[:release] == '2.0')
describe systemd_service('mongod') do
it { should be_running }
end
else
describe service('mongod') do
it { should be_running }
end
end


if os[:arch] == 'x86_64' and
(os[:name] == 'ubuntu' and
(os[:release][0...5] == '14.04' or os[:release][0...5] == '16.04')) or
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/packager-enterprise.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
ARCH_CHOICES = ["x86_64", "ppc64le", "s390x", "arm64"]

# Made up names for the flavors of distribution we package for.
DISTROS = ["suse", "debian", "redhat", "ubuntu", "amazon"]
DISTROS = ["suse", "debian", "redhat", "ubuntu", "amazon", "amazon2"]


class EnterpriseSpec(packager.Spec):
Expand Down
10 changes: 7 additions & 3 deletions buildscripts/packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
ARCH_CHOICES = ["x86_64", "arm64"]

# Made up names for the flavors of distribution we package for.
DISTROS = ["suse", "debian", "redhat", "ubuntu", "amazon"]
DISTROS = ["suse", "debian", "redhat", "ubuntu", "amazon", "amazon2"]


class Spec(object):
Expand Down Expand Up @@ -257,6 +257,8 @@ def repo_os_version(self, build_os):
return re.sub(r'^rhel(\d).*$', r'\1', build_os)
if self.n == 'amazon':
return "2013.03"
elif self.n == 'amazon2':
return "2017.12"
elif self.n == 'ubuntu':
if build_os == 'ubuntu1204':
return "precise"
Expand Down Expand Up @@ -297,8 +299,8 @@ def build_os(self, arch):
return ["suse11", "suse12"]
elif re.search("(redhat|fedora|centos)", self.n):
return ["rhel70", "rhel71", "rhel72", "rhel62", "rhel55"]
elif self.n == 'amazon':
return ["amazon"]
elif self.n in ['amazon', 'amazon2']:
return [self.n]
elif self.n == 'ubuntu':
return [
"ubuntu1204",
Expand All @@ -316,6 +318,8 @@ def release_dist(self, build_os):

if self.n == 'amazon':
return 'amzn1'
elif self.n == 'amazon2':
return 'amzn2'
else:
return re.sub(r'^rh(el\d).*$', r'\1', build_os)

Expand Down
173 changes: 170 additions & 3 deletions etc/evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1404,17 +1404,19 @@ functions:
for i in {1..3}
do
if ! kitchen verify "${packager_distro}"; then
# kitchen commands use regex so 'kitchen verify amazon' matches both amazon and amazon2
# that's why we pass $ at the end of "${packager_distro}"
if ! kitchen verify "${packager_distro}"\$; then
verified="false"
kitchen destroy "${packager_distro}" || true
kitchen destroy "${packager_distro}"\$ || true
sleep 30
else
verified="true"
break
fi
done
kitchen destroy "${packager_distro}" || true
kitchen destroy "${packager_distro}"\$ || true
test "$verified" = "true"
"fetch test_lifecycle.yml":
Expand Down Expand Up @@ -6062,6 +6064,171 @@ buildvariants:
- ubuntu1604-packer
- name: push

- name: enterprise-amazon2
display_name: "Enterprise Amazon Linux 2"
modules:
- enterprise
run_on:
- amazon2-test
batchtime: 1440 # 1 day
expansions:
test_flags: >-
--excludeWithAnyTags=requires_mmapv1
--excludeWithAnyTags=SERVER-34286
tooltags: "-tags 'ssl sasl'"
push_path: linux
push_bucket: downloads.10gen.com
push_name: linux
push_arch: x86_64-enterprise-amazon2
compile_flags: --ssl MONGO_DISTMOD=amazon2 --release -j$(grep -c ^processor /proc/cpuinfo) --variables-files=etc/scons/mongodbtoolchain_gcc.vars
num_jobs_available: $(grep -c ^processor /proc/cpuinfo)
has_packages: true
packager_script: packager-enterprise.py
packager_arch: x86_64
packager_distro: amazon2
repo_edition: enterprise
scons_cache_scope: shared
build_mongoreplay: true
tasks:
- name: compile
distros:
- amazon2-build
- name: compile_all
distros:
- amazon2-build
- name: aggregation_auth
- name: aggregation
- name: audit
- name: auth
- name: auth_audit
- name: dbtest
- name: ese
- name: failpoints_auth
- name: jsCore
- name: jsCore_ese
- name: jsCore_auth
- name: jsCore_decimal
- name: jsCore_txns
- name: aggregation_fuzzer
- name: jstestfuzz
- name: jstestfuzz_concurrent
- name: jstestfuzz_concurrent_replication
- name: jstestfuzz_concurrent_sharded
- name: jstestfuzz_replication
- name: jstestfuzz_sharded
- name: noPassthrough
- name: noPassthroughWithMongod
- name: bulk_gle_passthrough
- name: replica_sets_auth
- name: replica_sets_ese
- name: powercycle
- name: sasl
- name: sharding_auth
- name: sharding_auth_audit
- name: sharding_ese
- name: slow1
- name: serial_run
- name: sharded_collections_jscore_passthrough
- name: sharding_jscore_passthrough
- name: sharding_jscore_op_query_passthrough
- name: sharding_jscore_passthrough_wire_ops
- name: snmp
- name: ssl
- name: sslSpecial
- name: package
distros:
- ubuntu1604-packer
- name: push

- name: amazon2
display_name: SSL Amazon Linux 2
run_on:
- amazon2-test
batchtime: 1440 # 1 day
expansions:
test_flags: >-
--excludeWithAnyTags=requires_mmapv1
--excludeWithAnyTags=SERVER-34286
tooltags: "-tags 'ssl'"
push_path: linux
push_bucket: downloads.mongodb.org
push_name: linux
push_arch: x86_64-amazon2
compile_flags: --ssl MONGO_DISTMOD=amazon2 -j$(grep -c ^processor /proc/cpuinfo) --release --variables-files=etc/scons/mongodbtoolchain_gcc.vars
multiversion_platform: amazon
multiversion_edition: targeted
num_jobs_available: $(grep -c ^processor /proc/cpuinfo)
has_packages: true
packager_script: packager.py
packager_arch: x86_64
packager_distro: amazon2
repo_edition: org
scons_cache_scope: shared
shared_scons_pruning: true
build_mongoreplay: true
tasks:
- name: compile
distros:
- amazon2-build
- name: compile_all
distros:
- amazon2-build
- name: aggregation
- name: aggregation_auth
- name: auth
- name: dbtest
- name: disk_wiredtiger
- name: failpoints
- name: failpoints_auth
- name: gle_auth
- name: gle_auth_write_cmd
- name: gle_auth_basics_passthrough
- name: gle_auth_basics_passthrough_write_cmd
- name: sharding_gle_auth_basics_passthrough
- name: sharding_gle_auth_basics_passthrough_write_cmd
- name: jsCore
- name: jsCore_auth
- name: jsCore_compatibility
- name: jsCore_decimal
- name: jsCore_txns
- name: aggregation_fuzzer
- name: jstestfuzz
- name: jstestfuzz_concurrent
- name: jstestfuzz_concurrent_replication
- name: jstestfuzz_concurrent_sharded
- name: jstestfuzz_replication
- name: jstestfuzz_sharded
- name: mongosTest
- name: multiversion
- name: noPassthrough
- name: noPassthroughWithMongod
- name: bulk_gle_passthrough
- name: parallel
- name: parallel_compatibility
- name: concurrency
- name: concurrency_replication
- name: concurrency_sharded
- name: concurrency_simultaneous
- name: replica_sets
- name: replica_sets_auth
- name: replica_sets_jscore_passthrough
- name: sharding
- name: sharding_auth
- name: sharding_last_stable_mongos_and_mixed_shards
- name: slow1
- name: serial_run
- name: sharded_collections_jscore_passthrough
- name: sharding_jscore_passthrough
- name: sharding_jscore_op_query_passthrough
- name: sharding_jscore_passthrough_wire_ops
- name: ssl
- name: sslSpecial
- name: tool
- name: package
distros:
- ubuntu1604-packer
- name: push

###########################################
# Windows buildvariants #
###########################################
Expand Down
2 changes: 1 addition & 1 deletion jstests/noPassthrough/currentop_query.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Confirms inclusion of query, command object and planSummary in currentOp() for CRUD operations.
* This test should not be run in the parallel suite as it sets fail points.
* @tags: [requires_replication, requires_sharding]
* @tags: [requires_replication, requires_sharding, SERVER-34286]
*/
(function() {
"use strict";
Expand Down

0 comments on commit cbf3e53

Please sign in to comment.