Skip to content

Commit a19a234

Browse files
authored
feat(ci): add x64 Amazon Linux v1 builds MONGOSH-924 (#1039)
This mirrors what we do for SUSE support.
1 parent 34e1807 commit a19a234

File tree

14 files changed

+102
-12
lines changed

14 files changed

+102
-12
lines changed

.evergreen.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,6 +1685,20 @@ tasks:
16851685
node_js_version: "14.17.1"
16861686
distribution_build_variant: suse-x64
16871687
executable_os_id: linux-x64
1688+
- name: package_and_upload_artifact_amzn1_x64
1689+
depends_on:
1690+
- name: compile_artifact
1691+
variant: linux_x64_build
1692+
commands:
1693+
- func: checkout
1694+
- func: install
1695+
vars:
1696+
node_js_version: "14.17.1"
1697+
- func: package_and_upload_artifact
1698+
vars:
1699+
node_js_version: "14.17.1"
1700+
distribution_build_variant: amzn1-x64
1701+
executable_os_id: linux-x64
16881702
- name: package_and_upload_artifact_linux_arm64
16891703
depends_on:
16901704
- name: compile_artifact
@@ -1979,6 +1993,20 @@ tasks:
19791993
- func: test_artifact_docker
19801994
vars:
19811995
dockerfile: suse15-rpm
1996+
- name: pkg_test_docker_amazonlinux1_rpm
1997+
tags: ["smoke-test"]
1998+
depends_on:
1999+
- name: package_and_upload_artifact_amzn1_x64
2000+
variant: linux
2001+
commands:
2002+
- func: checkout
2003+
- func: get_artifact_url
2004+
vars:
2005+
source_distribution_build_variant: amzn1-x64
2006+
- func: write_preload_script
2007+
- func: test_artifact_docker
2008+
vars:
2009+
dockerfile: amazonlinux1-rpm
19822010
- name: pkg_test_debextract_debian_arm64
19832011
tags: ["smoke-test"]
19842012
depends_on:
@@ -2196,6 +2224,7 @@ buildvariants:
21962224
- name: package_and_upload_artifact_debian_x64
21972225
- name: package_and_upload_artifact_rhel_x64
21982226
- name: package_and_upload_artifact_suse_x64
2227+
- name: package_and_upload_artifact_amzn1_x64
21992228
- name: package_and_upload_artifact_linux_s390x
22002229
- name: package_and_upload_artifact_rhel_s390x
22012230
- name: package_and_upload_artifact_linux_arm64
@@ -2268,6 +2297,11 @@ buildvariants:
22682297
run_on: debian10-small
22692298
tasks:
22702299
- name: e2e_tests_linux_x64
2300+
- name: e2e_amazon1_x64
2301+
display_name: "Amazon Linux 1 x64 (E2E Tests)"
2302+
run_on: amazon1-2018-small
2303+
tasks:
2304+
- name: e2e_tests_linux_x64
22712305
- name: e2e_amazon2_x64
22722306
display_name: "Amazon Linux 2 x64 (E2E Tests)"
22732307
run_on: amazon2-small
@@ -2365,6 +2399,7 @@ buildvariants:
23652399
- name: pkg_test_docker_centos8_rpm
23662400
- name: pkg_test_docker_suse12_rpm
23672401
- name: pkg_test_docker_suse15_rpm
2402+
- name: pkg_test_docker_amazonlinux1_rpm
23682403
- name: pkg_test_docker_amazonlinux2_rpm
23692404
- name: pkg_test_docker_debian9_deb
23702405
- name: pkg_test_docker_debian10_deb

.evergreen/evergreen.yml.in

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ const EXECUTABLE_PKG_INFO = [
5454
{ name: 'linux-x64', packageOn: 'linux', smokeTestKind: 'none' },
5555
{ name: 'debian-x64', packageOn: 'linux', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu18.04-deb', 'ubuntu20.04-deb', 'debian9-deb', 'debian10-deb'] },
5656
{ name: 'rhel-x64', packageOn: 'linux', smokeTestKind: 'docker', smokeTestDockerfiles: ['centos7-rpm', 'centos8-rpm', 'amazonlinux2-rpm'] },
57-
{ name: 'suse-x64', packageOn: 'linux', smokeTestKind: 'docker', smokeTestDockerfiles: ['suse12-rpm', 'suse15-rpm'] }
57+
{ name: 'suse-x64', packageOn: 'linux', smokeTestKind: 'docker', smokeTestDockerfiles: ['suse12-rpm', 'suse15-rpm'] },
58+
{ name: 'amzn1-x64', packageOn: 'linux', smokeTestKind: 'docker', smokeTestDockerfiles: ['amazonlinux1-rpm'] }
5859
]
5960
},
6061
{
@@ -867,6 +868,7 @@ buildvariants:
867868
- name: package_and_upload_artifact_debian_x64
868869
- name: package_and_upload_artifact_rhel_x64
869870
- name: package_and_upload_artifact_suse_x64
871+
- name: package_and_upload_artifact_amzn1_x64
870872
- name: package_and_upload_artifact_linux_s390x
871873
- name: package_and_upload_artifact_rhel_s390x
872874
- name: package_and_upload_artifact_linux_arm64
@@ -939,6 +941,11 @@ buildvariants:
939941
run_on: debian10-small
940942
tasks:
941943
- name: e2e_tests_linux_x64
944+
- name: e2e_amazon1_x64
945+
display_name: "Amazon Linux 1 x64 (E2E Tests)"
946+
run_on: amazon1-2018-small
947+
tasks:
948+
- name: e2e_tests_linux_x64
942949
- name: e2e_amazon2_x64
943950
display_name: "Amazon Linux 2 x64 (E2E Tests)"
944951
run_on: amazon2-small
@@ -1021,6 +1028,7 @@ buildvariants:
10211028
- name: pkg_test_docker_centos8_rpm
10221029
- name: pkg_test_docker_suse12_rpm
10231030
- name: pkg_test_docker_suse15_rpm
1031+
- name: pkg_test_docker_amazonlinux1_rpm
10241032
- name: pkg_test_docker_amazonlinux2_rpm
10251033
- name: pkg_test_docker_debian9_deb
10261034
- name: pkg_test_docker_debian10_deb

config/repo-config.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ repos:
141141
repos:
142142
- zypper/suse/15/mongodb-org
143143

144+
- name: amazon1
145+
type: rpm
146+
edition: org
147+
bucket: repo.mongodb.org
148+
architectures:
149+
- x86_64
150+
repos:
151+
- yum/amazon/2013.03/mongodb-org
152+
144153
- name: amazon2
145154
type: rpm
146155
edition: org
@@ -240,6 +249,15 @@ repos:
240249
repos:
241250
- zypper/suse/15/mongodb-enterprise
242251

252+
- name: amazon1
253+
type: rpm
254+
edition: enterprise
255+
bucket: repo.mongodb.com
256+
architectures:
257+
- x86_64
258+
repos:
259+
- yum/amazon/2013.03/mongodb-enterprise
260+
243261
- name: amazon2
244262
type: rpm
245263
edition: enterprise

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
"lerna": "^4.0.0",
124124
"mocha": "^7.1.2",
125125
"mongodb": "addaleax/node-mongodb-native#71d4c39e5c858f49d10e840df626eca4da653e28",
126-
"mongodb-download-url": "^1.0.1",
126+
"mongodb-download-url": "^1.0.3",
127127
"mongodb-js-precommit": "^2.0.0",
128128
"nock": "^13.0.11",
129129
"node-codesign": "^0.3.2",

packages/build/src/barque.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ tmp.setGracefulCleanup();
2323
*/
2424
type PPARepository =
2525
'ubuntu1804' | 'ubuntu2004' | 'debian92' | 'debian10' |
26-
'rhel70' | 'rhel80' | 'amazon2' | 'suse12' | 'suse15';
26+
'rhel70' | 'rhel80' | 'amazon1' | 'amazon2' | 'suse12' | 'suse15';
2727

2828
/**
2929
* Return the full list of [distro, arch] combinations that we upload for
@@ -32,6 +32,7 @@ type PPARepository =
3232
*
3333
* /config/repo-config.yml needs to be kept in sync with this.
3434
*/
35+
// eslint-disable-next-line complexity
3536
export function getReposAndArch(buildVariant: BuildVariant): { ppas: PPARepository[], arch: string } {
3637
switch (getDistro(buildVariant)) {
3738
case 'win32':
@@ -62,6 +63,11 @@ export function getReposAndArch(buildVariant: BuildVariant): { ppas: PPAReposito
6263
ppas: ['suse12', 'suse15'],
6364
arch: getRPMArchName(getArch(buildVariant))
6465
};
66+
case 'amzn1':
67+
return {
68+
ppas: ['amazon1'],
69+
arch: getRPMArchName(getArch(buildVariant))
70+
};
6571
case 'amzn2':
6672
return {
6773
ppas: ['amazon2'],

packages/build/src/config/build-variant.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import { ALL_BUILD_VARIANTS } from './build-variant';
44
describe('BuildVariant', () => {
55
describe('all build variants', () => {
66
it('has all of them', () => {
7-
expect(ALL_BUILD_VARIANTS).to.have.length(16); // 4 × 3 linux + 4 others
7+
expect(ALL_BUILD_VARIANTS).to.have.length(17); // 4 × 2 generic linux + 9 others
88
expect(ALL_BUILD_VARIANTS).to.contain('win32-x64');
99
expect(ALL_BUILD_VARIANTS).to.contain('win32msi-x64');
1010
expect(ALL_BUILD_VARIANTS).to.contain('darwin-x64');
1111
expect(ALL_BUILD_VARIANTS).to.contain('debian-x64');
1212
expect(ALL_BUILD_VARIANTS).to.contain('suse-x64');
13+
expect(ALL_BUILD_VARIANTS).to.contain('amzn1-x64');
1314
expect(ALL_BUILD_VARIANTS).to.contain('amzn2-arm64');
1415
for (const arch of ['x64', 'arm64', 's390x', 'ppc64le']) {
1516
expect(ALL_BUILD_VARIANTS).to.contain(`linux-${arch}`);

packages/build/src/config/build-variant.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Different from 'platform': platform is extracted from os.platform() and
55
* build variant defines the desired distribution type to build for.
66
*/
7-
export type Distro = 'win32' | 'win32msi' | 'darwin' | 'linux' | 'debian' | 'rhel' | 'suse' | 'amzn2';
7+
export type Distro = 'win32' | 'win32msi' | 'darwin' | 'linux' | 'debian' | 'rhel' | 'suse' | 'amzn1' | 'amzn2';
88
export type Arch = 'x64' | 's390x' | 'arm64' | 'ppc64le';
99
export type BuildVariant = `${Distro}-${Arch}`;
1010

@@ -15,6 +15,7 @@ export const ALL_BUILD_VARIANTS: readonly BuildVariant[] = Object.freeze([
1515
'debian-x64', 'debian-arm64',
1616
'rhel-x64', 'rhel-s390x', 'rhel-arm64', 'rhel-ppc64le',
1717
'suse-x64',
18+
'amzn1-x64',
1819
'amzn2-arm64'
1920
] as const);
2021

@@ -72,6 +73,7 @@ export function getDownloadCenterDistroDescription(variant: BuildVariant): strin
7273
case 'rhel-ppc64le': return 'Redhat / Centos ppc64le';
7374
case 'rhel-arm64': return 'Redhat / Centos arm64';
7475
case 'suse-x64': return 'SUSE Linux 64-bit';
76+
case 'amzn1-x64': return 'Amazon Linux 1 64-bit';
7577
case 'amzn2-arm64': return 'Amazon Linux 2 arm64';
7678
default: throw new Error(`${variant} is not a valid build variant`);
7779
}

packages/build/src/packaging/download-mongocryptd.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ function lookupReleaseDistro(variant: BuildVariant): string {
4545
return 'debian92';
4646
case 'suse':
4747
return 'suse12';
48+
case 'amzn1':
49+
return 'amazon';
4850
case 'amzn2':
4951
return 'amazon2';
5052
case 'rhel':

packages/build/src/packaging/package/create-package.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export async function createPackage(
3131
break;
3232
case 'rhel':
3333
case 'suse':
34+
case 'amzn1':
3435
case 'amzn2':
3536
await createRedhatPackage(packageInformation, packageInformation.rpmTemplateDir, getArch(buildVariant), fullTarballFilePath);
3637
break;

0 commit comments

Comments
 (0)