Skip to content

Commit aad1756

Browse files
committed
Try again with mongocryptd
1 parent db4aadb commit aad1756

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

.github/workflows/encrypted_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"auto_encryption_opts": AutoEncryptionOpts(
1111
key_vault_namespace="my_encrypted_database.keyvault",
1212
kms_providers={"local": {"key": os.urandom(96)}},
13-
crypt_shared_lib_path="lib/mongo_crypt_v1.so",
13+
# crypt_shared_lib_path="lib/mongo_crypt_v1.so",
1414
),
1515
"directConnection": True,
1616
},
Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,42 @@
11
#!/bin/bash
22
set -eu
33

4-
echo "Starting the container"
4+
echo "Starting MongoDB Atlas Local container..."
55

66
IMAGE=${1:-mongodb/mongodb-atlas-local:latest}
77
DOCKER=$(which docker || which podman)
88

9+
# Pull the latest Atlas Local image
910
$DOCKER pull $IMAGE
1011

12+
# Stop any existing Atlas Local container
1113
$DOCKER kill mongodb_atlas_local || true
1214

15+
# Run Atlas Local
1316
CONTAINER_ID=$($DOCKER run --rm -d --name mongodb_atlas_local -p 27017:27017 $IMAGE)
1417

15-
function wait() {
16-
CONTAINER_ID=$1
17-
echo "waiting for container to become healthy..."
18+
function wait_for_container() {
19+
local container_id=$1
20+
echo "Waiting for container to become healthy..."
21+
sleep 2
1822
$DOCKER logs mongodb_atlas_local
1923
}
2024

21-
wait "$CONTAINER_ID"
25+
wait_for_container "$CONTAINER_ID"
2226

23-
# Sleep for a bit to let all services start.
27+
# Give services time to start
2428
sleep 5
29+
30+
echo "Starting mongocryptd for Client-Side Field Level Encryption..."
31+
32+
# Check if mongocryptd is already running
33+
if pgrep -x "mongocryptd" > /dev/null; then
34+
echo "mongocryptd is already running."
35+
else
36+
# Start mongocryptd locally
37+
mongocryptd --port=27020 --bind_ip=127.0.0.1 --logpath=mongocryptd.log --fork
38+
echo "mongocryptd started on 127.0.0.1:27020"
39+
fi
40+
41+
echo "Atlas Local running on port 27017"
42+
echo "mongocryptd running on port 27020"

0 commit comments

Comments
 (0)