Skip to content

Commit 2156bc6

Browse files
authored
Merge branch 'main' into NODE-6755
2 parents 1c7e1f6 + 421ddeb commit 2156bc6

22 files changed

+633
-339
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
lib
3+
.nyc_output
4+
docs
5+
*dylib
6+
*md

.evergreen/config.in.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,21 @@ functions:
734734
args:
735735
- ${PROJECT_DIRECTORY}/.evergreen/install-mongodb-client-encryption.sh
736736

737+
"build and test alpine FLE":
738+
- command: subprocess.exec
739+
type: test
740+
params:
741+
working_dir: "src"
742+
env:
743+
INSTALL_DIR: mongodb-client-encryption
744+
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
745+
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
746+
NODE_VERSION: ${NODE_VERSION}
747+
MONGODB_URI: ${MONGODB_URI}
748+
binary: bash
749+
args:
750+
- .evergreen/docker/alpine.sh
751+
737752
tasks:
738753
- name: 'test-atlas-data-lake'
739754
tags: ["datalake", "mongohouse"]
@@ -1272,3 +1287,10 @@ post:
12721287

12731288
ignore:
12741289
- "*.md"
1290+
1291+
buildvariants:
1292+
- name: Alpine FLE Tests
1293+
display_name: Alpine FLE Test
1294+
run_on: ubuntu2204-small
1295+
tasks:
1296+
- .alpine-fle

.evergreen/config.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,20 @@ functions:
657657
binary: bash
658658
args:
659659
- ${PROJECT_DIRECTORY}/.evergreen/install-mongodb-client-encryption.sh
660+
build and test alpine FLE:
661+
- command: subprocess.exec
662+
type: test
663+
params:
664+
working_dir: src
665+
env:
666+
INSTALL_DIR: mongodb-client-encryption
667+
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
668+
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
669+
NODE_VERSION: ${NODE_VERSION}
670+
MONGODB_URI: ${MONGODB_URI}
671+
binary: bash
672+
args:
673+
- .evergreen/docker/alpine.sh
660674
tasks:
661675
- name: test-atlas-data-lake
662676
tags:
@@ -1520,6 +1534,11 @@ tasks:
15201534
- auth
15211535
- kerberos
15221536
commands:
1537+
- command: expansions.update
1538+
type: setup
1539+
params:
1540+
updates:
1541+
- {key: NATIVE, value: 'true'}
15231542
- func: install dependencies
15241543
- func: run kerberos tests
15251544
- name: test-auth-ldap
@@ -2300,6 +2319,25 @@ tasks:
23002319
vars:
23012320
23022321
- func: run tests
2322+
- name: test-alpine-fle
2323+
tags:
2324+
- alpine-fle
2325+
commands:
2326+
- command: expansions.update
2327+
type: setup
2328+
params:
2329+
updates:
2330+
- {key: NODE_VERSION, value: 16.20.1}
2331+
- {key: VERSION, value: latest}
2332+
- {key: TOPOLOGY, value: replica_set}
2333+
- {key: CLIENT_ENCRYPTION, value: 'true'}
2334+
- {key: TEST_CSFLE, value: 'true'}
2335+
- {key: MONGODB_BINARIES, value: '${PROJECT_DIRECTORY}/mongodb/bin'}
2336+
- func: install dependencies
2337+
- func: bootstrap mongo-orchestration
2338+
- func: bootstrap kms servers
2339+
- func: assume secrets manager rule
2340+
- func: build and test alpine FLE
23032341
- name: test-latest-server-noauth
23042342
tags:
23052343
- latest
@@ -3191,6 +3229,11 @@ post:
31913229
ignore:
31923230
- '*.md'
31933231
buildvariants:
3232+
- name: Alpine FLE Tests
3233+
display_name: Alpine FLE Test
3234+
run_on: ubuntu2204-small
3235+
tasks:
3236+
- .alpine-fle
31943237
- name: rhel80-large-gallium
31953238
display_name: rhel8 Node16
31963239
run_on: rhel80-large
@@ -3813,6 +3856,7 @@ buildvariants:
38133856
batchtime: 20160
38143857
tasks:
38153858
- testtestoidc_task_group
3859+
- testazureoidc_task_group
38163860
- testgcpoidc_task_group
38173861
- testk8soidc_task_group_eks
38183862
- testk8soidc_task_group_gke

