-
Notifications
You must be signed in to change notification settings - Fork 79
feat(build): package shared-openssl mongosh binaries MONGOSH-1224 #1293
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,22 +73,51 @@ const EXECUTABLE_PKG_INFO = [ | |
executableOsId: 'linux-x64', | ||
compileBuildVariant: 'linux_x64_build', | ||
distributionBuildVariants: [ | ||
{ name: 'linux-x64', packageOn: 'linux_package', smokeTestKind: 'none' }, | ||
{ name: 'debian-x64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu18.04-deb', 'ubuntu20.04-deb', 'debian9-deb', 'debian10-deb', 'debian11-deb'] }, | ||
{ name: 'linux-x64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-tgz'] }, | ||
{ name: 'debian-x64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu18.04-deb', 'ubuntu20.04-deb', 'ubuntu22.04-deb', 'debian9-deb', 'debian10-deb', 'debian11-deb'] }, | ||
{ name: 'rhel7-x64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['centos7-rpm', 'amazonlinux2-rpm'] }, | ||
{ name: 'rhel8-x64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'fedora34-rpm'] }, | ||
{ name: 'suse-x64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['suse12-rpm', 'suse15-rpm'] }, | ||
{ name: 'amzn1-x64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['amazonlinux1-rpm'] } | ||
] | ||
}, | ||
{ | ||
executableOsId: 'linux-x64-openssl11', | ||
compileBuildVariant: 'linux_x64_build_openssl11', | ||
distributionBuildVariants: [ | ||
{ name: 'linux-x64-openssl11', packageOn: 'linux_package', smokeTestKind: 'none' }, | ||
{ name: 'debian-x64-openssl11', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-deb', 'debian10-deb', 'debian11-deb'] }, | ||
{ name: 'rhel7-x64-openssl11', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['centos7-epel-rpm', 'amazonlinux2-rpm'] }, | ||
{ name: 'rhel8-x64-openssl11', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'fedora34-rpm'] } | ||
] | ||
}, | ||
{ | ||
executableOsId: 'linux-x64-openssl3', | ||
compileBuildVariant: 'linux_x64_build_openssl3', | ||
distributionBuildVariants: [ | ||
{ name: 'linux-x64-openssl3', packageOn: 'linux_package', smokeTestKind: 'none' }, | ||
{ name: 'debian-x64-openssl3', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu22.04-deb'] }, | ||
{ name: 'rhel8-x64-openssl3', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-epel-rpm'] } | ||
] | ||
}, | ||
{ | ||
executableOsId: 'linux-arm64', | ||
compileBuildVariant: 'linux_arm64_build', | ||
distributionBuildVariants: [ | ||
{ name: 'linux-arm64', packageOn: 'linux_package', smokeTestKind: 'none' }, | ||
{ name: 'debian-arm64', packageOn: 'linux_package', smokeTestKind: 'debextract' }, | ||
{ name: 'rhel8-arm64', packageOn: 'linux_package', smokeTestKind: 'rpmextract' }, | ||
{ name: 'amzn2-arm64', packageOn: 'linux_package', smokeTestKind: 'rpmextract' } | ||
{ name: 'linux-arm64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-tgz'] }, | ||
{ name: 'debian-arm64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu18.04-deb', 'ubuntu20.04-deb', 'ubuntu22.04-deb', 'debian10-deb', 'debian11-deb'] }, | ||
{ name: 'rhel8-arm64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'fedora34-rpm'] }, | ||
{ name: 'amzn2-arm64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['amazonlinux2-rpm'] } | ||
] | ||
}, | ||
{ | ||
executableOsId: 'linux-arm64-openssl11', | ||
compileBuildVariant: 'linux_arm64_build_openssl11', | ||
distributionBuildVariants: [ | ||
{ name: 'linux-arm64-openssl11', packageOn: 'linux_package', smokeTestKind: 'none' }, | ||
{ name: 'debian-arm64-openssl11', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-deb', 'debian10-deb', 'debian11-deb'] }, | ||
{ name: 'rhel8-arm64-openssl11', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'fedora34-rpm'] }, | ||
{ name: 'amzn2-arm64-openssl11', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['amazonlinux2-rpm'] } | ||
] | ||
}, | ||
{ | ||
|
@@ -799,7 +828,7 @@ tasks: | |
<% for (const { distributionBuildVariants } of EXECUTABLE_PKG_INFO) { | ||
for (const { name, packageOn, smokeTestKind, smokeTestDockerfiles } of distributionBuildVariants) if (smokeTestKind !== 'none') { | ||
for (const dockerfile of smokeTestDockerfiles || ['']) { %> | ||
- name: pkg_test_<% out(`${smokeTestKind}_${(dockerfile || name).replace(/[-.]/g, '_')}`) %> | ||
- name: pkg_test_<% out(`${smokeTestKind}_${name}${dockerfile ? `_${dockerfile}` : ''}`.replace(/[-.]/g, '_')) %> | ||
tags: ["smoke-test"] | ||
depends_on: | ||
- name: package_and_upload_artifact_<% out(name.replace(/-/g, '_')) %> | ||
|
@@ -921,8 +950,6 @@ buildvariants: | |
executable_os_id: darwin-arm64 | ||
tasks: | ||
- name: compile_artifact | ||
# - name: e2e_tests_darwin_arm64 | ||
# No E2E test for now because there are no server releases to run them against | ||
|
||
- name: linux_unit | ||
display_name: "Ubuntu 18.04 x64 (Unit tests)" | ||
|
@@ -945,20 +972,11 @@ buildvariants: | |
display_name: "Ubuntu 18.04 x64 (Packaging)" | ||
run_on: ubuntu1804-small | ||
tasks: | ||
- name: package_and_upload_artifact_linux_x64 | ||
- name: package_and_upload_artifact_debian_x64 | ||
- name: package_and_upload_artifact_rhel7_x64 | ||
- name: package_and_upload_artifact_rhel8_x64 | ||
- name: package_and_upload_artifact_suse_x64 | ||
- name: package_and_upload_artifact_amzn1_x64 | ||
- name: package_and_upload_artifact_linux_s390x | ||
- name: package_and_upload_artifact_rhel7_s390x | ||
- name: package_and_upload_artifact_linux_arm64 | ||
- name: package_and_upload_artifact_debian_arm64 | ||
- name: package_and_upload_artifact_rhel8_arm64 | ||
- name: package_and_upload_artifact_amzn2_arm64 | ||
- name: package_and_upload_artifact_linux_ppc64le | ||
- name: package_and_upload_artifact_rhel8_ppc64le | ||
<% for (const { executableOsId, distributionBuildVariants } of EXECUTABLE_PKG_INFO) { | ||
for (const { name: distributionBuildVariant } of distributionBuildVariants) { | ||
if (executableOsId.startsWith('linux')) { %> | ||
- name: package_and_upload_artifact_<% out(distributionBuildVariant.replace(/-/g, '_')) %> | ||
<% } } } %> | ||
- name: linux_x64_build | ||
display_name: "RHEL 7.0 x64 (build)" | ||
run_on: rhel70-build | ||
|
@@ -1027,6 +1045,12 @@ buildvariants: | |
run_on: rhel80-small | ||
tasks: | ||
- name: e2e_tests_linux_x64 | ||
- name: e2e_rhel83_x64 | ||
display_name: "RHEL 8.3 x64 (E2E Tests, FIPS-available OS)" | ||
run_on: rhel83-fips | ||
tasks: | ||
- name: e2e_tests_linux_x64 | ||
- name: e2e_tests_linux_x64_openssl11 | ||
- name: e2e_ubuntu1804_x64 | ||
display_name: "Ubuntu 18.04 x64 (E2E Tests)" | ||
run_on: ubuntu1804-small | ||
|
@@ -1037,6 +1061,7 @@ buildvariants: | |
run_on: ubuntu2004-small | ||
tasks: | ||
- name: e2e_tests_linux_x64 | ||
- name: e2e_tests_linux_x64_openssl11 | ||
- name: e2e_debian9_x64 | ||
display_name: "Debian 9 x64 (E2E Tests)" | ||
run_on: debian92-small | ||
|
@@ -1047,11 +1072,13 @@ buildvariants: | |
run_on: debian10-small | ||
tasks: | ||
- name: e2e_tests_linux_x64 | ||
- name: e2e_tests_linux_x64_openssl11 | ||
- name: e2e_debian11_x64 | ||
display_name: "Debian 11 x64 (E2E Tests)" | ||
run_on: debian11-small | ||
tasks: | ||
- name: e2e_tests_linux_x64_unstable | ||
- name: e2e_tests_linux_x64_openssl11_unstable | ||
- name: e2e_amazon1_x64 | ||
display_name: "Amazon Linux 1 x64 (E2E Tests)" | ||
run_on: amazon1-2018-small | ||
|
@@ -1082,6 +1109,7 @@ buildvariants: | |
run_on: ubuntu2004-arm64-small | ||
tasks: | ||
- name: e2e_tests_linux_arm64 | ||
- name: e2e_tests_linux_arm64_openssl11 | ||
- name: e2e_amazon2_arm64 | ||
display_name: "Amazon Linux 2 arm64 (E2E Tests)" | ||
run_on: amazon2-arm64-small | ||
|
@@ -1137,22 +1165,26 @@ buildvariants: | |
tasks: | ||
- name: compile_artifact | ||
|
||
- name: pkg_smoke_tests_docker | ||
display_name: "package smoke tests (Docker)" | ||
- name: pkg_smoke_tests_docker_x64 | ||
display_name: "package smoke tests (x64 Docker)" | ||
run_on: ubuntu1804-small | ||
tasks: | ||
- name: pkg_test_docker_centos7_rpm | ||
- name: pkg_test_docker_rocky8_rpm | ||
- name: pkg_test_docker_fedora34_rpm | ||
- name: pkg_test_docker_suse12_rpm | ||
- name: pkg_test_docker_suse15_rpm | ||
- name: pkg_test_docker_amazonlinux1_rpm | ||
- name: pkg_test_docker_amazonlinux2_rpm | ||
- name: pkg_test_docker_debian9_deb | ||
- name: pkg_test_docker_debian10_deb | ||
- name: pkg_test_docker_debian11_deb | ||
- name: pkg_test_docker_ubuntu18_04_deb | ||
- name: pkg_test_docker_ubuntu20_04_deb | ||
<% for (const { distributionBuildVariants, executableOsId } of EXECUTABLE_PKG_INFO) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was wondering, is there a way to move this heavy logic outside of yaml? Seems hard to understand the code here and also a bit intimidating to change. If we are using something like lodash.template or similar I'd prefer something like this with more helpers:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mh yeah, we could look into using It’s definitely easier not to outsource everything from the YAML here though; it has been very helpful to have a single source of truth for how our CI jobs are defined. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's a good point, I mainly find it hard to parse, probably just having helpers to make the code "lighter" would be enough. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It absolutely is hard to parse! I don’t want to act like it isn’t :) I’ll definitely think about it, for now my main goal here is getting everything to work tbh |
||
if (executableOsId.includes('linux-x64')) { | ||
for (const { name, smokeTestKind, smokeTestDockerfiles } of distributionBuildVariants) if (smokeTestKind !== 'none') { | ||
for (const dockerfile of smokeTestDockerfiles || []) { %> | ||
- name: pkg_test_<% out(`${smokeTestKind}_${name}${dockerfile ? `_${dockerfile}` : ''}`.replace(/[-.]/g, '_')) %> | ||
<% } } } } %> | ||
- name: pkg_smoke_tests_docker_arm64 | ||
display_name: "package smoke tests (arm64 Docker)" | ||
run_on: ubuntu1804-arm64-small | ||
tasks: | ||
<% for (const { distributionBuildVariants, executableOsId } of EXECUTABLE_PKG_INFO) { | ||
if (executableOsId.includes('linux-arm64')) { | ||
for (const { name, smokeTestKind, smokeTestDockerfiles } of distributionBuildVariants) if (smokeTestKind !== 'none') { | ||
for (const dockerfile of smokeTestDockerfiles || []) { %> | ||
- name: pkg_test_<% out(`${smokeTestKind}_${name}${dockerfile ? `_${dockerfile}` : ''}`.replace(/[-.]/g, '_')) %> | ||
<% } } } } %> | ||
- name: pkg_smoke_tests_win32 | ||
display_name: "package smoke tests (win32)" | ||
run_on: ubuntu1804-small | ||
|
@@ -1174,26 +1206,6 @@ buildvariants: | |
run_on: macos-1100-arm64 | ||
tasks: | ||
- name: pkg_test_macos_darwin_arm64 | ||
- name: pkg_smoke_tests_ubuntu1804_arm64 | ||
display_name: "package smoke tests (Ubuntu 18.04 arm64)" | ||
run_on: ubuntu1804-arm64-small | ||
tasks: | ||
- name: pkg_test_debextract_debian_arm64 | ||
- name: pkg_smoke_tests_ubuntu2004_arm64 | ||
display_name: "package smoke tests (Ubuntu 20.04 arm64)" | ||
run_on: ubuntu2004-arm64-small | ||
tasks: | ||
- name: pkg_test_debextract_debian_arm64 | ||
- name: pkg_smoke_tests_amazon2_arm64 | ||
display_name: "package smoke tests (RHEL 8.2 arm64)" | ||
run_on: rhel82-arm64-small | ||
tasks: | ||
- name: pkg_test_rpmextract_rhel8_arm64 | ||
- name: pkg_smoke_tests_rhel82_arm64 | ||
display_name: "package smoke tests (Amazon Linux 2 arm64)" | ||
run_on: amazon2-arm64-small | ||
tasks: | ||
- name: pkg_test_rpmextract_amzn2_arm64 | ||
- name: pkg_smoke_tests_rhel72_s390x | ||
display_name: "package smoke tests (RHEL 7.2 s390x)" | ||
run_on: rhel72-zseries-small | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,16 @@ const COPYRIGHT = `${new Date().getYear() + 1900} MongoDB, Inc.`; | |
*/ | ||
const MANPAGE_NAME = 'mongosh.1.gz' | ||
|
||
/** | ||
* The package identifier (not executable identifier), e.g. 'debian-x64-openssl11'. | ||
*/ | ||
const DISTRIBUTION_BUILD_VARIANT = process.env.DISTRIBUTION_BUILD_VARIANT; | ||
|
||
/** | ||
* The shared-openssl suffix for the current package identifer, e.g. 'openssl11'. | ||
*/ | ||
const SHARED_OPENSSL_TAG = DISTRIBUTION_BUILD_VARIANT?.match?.(/-(openssl\d*)$/)?.[1] || ''; | ||
|
||
/** | ||
* Export the configuration for the build. | ||
*/ | ||
|
@@ -101,7 +111,7 @@ module.exports = { | |
triggeringGitTag: process.env.TRIGGERED_BY_GIT_TAG, | ||
platform: os.platform(), | ||
execNodeVersion: process.env.NODE_JS_VERSION || `^${process.version.slice(1)}`, | ||
distributionBuildVariant: process.env.DISTRIBUTION_BUILD_VARIANT, | ||
distributionBuildVariant: DISTRIBUTION_BUILD_VARIANT, | ||
notarySigningKeyName: process.env.NOTARY_SIGNING_KEY_NAME, | ||
notaryAuthToken: process.env.NOTARY_AUTH_TOKEN, | ||
repo: { | ||
|
@@ -151,10 +161,20 @@ module.exports = { | |
}, | ||
metadata: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This may need to be restructured a bit for actually releasing these artifacts, but for now this works. |
||
name: 'mongosh', | ||
rpmName: 'mongodb-mongosh', | ||
debName: 'mongodb-mongosh', | ||
providesName: 'mongodb-shell', | ||
providesVersion: '2.0', | ||
rpmName: 'mongodb-mongosh' + (SHARED_OPENSSL_TAG ? `-shared-${SHARED_OPENSSL_TAG}` : ''), | ||
debName: 'mongodb-mongosh' + (SHARED_OPENSSL_TAG ? `-shared-${SHARED_OPENSSL_TAG}` : ''), | ||
provides: [ | ||
{ name: 'mongodb-shell', version: '2.0' }, | ||
...( | ||
SHARED_OPENSSL_TAG ? | ||
[{ name: 'mongodb-mongosh', version: CLI_REPL_PACKAGE_JSON.version }] : | ||
[] | ||
) | ||
], | ||
debDepends: 'libc6 (>= 2.17), libgssapi-krb5-2' + ( | ||
SHARED_OPENSSL_TAG === 'openssl11' ? ', libssl1.1' : | ||
SHARED_OPENSSL_TAG === 'openssl3' ? ', libssl3' : '' | ||
), | ||
fullName: 'MongoDB Shell', | ||
version: CLI_REPL_PACKAGE_JSON.version, | ||
description: CLI_REPL_PACKAGE_JSON.description, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mongodb-mongosh.spec |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mongodb-mongosh.spec |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM centos:7 | ||
|
||
ARG artifact_url="" | ||
ADD ${artifact_url} /tmp | ||
ADD node_modules /usr/share/mongodb-csfle-library-version/node_modules | ||
RUN yum repolist | ||
# epel-release so that openssl11 is installable | ||
RUN yum install -y epel-release | ||
RUN yum repolist | ||
RUN yum install -y /tmp/*mongosh*.rpm | ||
RUN /usr/bin/mongosh --version | ||
RUN env MONGOSH_RUN_NODE_SCRIPT=1 mongosh /usr/share/mongodb-csfle-library-version/node_modules/.bin/mongodb-csfle-library-version /usr/lib64/mongosh_csfle_v1.so | grep -q ^mongo_csfle_v1- | ||
ENTRYPOINT [ "mongosh" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn’t (shouldn’t?) yet test mongosh in FIPS mode, it’s only that the OS itself is set up to support FIPS.