-
Notifications
You must be signed in to change notification settings - Fork 8
PYTHON-4391: [Bugfix] Use Docker to run LocalAtlas #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
de333b2
use docker now
Jibola d57222a
setup fixes
Jibola 9f4d8ef
use atlas 1.25
Jibola 16b403d
use atlas 1.25
Jibola 53e10e9
renames
Jibola 80f003b
use podman and python to scaffold atlas
Jibola 272dad6
include type
Jibola a9748a4
add privileged
Jibola 122334d
use atlas 1.25 instead of atlas 1.18
Jibola 3250bf2
level the podman local creation script
Jibola 9d48699
log the of the container generally
Jibola f7c3fff
change wait time to 10 minutes
Jibola 1e3906e
add healthcheck run
Jibola 0ea534b
use the locally provisioned podman
Jibola 97ace5b
source the conn_string working dir
Jibola 86bf15a
use echo
Jibola 667874a
cleanup scaffold script
Jibola 2b7d3ac
add the '\' back in semantic-kernel-csharp
Jibola a0c8e84
Delete .evergreen/podman-local-dev.sh
Jibola 7635609
Apply suggestions from code review
Jibola File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
Jibola marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# 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) | ||
|
||
echo "Starting the container" | ||
CONTAINER_ID=$(podman run --rm -d -e DO_NOT_TRACK=1 -P --health-cmd "/usr/local/bin/runner healthcheck" mongodb/mongodb-atlas-local:latest) | ||
|
||
echo "waiting for container to become healthy..." | ||
function wait() { | ||
CONTAINER_ID=$1 | ||
echo "waiting for container to become healthy..." | ||
podman healthcheck run "$CONTAINER_ID" | ||
for _ in $(seq 600); do | ||
STATE=$(podman inspect -f '{{ .State.Health.Status }}' "$CONTAINER_ID") | ||
|
||
case $STATE in | ||
healthy) | ||
echo "container is healthy" | ||
return 0 | ||
;; | ||
unhealthy) | ||
echo "container is unhealthy" | ||
podman logs "$CONTAINER_ID" | ||
stop | ||
exit 1 | ||
;; | ||
*) | ||
echo "Unrecognized state $STATE" | ||
sleep 1 | ||
esac | ||
done | ||
|
||
echo "container did not get healthy within 120 seconds, quitting" | ||
podman logs mongodb_atlas_local | ||
stop | ||
exit 2 | ||
} | ||
|
||
wait "$CONTAINER_ID" | ||
EXPOSED_PORT=$(podman inspect --format='{{ (index (index .NetworkSettings.Ports "27017/tcp") 0).HostPort }}' "$CONTAINER_ID") | ||
|
||
export CONN_STRING="mongodb://127.0.0.1:$EXPOSED_PORT/?directConnection=true" | ||
|
||
echo "CONN_STRING=mongodb://127.0.0.1:$EXPOSED_PORT/?directConnection=true" > .local_atlas_uri | ||
echo "ATLAS_LOCAL_URL set to $CONN_STRING" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need a linter. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I'll make a task for it. PYTHON-4687