Skip to content

Commit dae0573

Browse files
woohoo
1 parent ba42206 commit dae0573

15 files changed

+305
-87
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: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,19 @@ functions:
734734
args:
735735
- ${PROJECT_DIRECTORY}/.evergreen/install-mongodb-client-encryption.sh
736736

737+
"build docker alpine image":
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+
binary: bash
747+
args:
748+
- etc/docker.sh
749+
737750
tasks:
738751
- name: 'test-atlas-data-lake'
739752
tags: ["datalake", "mongohouse"]
@@ -994,7 +1007,6 @@ tasks:
9941007
add_expansions_to_env: true
9951008
args:
9961009
- .evergreen/run-search-index-management-tests.sh
997-
9981010
task_groups:
9991011
- name: serverless_task_group
10001012
setup_group_can_fail_task: true

.evergreen/config.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,18 @@ functions:
657657
binary: bash
658658
args:
659659
- ${PROJECT_DIRECTORY}/.evergreen/install-mongodb-client-encryption.sh
660+
build docker alpine image:
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+
binary: bash
670+
args:
671+
- etc/docker.sh
660672
tasks:
661673
- name: test-atlas-data-lake
662674
tags:
@@ -1627,6 +1639,25 @@ tasks:
16271639
- func: install dependencies
16281640
- func: bootstrap mongo-orchestration
16291641
- func: run-compression-tests
1642+
- name: test-alpine-fle
1643+
tags:
1644+
- alpine-fle
1645+
commands:
1646+
- command: expansions.update
1647+
type: setup
1648+
params:
1649+
updates:
1650+
- {key: VERSION, value: latest}
1651+
- {key: TOPOLOGY, value: replica_set}
1652+
- {key: AUTH, value: auth}
1653+
- {key: CLIENT_ENCRYPTION, value: 'true'}
1654+
- {key: TEST_CSFLE, value: 'true'}
1655+
- {key: MONGODB_BINARIES, value: '${PROJECT_DIRECTORY}/mongodb/bin'}
1656+
- func: install dependencies
1657+
- func: bootstrap mongo-orchestration
1658+
- func: bootstrap kms servers
1659+
- func: assume secrets manager rule
1660+
- func: build docker alpine image
16301661
- name: test-tls-support-latest
16311662
tags:
16321663
- tls-support
@@ -4224,6 +4255,7 @@ buildvariants:
42244255
- test-snappy-compression
42254256
- test-zstd-1.x-compression
42264257
- test-zstd-2.x-compression
4258+
- test-alpine-fle
42274259
- test-tls-support-latest
42284260
- test-tls-support-8.0
42294261
- test-tls-support-7.0
@@ -4284,6 +4316,7 @@ buildvariants:
42844316
- test-snappy-compression
42854317
- test-zstd-1.x-compression
42864318
- test-zstd-2.x-compression
4319+
- test-alpine-fle
42874320
- test-tls-support-latest
42884321
- test-tls-support-8.0
42894322
- test-tls-support-7.0
@@ -4344,6 +4377,7 @@ buildvariants:
43444377
- test-snappy-compression
43454378
- test-zstd-1.x-compression
43464379
- test-zstd-2.x-compression
4380+
- test-alpine-fle
43474381
- test-tls-support-latest
43484382
- test-tls-support-8.0
43494383
- test-tls-support-7.0
@@ -4404,6 +4438,7 @@ buildvariants:
44044438
- test-snappy-compression
44054439
- test-zstd-1.x-compression
44064440
- test-zstd-2.x-compression
4441+
- test-alpine-fle
44074442
- test-tls-support-latest
44084443
- test-tls-support-8.0
44094444
- test-tls-support-7.0
@@ -4461,6 +4496,7 @@ buildvariants:
44614496
- test-snappy-compression
44624497
- test-zstd-1.x-compression
44634498
- test-zstd-2.x-compression
4499+
- test-alpine-fle
44644500
- test-tls-support-latest
44654501
- test-tls-support-8.0
44664502
- test-tls-support-7.0
@@ -4510,6 +4546,7 @@ buildvariants:
45104546
- test-snappy-compression
45114547
- test-zstd-1.x-compression
45124548
- test-zstd-2.x-compression
4549+
- test-alpine-fle
45134550
- test-tls-support-latest
45144551
- test-tls-support-8.0
45154552
- test-tls-support-7.0
@@ -4559,6 +4596,7 @@ buildvariants:
45594596
- test-snappy-compression
45604597
- test-zstd-1.x-compression
45614598
- test-zstd-2.x-compression
4599+
- test-alpine-fle
45624600
- test-tls-support-latest
45634601
- test-tls-support-8.0
45644602
- test-tls-support-7.0
@@ -4608,6 +4646,7 @@ buildvariants:
46084646
- test-snappy-compression
46094647
- test-zstd-1.x-compression
46104648
- test-zstd-2.x-compression
4649+
- test-alpine-fle
46114650
- test-tls-support-latest
46124651
- test-tls-support-8.0
46134652
- test-tls-support-7.0
@@ -4657,6 +4696,7 @@ buildvariants:
46574696
- test-snappy-compression
46584697
- test-zstd-1.x-compression
46594698
- test-zstd-2.x-compression
4699+
- test-alpine-fle
46604700
- test-tls-support-latest
46614701
- test-tls-support-8.0
46624702
- test-tls-support-7.0
@@ -4834,6 +4874,14 @@ buildvariants:
48344874
- run-custom-csfle-tests-rapid
48354875
- run-custom-csfle-tests-latest
48364876
- test-latest-driver-mongodb-client-encryption-6.0.0
4877+
- name: rhel8-test-serverless
4878+
display_name: Serverless Test
4879+
run_on: rhel80-large
4880+
expansions:
4881+
NODE_LTS_VERSION: 16
4882+
NPM_VERSION: 9
4883+
tasks:
4884+
- serverless_task_group
48374885
- name: rhel8-test-gcp-kms
48384886
display_name: GCP KMS Test
48394887
run_on: debian11-small
@@ -4913,3 +4961,8 @@ buildvariants:
49134961
run_on: rhel80-large
49144962
tasks:
49154963
- .resource-management
4964+
- name: alpine FLE test
4965+
display_name: alpine FLE test
4966+
run_on: ubuntu2204-small
4967+
tasks:
4968+
- .alpine-fle

