Skip to content

Commit 1cc6994

Browse files
DRIVERS-3055 Run atlas local cluster in Evergreen and GitHub actions (#641)
Co-authored-by: Ezra Chung <[email protected]>
1 parent ee45f67 commit 1cc6994

File tree

13 files changed

+285
-114
lines changed

13 files changed

+285
-114
lines changed

.evergreen/atlas_data_lake/pull-mongohouse-image.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ if [ ! -f secrets-export.sh ]; then
1313
fi
1414
source secrets-export.sh
1515
unset AWS_SESSION_TOKEN
16-
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $REPO
17-
docker pull $REPO
16+
if command -v podman &> /dev/null; then
17+
DOCKER=podman
18+
else
19+
DOCKER=docker
20+
fi
21+
aws ecr get-login-password --region us-east-1 | $DOCKER login --username AWS --password-stdin $REPO
22+
$DOCKER pull $REPO
1823
popd

.evergreen/atlas_data_lake/run-mongohouse-image.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ IMAGE=904697982180.dkr.ecr.us-east-1.amazonaws.com/atlas-query-engine-test
1212
USE_TTY=""
1313
test -t 1 && USE_TTY="-t"
1414
if command -v podman &> /dev/null; then
15-
DOCKER="podman --storage-opt ignore_chown_errors=true"
15+
DOCKER=podman
1616
else
1717
DOCKER=docker
1818
fi

.evergreen/config.yml

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,17 @@ functions:
293293
binary: sh
294294
env:
295295
MONGODB_VERSION: ${VERSION}
296-
TOPOLOGY: ${TOPOLOGY}
297-
SSL: ${SSL}
298-
AUTH: ${AUTH}
299-
STORAGE_ENGINE: ${STORAGE_ENGINE}
300-
LOAD_BALANCER: ${LOAD_BALANCER}
301-
REQUIRE_API_VERSION: ${REQUIRE_API_VERSION}
296+
include_expansions_in_env:
297+
- AUTH
298+
- LOAD_BALANCER
299+
- LOCAL_ATLAS
300+
- REQUIRE_API_VERSION,
301+
- SSL
302+
- STORAGE_ENGINE
303+
- TOPOLOGY
302304
args:
303305
- ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
306+
- -v
304307
# run-orchestration generates expansion file with the MONGODB_URI for the cluster
305308
- command: expansions.update
306309
params:
@@ -699,6 +702,15 @@ tasks:
699702

700703
# Standard test tasks {{{
701704

705+
- name: "test-8.0-local-atlas"
706+
tags: ["8.0", "local-atlas"]
707+
commands:
708+
- func: "bootstrap mongo-orchestration"
709+
vars:
710+
VERSION: "8.0"
711+
LOCAL_ATLAS: "1"
712+
- func: "run tests"
713+
702714
- name: "test-8.0-standalone"
703715
tags: ["8.0", "standalone"]
704716
commands:
@@ -736,6 +748,15 @@ tasks:
736748
REQUIRE_API_VERSION: "1"
737749
- func: "run tests"
738750

751+
- name: "test-7.0-local-atlas"
752+
tags: ["7.0", "local-atlas"]
753+
commands:
754+
- func: "bootstrap mongo-orchestration"
755+
vars:
756+
VERSION: "7.0"
757+
LOCAL_ATLAS: "1"
758+
- func: "run tests"
759+
739760
- name: "test-7.0-standalone"
740761
tags: ["7.0", "standalone"]
741762
commands:
@@ -925,6 +946,15 @@ tasks:
925946
TOPOLOGY: "sharded_cluster"
926947
- func: "run tests"
927948

949+
- name: "test-latest-local-atlas"
950+
tags: ["latest", "local-atlas"]
951+
commands:
952+
- func: "bootstrap mongo-orchestration"
953+
vars:
954+
VERSION: "latest"
955+
LOCAL_ATLAS: "1"
956+
- func: "run tests"
957+
928958
- name: "test-latest-standalone"
929959
tags: ["latest", "standalone"]
930960
commands:
@@ -1462,6 +1492,16 @@ buildvariants:
14621492
- ".data_lake"
14631493
- ".ocsp"
14641494
- ".docker"
1495+
- ".local-atlas"
1496+
1497+
- name: tests-podman
1498+
display_name: Podman Tests
1499+
run_on:
1500+
- rhel94-small
1501+
tasks:
1502+
- ".data_lake"
1503+
- ".docker"
1504+
- ".local-atlas"
14651505

14661506
- name: tests-oidc
14671507
display_name: Auth OIDC

.evergreen/docker/run-server.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if [[ -z $PLATFORM && -n $ARCH ]]; then
1919
fi
2020

2121
if command -v podman &> /dev/null; then
22-
DOCKER="podman --storage-opt ignore_chown_errors=true"
22+
DOCKER="sudo podman --storage-opt ignore_chown_errors=true"
2323
else
2424
DOCKER=docker
2525
fi

.evergreen/docker/teardown.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Tear down docker-releated assets.
4+
#
5+
set -eu
6+
7+
SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
8+
. $SCRIPT_DIR/../handle-paths.sh
9+
10+
# Find the appropriate docker command.
11+
if command -v podman &> /dev/null; then
12+
DOCKER="sudo podman"
13+
else
14+
DOCKER=docker
15+
fi
16+
if ! command -v $DOCKER &> /dev/null; then
17+
exit 0
18+
fi
19+
20+
# Kill all containers.
21+
$DOCKER rm "$($DOCKER ps -a -q)" &> /dev/null || true
22+
23+
# Remove all images.
24+
$DOCKER rmi -f "$($DOCKER -a -q)" &> /dev/null || true
25+
26+
# Remove all generated files in this subfolder.
27+
pushd $SCRIPT_DIR > /dev/null
28+
29+
if command -v sudo &> /dev/null; then
30+
sudo git clean -dffx
31+
else
32+
git clean -dffx
33+
fi
34+
35+
popd > /dev/null

0 commit comments

Comments
 (0)