.evergreen/docker/Dockerfile.musl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ARG ARCH=arm64
2+
ARG NODE_VERSION=16.20.1
3+
4+
FROM ${ARCH}/node:${NODE_VERSION}-alpine AS dependencies
5+
6+
RUN apk --no-cache add make g++ libc-dev curl bash python3 py3-pip cmake git vim ranger
7+
8+
# useful debugging output
9+
RUN <<EOF
10+
python3 --version
11+
git --version
12+
c++ --version
13+
g++ --version
14+
EOF
15+
16+
# clone drivers evergreen tools into the same location that it lives on the host machine
17+
# this ensures any paths configured in variables by drivers-evergreen-tools work
18+
# in the container too.
19+
ARG DRIVERS_TOOLS=drivers-evergreen-tools
20+
WORKDIR ${DRIVERS_TOOLS}
21+
RUN git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git .

.evergreen/docker/alpine.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#! /bin/bash
2+
3+
# script to aid in local testing of linux platforms
4+
# requires a running docker instance
5+
6+
if [ -z ${NODE_VERSION+omitted} ]; then echo "NODE_VERSION is unset" && exit 1; fi
7+
if [ -z ${DRIVERS_TOOLS+omitted} ]; then echo "DRIVERS_TOOLS is unset" && exit 1; fi
8+
if [ -z ${MONGODB_URI+omitted} ]; then echo "MONGODB_URI is unset" && exit 1; fi
9+
10+
# ubuntu2204 hosts in ci use amd64
11+
LINUX_ARCH=${LINUX_ARCH:-amd64}
12+
13+
IMAGE_TAG=${IMAGE_TAG:-alpine-fle-image}
14+
15+
build_alpine() {
16+
docker buildx create --name builder --bootstrap --use
17+
18+
BASE_TAG=$LINUX_ARCH-alpine-base-node-$NODE_VERSION
19+
docker --debug buildx build --load --progress=plain \
20+
--platform linux/$LINUX_ARCH \
21+
--build-arg="ARCH=$LINUX_ARCH" \
22+
--build-arg="NODE_VERSION=$NODE_VERSION" \
23+
--build-arg="DRIVERS_TOOLS=$DRIVERS_TOOLS" \
24+
-f ./.evergreen/docker/Dockerfile.musl -t $IMAGE_TAG \
25+
.
26+
}
27+
28+
test_alpine() {
29+
# # launch a mongocryptd on the host.
30+
./mongodb/bin/mongocryptd --fork --port 3000 --pidfilepath $(pwd)/pid.file --logpath $(pwd)/logpath
31+
MONGOCRYPTD_URI='mongodb://localhost:3000'
32+
33+
# set up FLE creds on host. don't download cryptd because we don't need it.
34+
RUN_WITH_MONGOCRYPTD=true bash .evergreen/setup-fle.sh
35+
36+
# remove node_modules to remove any already downloaded prebuilds
37+
rm -rf node_modules
38+
39+
# run FLE tests in container, using mongocryptd and replica set running on host.
40+
# mount the current directory (the driver's root) as /node-mongodb-native and
41+
# use that as the working directory for `run-alpine-fle-tests.sh`
42+
docker --debug run \
43+
--platform linux/$LINUX_ARCH \
44+
-e MONGODB_URI=${MONGODB_URI} -e MONGOCRYPTD_URI=${MONGOCRYPTD_URI} \
45+
--volume $(pwd):/node-mongodb-native -w /node-mongodb-native \
46+
--network host \
47+
--entrypoint bash \
48+
$IMAGE_TAG \
49+
'.evergreen/run-alpine-fle-tests.sh'
50+
}
51+
52+
build_alpine
53+
test_alpine

