@@ -52,64 +52,18 @@ is_python_310() {
52
52
}
53
53
54
54
55
- retry () {
56
- for i in 1 2 4 8 16; do
57
- { " $@ " && return 0; } || sleep $i
58
- done
59
- return 1
60
- }
61
-
62
55
63
56
# start mongodb-atlas-local container, because of a bug in podman we have to define the healtcheck ourselves (is the same as in the image)
64
57
# stores the connection string in .local_atlas_uri file
65
58
setup_local_atlas () {
66
- echo " Starting the container"
67
-
68
- IMAGE=mongodb/mongodb-atlas-local:latest
69
- retry podman pull $IMAGE
70
-
71
- podman kill mongodb_atlas_local || true
72
-
73
- CONTAINER_ID=$( podman run --rm -d -e DO_NOT_TRACK=1 -P --health-cmd " /usr/local/bin/runner healthcheck" $IMAGE )
74
- podman rename $CONTAINER_ID mongodb_atlas_local || true
75
-
76
- echo " waiting for container to become healthy..."
77
- function wait() {
78
- CONTAINER_ID=$1
79
-
80
- echo " waiting for container to become healthy..."
81
- podman healthcheck run " $CONTAINER_ID "
82
- for _ in $( seq 600) ; do
83
- STATE=$( podman inspect -f ' {{ .State.Health.Status }}' " $CONTAINER_ID " )
84
-
85
- case $STATE in
86
- healthy)
87
- echo " container is healthy"
88
- return 0
89
- ;;
90
- unhealthy)
91
- echo " container is unhealthy"
92
- podman logs " $CONTAINER_ID "
93
- stop
94
- exit 1
95
- ;;
96
- * )
97
- echo " Unrecognized state $STATE "
98
- sleep 1
99
- esac
100
- done
101
-
102
- echo " container did not get healthy within 120 seconds, quitting"
103
- podman logs mongodb_atlas_local
104
- stop
105
- exit 2
106
- }
107
-
108
- wait " $CONTAINER_ID "
109
- EXPOSED_PORT=$( podman inspect --format=' {{ (index (index .NetworkSettings.Ports "27017/tcp") 0).HostPort }}' " $CONTAINER_ID " )
110
- export CONN_STRING=" mongodb://127.0.0.1:$EXPOSED_PORT /?directConnection=true"
111
59
SCRIPT_DIR=$( realpath " $( dirname ${BASH_SOURCE[0]} ) " )
112
- echo " CONN_STRING=mongodb://127.0.0.1:$EXPOSED_PORT /?directConnection=true" > $SCRIPT_DIR /.local_atlas_uri
60
+ # Ensure drivers-evergeen-tools checkout.
61
+ pushd $SCRIPT_DIR /..
62
+ git clone https://github.com/mongodb-labs/drivers-evergreen-tools || true
63
+ . drivers-evergreen-tools/.evergreen/run-orchestration.sh --local-atlas -v
64
+ popd
65
+ export CONN_STRING" =mongodb://127.0.0.1:27017/?directConnection=true"
66
+ echo " CONN_STRING=$CONN_STRING " > $SCRIPT_DIR /.local_atlas_uri
113
67
}
114
68
115
69
fetch_local_atlas_uri () {
0 commit comments