Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 57 additions & 13 deletions .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ tasks:
###
# E2E TESTS
###
- name: e2e_tests_darwin
- name: e2e_tests_darwin_x64
tags: ["e2e-test"]
depends_on:
- name: compile_artifact
Expand All @@ -606,7 +606,7 @@ tasks:
node_js_version: "14.17.0"
- func: download_compiled_artifact
vars:
executable_os_id: darwin
executable_os_id: darwin-x64
- func: run_e2e_tests
vars:
node_js_version: "14.17.0"
Expand Down Expand Up @@ -694,7 +694,7 @@ tasks:
###
# PACKAGING
###
- name: package_and_upload_artifact_macos
- name: package_and_upload_artifact_macos_x64
depends_on:
- name: check
variant: darwin
Expand All @@ -711,6 +711,25 @@ tasks:
vars:
node_js_version: "14.17.0"
distribution_build_variant: darwin-x64
executable_os_id: darwin-x64
- name: package_and_upload_artifact_macos_arm64
depends_on:
- name: check
variant: darwin
- name: ".unit-test"
variant: darwin
- name: compile_artifact
variant: darwin_arm64
commands:
- func: checkout
- func: install
vars:
node_js_version: "14.17.0"
- func: package_and_upload_artifact
vars:
node_js_version: "14.17.0"
distribution_build_variant: darwin-arm64
executable_os_id: darwin-arm64
- name: package_and_upload_artifact_linux_x64
depends_on:
- name: check
Expand Down Expand Up @@ -1136,10 +1155,10 @@ tasks:
- func: test_artifact_docker
vars:
dockerfile: amazonlinux2-rpm
- name: pkg_test_macos1014
- name: pkg_test_macos1014_x64
tags: ["smoke-test"]
depends_on:
- name: package_and_upload_artifact_macos
- name: package_and_upload_artifact_macos_x64
variant: darwin_codesign
commands:
- func: checkout
Expand All @@ -1148,6 +1167,18 @@ tasks:
source_distribution_build_variant: darwin-x64
- func: write_preload_script
- func: test_artifact_macos
- name: pkg_test_macos1100_arm64
tags: ["smoke-test"]
depends_on:
- name: package_and_upload_artifact_macos_arm64
variant: darwin_codesign
commands:
- func: checkout
- func: get_artifact_url
vars:
source_distribution_build_variant: darwin-arm64
- func: write_preload_script
- func: test_artifact_macos
# We don't have docker for platforms other than x64, so for those we just
# extract the archives locally.
- name: pkg_test_s390x_rpm
Expand Down Expand Up @@ -1248,15 +1279,14 @@ buildvariants:
- name: darwin_codesign
display_name: "MacOS Mojave (codesign)"
run_on: macos-1014-codesign
expansions:
executable_os_id: darwin
tasks:
- name: package_and_upload_artifact_macos
- name: package_and_upload_artifact_macos_x64
- name: package_and_upload_artifact_macos_arm64
- name: darwin
display_name: "MacOS Mojave"
run_on: macos-1014
expansions:
executable_os_id: darwin
executable_os_id: darwin-x64
tasks:
- name: check
- name: test_m40xc_n12
Expand All @@ -1274,7 +1304,16 @@ buildvariants:
- name: test_m44xe_n14
- name: test_mlatest_n14
- name: compile_artifact
- name: e2e_tests_darwin
- name: e2e_tests_darwin_x64
- name: darwin_arm64
display_name: "MacOS Big Sur (arm64)"
run_on: macos-1100-arm64
expansions:
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
display_name: "Ubuntu 18.04 x64"
Expand Down Expand Up @@ -1470,11 +1509,16 @@ buildvariants:
tasks:
- name: pkg_test_ssh_win32
- name: pkg_test_ssh_win32msi
- name: pkg_smoke_tests_macos
display_name: "package smoke tests (macos)"
- name: pkg_smoke_tests_macos_x64
display_name: "package smoke tests (macos x64)"
run_on: macos-1014
tasks:
- name: pkg_test_macos1014
- name: pkg_test_macos1014_x64
- name: pkg_smoke_tests_macos_arm64
display_name: "package smoke tests (macos arm64)"
run_on: macos-1100-arm64
tasks:
- name: pkg_test_macos1100_arm64
- name: pkg_smoke_tests_ubuntu1804_arm64
display_name: "package smoke tests (Ubuntu 18.04 arm64)"
run_on: ubuntu1804-arm64-small
Expand Down
2 changes: 1 addition & 1 deletion packages/build/src/config/build-variant.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ALL_BUILD_VARIANTS } from './build-variant';
describe('BuildVariant', () => {
describe('all build variants', () => {
it('has all of them', () => {
expect(ALL_BUILD_VARIANTS).to.have.length(15); // 4 × 3 linux + 3 others
expect(ALL_BUILD_VARIANTS).to.have.length(16); // 4 × 3 linux + 4 others
expect(ALL_BUILD_VARIANTS).to.contain('win32-x64');
expect(ALL_BUILD_VARIANTS).to.contain('win32msi-x64');
expect(ALL_BUILD_VARIANTS).to.contain('darwin-x64');
Expand Down
3 changes: 2 additions & 1 deletion packages/build/src/config/build-variant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type BuildVariant = `${Distro}-${Arch}`;

export const ALL_BUILD_VARIANTS: readonly BuildVariant[] = Object.freeze([
'win32-x64', 'win32msi-x64',
'darwin-x64',
'darwin-x64', 'darwin-arm64',
'linux-x64', 'linux-s390x', 'linux-arm64', 'linux-ppc64le',
'debian-x64', 'debian-arm64',
'rhel-x64', 'rhel-s390x', 'rhel-arm64', 'rhel-ppc64le',
Expand Down Expand Up @@ -59,6 +59,7 @@ export function getDownloadCenterDistroDescription(variant: BuildVariant): strin
switch (variant) {
case 'win32-x64': return 'Windows 64-bit (8.1+)';
case 'win32msi-x64': return 'Windows 64-bit (8.1+) (MSI)';
case 'darwin-arm64': return 'MacOS M1 (11.0+)';
case 'darwin-x64': return 'MacOS 64-bit (10.12+)';
case 'linux-x64': return 'Linux Tarball 64-bit';
case 'linux-s390x': return 'Linux Tarball s390x';
Expand Down
3 changes: 2 additions & 1 deletion packages/build/src/download-center/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ describe('DownloadCenter config', () => {
it('has an artifact for darwin', () => {
const [version] = config.versions;
const platforms = version.platform.filter(p => p.os === 'darwin');
expect(platforms).to.have.length(1);
expect(platforms).to.have.length(2);
expect(platforms[0].download_link).to.include('mongosh-1.2.2-darwin-x64.zip');
expect(platforms[1].download_link).to.include('mongosh-1.2.2-darwin-arm64.zip');
});

it('has an artifact for linux', () => {
Expand Down
19 changes: 15 additions & 4 deletions packages/build/src/packaging/run-package.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { constants as fsConstants, promises as fs } from 'fs';
import path from 'path';
import os from 'os';
import { Config, Platform, validateBuildVariant } from '../config';
import { downloadMongocrypt } from './download-mongocryptd';
Expand All @@ -12,10 +13,20 @@ export async function runPackage(
const distributionBuildVariant = config.distributionBuildVariant;
validateBuildVariant(distributionBuildVariant);

await fs.copyFile(
await downloadMongocrypt(distributionBuildVariant),
config.mongocryptdPath,
fsConstants.COPYFILE_FICLONE);
await fs.mkdir(path.dirname(config.mongocryptdPath), { recursive: true });
// TODO: add mongocryptd and E2E tests for darwin-arm64 once server builds
// are available for that platform.
if (distributionBuildVariant !== 'darwin-arm64') {
await fs.copyFile(
await downloadMongocrypt(distributionBuildVariant),
config.mongocryptdPath,
fsConstants.COPYFILE_FICLONE);
} else {
await fs.copyFile(
path.resolve(__dirname, '..', '..', '..', '..', 'scripts', 'no-mongocryptd.sh'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this going to work? Will it affect something that mongosh does automatically or is rather there if users tries to run mongocryptd manually?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, mongosh won’t be able to do automatic FLE for the time being. The exposed binary is still named mongocryptd-mongosh, so I don’t think it’s something the user would run by accident.

config.mongocryptdPath,
fsConstants.COPYFILE_FICLONE);
}

const runCreatePackage = async(): Promise<PackageFile> => {
return await createPackage(
Expand Down
5 changes: 5 additions & 0 deletions packages/cli-repl/src/smoke-tests-fle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ const assert = function(value, message) {
process.exit(1);
}
};
// There is no mongocryptd binary for darwin-x64 yet.
if (os.platform() === 'darwin' && os.arch() === 'arm64') {
print('Test skipped')
process.exit(0);
}
if (db.version().startsWith('4.0.') ||
!db.runCommand({buildInfo:1}).modules.includes('enterprise')) {
// No FLE on mongod < 4.2 or community
Expand Down
2 changes: 2 additions & 0 deletions scripts/no-mongocryptd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo Sorry, mongocryptd is not available for this platform yet.
2 changes: 1 addition & 1 deletion scripts/prep-fle-addon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ echo Using libmongocrypt at git tag "$LIBMONGOCRYPT_VERSION"
if [ x"$FLE_NODE_SOURCE_PATH" != x"" -a -z "$BUILD_FLE_FROM_SOURCE" ]; then
# Use prebuilt binaries where available.
case `uname -a` in
Darwin*) PREBUILT_OSNAME=macos;;
Darwin*x86_64*) PREBUILT_OSNAME=macos;;
Linux*x86_64*) PREBUILT_OSNAME=rhel-70-64-bit;;
Linux*s390x*) PREBUILT_OSNAME=rhel72-zseries-test;;
Linux*aarch64*) PREBUILT_OSNAME=ubuntu1804-arm64;;
Expand Down