.evergreen/generate_evergreen_tasks.js

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,13 @@ TASKS.push(
162162
{
163163
name: 'test-auth-kerberos',
164164
tags: ['auth', 'kerberos'],
165-
commands: [{ func: 'install dependencies' }, { func: 'run kerberos tests' }]
165+
commands: [
166+
updateExpansions({
167+
NATIVE: 'true'
168+
}),
169+
{ func: 'install dependencies' },
170+
{ func: 'run kerberos tests' }
171+
]
166172
},
167173
{
168174
name: 'test-auth-ldap',
@@ -729,6 +735,28 @@ const coverageTask = {
729735
SINGLETON_TASKS.push(coverageTask);
730736
SINGLETON_TASKS.push(...customDependencyTests);
731737

738+
SINGLETON_TASKS.push(
739+
{
740+
name: `test-alpine-fle`,
741+
tags: ['alpine-fle'],
742+
commands: [
743+
updateExpansions({
744+
NODE_VERSION: '16.20.1',
745+
VERSION: 'latest',
746+
TOPOLOGY: 'replica_set',
747+
CLIENT_ENCRYPTION: true,
748+
TEST_CSFLE: true,
749+
MONGODB_BINARIES: '${PROJECT_DIRECTORY}/mongodb/bin',
750+
}),
751+
{ func: 'install dependencies' },
752+
{ func: 'bootstrap mongo-orchestration' },
753+
{ func: 'bootstrap kms servers' },
754+
{ func: 'assume secrets manager rule' },
755+
{ func: 'build and test alpine FLE' }
756+
]
757+
}
758+
)
759+
732760
function addPerformanceTasks() {
733761
const makePerfTask = (name, MONGODB_CLIENT_OPTIONS) => ({
734762
name,
@@ -823,7 +851,7 @@ BUILD_VARIANTS.push({
823851
batchtime: 20160,
824852
tasks: [
825853
'testtestoidc_task_group',
826-
// 'testazureoidc_task_group', TODO(NODE-6750): Unskip failed azure failed login
854+
'testazureoidc_task_group',
827855
'testgcpoidc_task_group',
828856
'testk8soidc_task_group_eks',
829857
'testk8soidc_task_group_gke',

.evergreen/install-dependencies.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ export NODE_LTS_VERSION=${NODE_LTS_VERSION:-16}
1111
# be handled by this script in drivers tools.
1212
source $DRIVERS_TOOLS/.evergreen/install-node.sh
1313

14+
if [ "$NATIVE" = "true" ]; then
15+
# https://github.com/nodejs/node-gyp#configuring-python-dependency
16+
. $DRIVERS_TOOLS/.evergreen/find-python3.sh
17+
NODE_GYP_FORCE_PYTHON=$(find_python3)
18+
export NODE_GYP_FORCE_PYTHON
19+
fi
20+
1421
npm install "${NPM_OPTIONS}"
1522

1623
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh

.evergreen/run-alpine-fle-tests.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#! /usr/bin/env bash
2+
3+
set -o errexit
4+
source secrets-export.sh
5+
set -o xtrace
6+
7+
# use local cache - otherwise npm tries to install to ~ in the docker container, which
8+
# fails when in a mounted volume
9+
export npm_config_cache=$(pwd)/.cache
10+
npm install
11+
12+
ALPINE=true \
13+
npm run check:csfle

.evergreen/run-kerberos-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export MONGODB_URI="mongodb://${USER}@${SASL_HOST}/${GSSAPI_DB}?authMechanism=GS
2828

2929
set -o xtrace
3030

31+
npm i kerberos
3132
npm run check:kerberos
3233

3334
set +o xtrace

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "6.13.0"
2+
".": "6.13.1"
33
}

0 commit comments

Comments
 (0)