.evergreen/docker/Dockerfile.musl

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 .
22+
23+
# TODO: remove this cloning once we have an official release of FLE
24+
WORKDIR /mongodb-client-encryption
25+
RUN <<EOF
26+
git clone https://github.com/baileympearson/mongodb-client-encryption.git .
27+
cd mongodb-client-encryption
28+
git switch alpine
29+
npm run install:libmongocrypt
30+
EOF
31+
32+
# TODO: don't copy in current dir, instead mount it as a volume at runtime.
33+
WORKDIR /node-mongodb-native
34+
COPY . .
35+
RUN npm install ../mongodb-client-encryption

.evergreen/generate_evergreen_tasks.js

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,26 @@ TASKS.push({
276276
]
277277
});
278278

279+
TASKS.push({
280+
name: `test-alpine-fle`,
281+
tags: ['alpine-fle'],
282+
commands: [
283+
updateExpansions({
284+
VERSION: 'latest',
285+
TOPOLOGY: 'replica_set',
286+
AUTH: 'auth',
287+
CLIENT_ENCRYPTION: 'true',
288+
TEST_CSFLE: 'true',
289+
MONGODB_BINARIES: '${PROJECT_DIRECTORY}/mongodb/bin'
290+
}),
291+
{ func: 'install dependencies' },
292+
{ func: 'bootstrap mongo-orchestration' },
293+
{ func: 'bootstrap kms servers' },
294+
{ func: 'assume secrets manager rule' },
295+
{ func: 'build docker alpine image' }
296+
]
297+
});
298+
279299
const AWS_LAMBDA_HANDLER_TASKS = [];
280300
// Add task for testing lambda example without aws auth.
281301
AWS_LAMBDA_HANDLER_TASKS.push({
@@ -788,16 +808,16 @@ BUILD_VARIANTS.push({
788808

789809
// TODO(NODE-6748): unskip serverless tests when getParameter and failPoints are possible
790810
// special case for serverless testing
791-
// BUILD_VARIANTS.push({
792-
// name: 'rhel8-test-serverless',
793-
// display_name: 'Serverless Test',
794-
// run_on: DEFAULT_OS,
795-
// expansions: {
796-
// NODE_LTS_VERSION: LOWEST_LTS,
797-
// NPM_VERSION: 9
798-
// },
799-
// tasks: ['serverless_task_group']
800-
// });
811+
BUILD_VARIANTS.push({
812+
name: 'rhel8-test-serverless',
813+
display_name: 'Serverless Test',
814+
run_on: DEFAULT_OS,
815+
expansions: {
816+
NODE_LTS_VERSION: LOWEST_LTS,
817+
NPM_VERSION: 9
818+
},
819+
tasks: ['serverless_task_group']
820+
});
801821

802822
BUILD_VARIANTS.push({
803823
name: 'rhel8-test-gcp-kms',
@@ -870,6 +890,13 @@ BUILD_VARIANTS.push({
870890
tasks: ['.resource-management']
871891
});
872892

893+
BUILD_VARIANTS.push({
894+
name: 'alpine FLE test',
895+
display_name: 'alpine FLE test',
896+
run_on: 'ubuntu2204-small',
897+
tasks: ['.alpine-fle']
898+
});
899+
873900
// TODO(NODE-4897): Debug socks5 tests on node latest
874901
for (const variant of BUILD_VARIANTS.filter(
875902
variant => variant.expansions && ['latest'].includes(variant.expansions.NODE_LTS_VERSION)

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#! /usr/bin/env bash
2+
3+
source secrets-export.sh
4+
5+
export ALPINE=true
6+
npm run check:csfle

etc/docker.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#! /bin/bash
2+
3+
# script to aid in local testing of linux platforms
4+
# requires a running docker instance
5+
6+
# s390x, arm64, amd64 for ubuntu
7+
# amd64 or arm64v8 for alpine
8+
LINUX_ARCH=arm64v8
9+
10+
# 16.20.1+, default 16.20.1
11+
NODE_VERSION=20.0.0
12+
13+
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+
# set up FLE creds on host. don't download cryptd because we don't need it.
30+
RUN_WITH_MONGOCRYPTD=true bash .evergreen/setup-fle.sh
31+
32+
# launch a mongocryptd on the host.
33+
./mongodb/bin/mongocryptd --fork --port 3000 --pidfilepath $(pwd)/pid.file --logpath $(pwd)/logpath
34+
MONGOCRYPTD_URI='mongodb://localhost:3000'
35+
36+
# run FLE tests in container, using mongocryptd and replica set running on host
37+
docker --debug run \
38+
--platform linux/$LINUX_ARCH \
39+
-e MONGODB_URI=${MONGODB_URI} -e MONGOCRYPTD_URI=${MONGOCRYPTD_URI} \
40+
--network host \
41+
--entrypoint bash \
42+
$IMAGE_TAG \
43+
'.evergreen/run-alpine-fle-tests.sh'
44+
}
45+
46+
build_alpine
47+
test_alpine

0 commit comments

Comments
 (0)