Skip to content

Commit 381e535

Browse files
authored
feat(build): add shared-openssl packages to releases MONGOSH-1231 (#1299)
- Move the package matrix definition from the evergreen template to a separate file in config/, and add data that would otherwise be computed in the build package (e.g. human-readable descriptions) there. - Consistently use “package variant” instead of “distribution build variant”. The latter term is a leftover from when package artifacts were tightly coupled with evergreen build variants, but now these are completely independent and it’s probably better to be consistent in referring to these as “packages”. - Make the `packageInformation` property in the build config a function that returns the package information for a given package variant – this is necessary so that the tasks that operate on all packaging variants at once (i.e. the publishing tasks) understand that the package information actually varies by packaging variant in the case of static OpenSSL/ shared OpenSSL 1.1/shared OpenSSL 3. - Merge all .rpm and all .deb package variants into a single entity each. Since we started using the crypt_shared library (formerly known as CSFLE shared library), our artifacts no longer differ between Linux distributions. This simplifies picking the correct package from a user perspective and reduces the publishing step complexity (i.e. counters the increase in the number of package variants coming from the shared-openssl additions). - Adjust build package tests to account for all of the above.
1 parent b1af047 commit 381e535

31 files changed

+644
-791
lines changed

.evergreen.yml

Lines changed: 211 additions & 307 deletions
Large diffs are not rendered by default.

.evergreen/evergreen.yml.in

Lines changed: 24 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -54,97 +54,7 @@ for (const packageInfo of MONGOSH_PACKAGES) {
5454

5555
const ALL_UNIT_TEST_BUILD_VARIANTS = ['darwin_unit', 'linux_unit', 'win32_unit'];
5656

57-
const EXECUTABLE_PKG_INFO = [
58-
{
59-
executableOsId: 'darwin-x64',
60-
compileBuildVariant: 'darwin',
61-
distributionBuildVariants: [
62-
{ name: 'darwin-x64', packageOn: 'darwin', smokeTestKind: 'macos' }
63-
]
64-
},
65-
{
66-
executableOsId: 'darwin-arm64',
67-
compileBuildVariant: 'darwin_arm64',
68-
distributionBuildVariants: [
69-
{ name: 'darwin-arm64', packageOn: 'darwin', smokeTestKind: 'macos' }
70-
]
71-
},
72-
{
73-
executableOsId: 'linux-x64',
74-
compileBuildVariant: 'linux_x64_build',
75-
distributionBuildVariants: [
76-
{ name: 'linux-x64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-tgz'] },
77-
{ name: 'debian-x64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu18.04-deb', 'ubuntu20.04-deb', 'ubuntu22.04-deb', 'debian9-deb', 'debian10-deb', 'debian11-deb'] },
78-
{ name: 'rhel7-x64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['centos7-rpm', 'amazonlinux2-rpm'] },
79-
{ name: 'rhel8-x64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'fedora34-rpm'] },
80-
{ name: 'suse-x64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['suse12-rpm', 'suse15-rpm'] },
81-
{ name: 'amzn1-x64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['amazonlinux1-rpm'] }
82-
]
83-
},
84-
{
85-
executableOsId: 'linux-x64-openssl11',
86-
compileBuildVariant: 'linux_x64_build_openssl11',
87-
distributionBuildVariants: [
88-
{ name: 'linux-x64-openssl11', packageOn: 'linux_package', smokeTestKind: 'none' },
89-
{ name: 'debian-x64-openssl11', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-deb', 'debian10-deb', 'debian11-deb'] },
90-
{ name: 'rhel7-x64-openssl11', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['centos7-epel-rpm', 'amazonlinux2-rpm'] },
91-
{ name: 'rhel8-x64-openssl11', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'fedora34-rpm'] }
92-
]
93-
},
94-
{
95-
executableOsId: 'linux-x64-openssl3',
96-
compileBuildVariant: 'linux_x64_build_openssl3',
97-
distributionBuildVariants: [
98-
{ name: 'linux-x64-openssl3', packageOn: 'linux_package', smokeTestKind: 'none' },
99-
{ name: 'debian-x64-openssl3', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu22.04-deb'] },
100-
{ name: 'rhel8-x64-openssl3', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-epel-rpm'] }
101-
]
102-
},
103-
{
104-
executableOsId: 'linux-arm64',
105-
compileBuildVariant: 'linux_arm64_build',
106-
distributionBuildVariants: [
107-
{ name: 'linux-arm64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-tgz'] },
108-
{ name: 'debian-arm64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu18.04-deb', 'ubuntu20.04-deb', 'ubuntu22.04-deb', 'debian10-deb', 'debian11-deb'] },
109-
{ name: 'rhel8-arm64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'fedora34-rpm'] },
110-
{ name: 'amzn2-arm64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['amazonlinux2-rpm'] }
111-
]
112-
},
113-
{
114-
executableOsId: 'linux-arm64-openssl11',
115-
compileBuildVariant: 'linux_arm64_build_openssl11',
116-
distributionBuildVariants: [
117-
{ name: 'linux-arm64-openssl11', packageOn: 'linux_package', smokeTestKind: 'none' },
118-
{ name: 'debian-arm64-openssl11', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-deb', 'debian10-deb', 'debian11-deb'] },
119-
{ name: 'rhel8-arm64-openssl11', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'fedora34-rpm'] },
120-
{ name: 'amzn2-arm64-openssl11', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['amazonlinux2-rpm'] }
121-
]
122-
},
123-
{
124-
executableOsId: 'linux-ppc64le',
125-
compileBuildVariant: 'linux_ppc64le_build',
126-
distributionBuildVariants: [
127-
{ name: 'linux-ppc64le', packageOn: 'linux_package', smokeTestKind: 'none' },
128-
{ name: 'rhel8-ppc64le', packageOn: 'linux_package', smokeTestKind: 'rpmextract' }
129-
]
130-
},
131-
{
132-
executableOsId: 'linux-s390x',
133-
compileBuildVariant: 'linux_s390x_build',
134-
distributionBuildVariants: [
135-
{ name: 'linux-s390x', packageOn: 'linux_package', smokeTestKind: 'none' },
136-
{ name: 'rhel7-s390x', packageOn: 'linux_package', smokeTestKind: 'rpmextract' }
137-
]
138-
},
139-
{
140-
executableOsId: 'win32',
141-
compileBuildVariant: 'win32_build',
142-
distributionBuildVariants: [
143-
{ name: 'win32-x64', packageOn: 'win32', smokeTestKind: 'ssh' },
144-
{ name: 'win32msi-x64', packageOn: 'win32', smokeTestKind: 'ssh' }
145-
]
146-
}
147-
];
57+
const { RELEASE_PACKAGE_MATRIX } = require('../config/release-package-matrix');
14858

14959
%>
15060
exec_timeout_secs: 3600
@@ -443,11 +353,11 @@ functions:
443353
#
444354
# package_and_upload_artifact expects the following arguments:
445355
# - distro_id
446-
# - distribution_build_variant
356+
# - package_variant
447357
# - executable_os_id
448358
#
449359
# get_artifact_url expects the following arguments:
450-
# - distribution_build_variant
360+
# - package_variant
451361
###
452362
package_and_upload_artifact:
453363
- command: expansions.write
@@ -469,15 +379,15 @@ functions:
469379
env:
470380
NODE_JS_VERSION: ${node_js_version}
471381
DISTRO_ID_OVERRIDE: ${distro_id}
472-
DISTRIBUTION_BUILD_VARIANT: ${distribution_build_variant}
382+
PACKAGE_VARIANT: ${package_variant}
473383
MACOS_NOTARY_KEY: ${macos_notary_key}
474384
MACOS_NOTARY_SECRET: ${macos_notary_secret}
475385
- command: s3.put
476386
params:
477387
aws_key: ${aws_key}
478388
aws_secret: ${aws_secret}
479389
local_file: src/artifact-url.txt
480-
remote_file: mongosh/binaries/${revision}/${revision_order_id}/artifact-url-${distribution_build_variant}.txt
390+
remote_file: mongosh/binaries/${revision}/${revision_order_id}/artifact-url-${package_variant}.txt
481391
bucket: mciuploads
482392
permissions: public-read
483393
content_type: application/x-gzip
@@ -487,7 +397,7 @@ functions:
487397
aws_key: ${aws_key}
488398
aws_secret: ${aws_secret}
489399
local_file: artifact-url.txt
490-
remote_file: mongosh/binaries/${revision}/${revision_order_id}/artifact-url-${source_distribution_build_variant}.txt
400+
remote_file: mongosh/binaries/${revision}/${revision_order_id}/artifact-url-${source_package_variant}.txt
491401
bucket: mciuploads
492402

493403
write_preload_script:
@@ -796,7 +706,7 @@ tasks:
796706
###
797707
# E2E TESTS
798708
###
799-
<% for (const { executableOsId, compileBuildVariant } of EXECUTABLE_PKG_INFO) {
709+
<% for (const { executableOsId, compileBuildVariant } of RELEASE_PACKAGE_MATRIX) {
800710
for (const mVersion of ['stable', 'unstable']) {
801711
for (const fipsVariant of ['fips', 'nofips']) {
802712
%>
@@ -824,9 +734,9 @@ tasks:
824734
###
825735
# PACKAGING
826736
###
827-
<% for (const { executableOsId, compileBuildVariant, distributionBuildVariants } of EXECUTABLE_PKG_INFO) {
828-
for (const { name: distributionBuildVariant } of distributionBuildVariants) { %>
829-
- name: package_and_upload_artifact_<% out(distributionBuildVariant.replace(/-/g, '_')) %>
737+
<% for (const { executableOsId, compileBuildVariant, packages } of RELEASE_PACKAGE_MATRIX) {
738+
for (const { name: packageVariant } of packages) { %>
739+
- name: package_and_upload_artifact_<% out(packageVariant.replace(/-/g, '_')) %>
830740
depends_on:
831741
- name: compile_artifact
832742
variant: <% out(compileBuildVariant) %>
@@ -839,15 +749,15 @@ tasks:
839749
- func: package_and_upload_artifact
840750
vars:
841751
node_js_version: "<% out(NODE_JS_VERSION_16) %>"
842-
distribution_build_variant: <% out(distributionBuildVariant) %>
752+
package_variant: <% out(packageVariant) %>
843753
executable_os_id: <% out(executableOsId) %>
844754
<% } } %>
845755

846756
###
847757
# SMOKE TESTS
848758
###
849-
<% for (const { distributionBuildVariants } of EXECUTABLE_PKG_INFO) {
850-
for (const { name, packageOn, smokeTestKind, smokeTestDockerfiles } of distributionBuildVariants) if (smokeTestKind !== 'none') {
759+
<% for (const { packages } of RELEASE_PACKAGE_MATRIX) {
760+
for (const { name, packageOn, smokeTestKind, smokeTestDockerfiles } of packages) if (smokeTestKind !== 'none') {
851761
for (const dockerfile of smokeTestDockerfiles || ['']) { %>
852762
- name: pkg_test_<% out(`${smokeTestKind}_${name}${dockerfile ? `_${dockerfile}` : ''}`.replace(/[-.]/g, '_')) %>
853763
tags: ["smoke-test"]
@@ -858,7 +768,7 @@ tasks:
858768
- func: checkout
859769
- func: get_artifact_url
860770
vars:
861-
source_distribution_build_variant: <% out(name) %>
771+
source_package_variant: <% out(name) %>
862772
- func: write_preload_script
863773
<% switch (smokeTestKind) {
864774
case 'ssh': { %>
@@ -1007,10 +917,10 @@ buildvariants:
1007917
display_name: "Ubuntu 18.04 x64 (Packaging)"
1008918
run_on: ubuntu1804-small
1009919
tasks:
1010-
<% for (const { executableOsId, distributionBuildVariants } of EXECUTABLE_PKG_INFO) {
1011-
for (const { name: distributionBuildVariant } of distributionBuildVariants) {
920+
<% for (const { executableOsId, packages } of RELEASE_PACKAGE_MATRIX) {
921+
for (const { name: packageVariant } of packages) {
1012922
if (executableOsId.startsWith('linux')) { %>
1013-
- name: package_and_upload_artifact_<% out(distributionBuildVariant.replace(/-/g, '_')) %>
923+
- name: package_and_upload_artifact_<% out(packageVariant.replace(/-/g, '_')) %>
1014924
<% } } } %>
1015925
- name: linux_x64_build
1016926
display_name: "RHEL 7.0 x64 (build)"
@@ -1203,19 +1113,19 @@ buildvariants:
12031113
display_name: "package smoke tests (x64 Docker)"
12041114
run_on: ubuntu1804-small
12051115
tasks:
1206-
<% for (const { distributionBuildVariants, executableOsId } of EXECUTABLE_PKG_INFO) {
1116+
<% for (const { packages, executableOsId } of RELEASE_PACKAGE_MATRIX) {
12071117
if (executableOsId.includes('linux-x64')) {
1208-
for (const { name, smokeTestKind, smokeTestDockerfiles } of distributionBuildVariants) if (smokeTestKind !== 'none') {
1118+
for (const { name, smokeTestKind, smokeTestDockerfiles } of packages) if (smokeTestKind !== 'none') {
12091119
for (const dockerfile of smokeTestDockerfiles || []) { %>
12101120
- name: pkg_test_<% out(`${smokeTestKind}_${name}${dockerfile ? `_${dockerfile}` : ''}`.replace(/[-.]/g, '_')) %>
12111121
<% } } } } %>
12121122
- name: pkg_smoke_tests_docker_arm64
12131123
display_name: "package smoke tests (arm64 Docker)"
12141124
run_on: ubuntu1804-arm64-small
12151125
tasks:
1216-
<% for (const { distributionBuildVariants, executableOsId } of EXECUTABLE_PKG_INFO) {
1126+
<% for (const { packages, executableOsId } of RELEASE_PACKAGE_MATRIX) {
12171127
if (executableOsId.includes('linux-arm64')) {
1218-
for (const { name, smokeTestKind, smokeTestDockerfiles } of distributionBuildVariants) if (smokeTestKind !== 'none') {
1128+
for (const { name, smokeTestKind, smokeTestDockerfiles } of packages) if (smokeTestKind !== 'none') {
12191129
for (const dockerfile of smokeTestDockerfiles || []) { %>
12201130
- name: pkg_test_<% out(`${smokeTestKind}_${name}${dockerfile ? `_${dockerfile}` : ''}`.replace(/[-.]/g, '_')) %>
12211131
<% } } } } %>
@@ -1244,17 +1154,17 @@ buildvariants:
12441154
display_name: "package smoke tests (RHEL 7.2 s390x)"
12451155
run_on: rhel72-zseries-small
12461156
tasks:
1247-
- name: pkg_test_rpmextract_rhel7_s390x
1157+
- name: pkg_test_rpmextract_rpm_s390x
12481158
- name: pkg_smoke_tests_rhel83_s390x
12491159
display_name: "package smoke tests (RHEL 8.3 s390x)"
12501160
run_on: rhel83-zseries-small
12511161
tasks:
1252-
- name: pkg_test_rpmextract_rhel7_s390x
1162+
- name: pkg_test_rpmextract_rpm_s390x
12531163
- name: pkg_smoke_tests_rhel81_ppc64le
12541164
display_name: "package smoke tests (RHEL 8.1 ppc64le)"
12551165
run_on: rhel81-power8-small
12561166
tasks:
1257-
- name: pkg_test_rpmextract_rhel8_ppc64le
1167+
- name: pkg_test_rpmextract_rpm_ppc64le
12581168

12591169
- name: draft_publish_release
12601170
display_name: "Draft/Publish Release"

.evergreen/package-and-upload-artifact.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ if [ "$(uname)" == Linux ]; then
1717
docker run -e PUPPETEER_SKIP_CHROMIUM_DOWNLOAD \
1818
-e EVERGREEN_EXPANSIONS_PATH=/tmp/build/tmp/expansions.yaml \
1919
-e NODE_JS_VERSION \
20-
-e DISTRIBUTION_BUILD_VARIANT \
20+
-e PACKAGE_VARIANT \
2121
-e ARTIFACT_URL_FILE="/tmp/build/artifact-url.txt" \
2222
--rm -v $PWD:/tmp/build --network host rocky8-package \
2323
-c 'cd /tmp/build && npm run evergreen-release package && npm run evergreen-release upload'
2424
else
25-
if [[ "$OS" == "Windows_NT" && "$DISTRIBUTION_BUILD_VARIANT" == "win32msi-x64" ]]; then
25+
if [[ "$OS" == "Windows_NT" && "$PACKAGE_VARIANT" == "win32msi-x64" ]]; then
2626
# We have to setup a python venv for the notary client to work
2727
# in order to sign the MSI
2828
export PATH="/cygdrive/c/Python27:$PATH"

0 commit comments

Comments
 (0)