Skip to content

Commit

Permalink
Use artifactory mirror as docker registry
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen committed Nov 13, 2024
1 parent 117c32f commit 86912b8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
16 changes: 16 additions & 0 deletions .evergreen/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -600,11 +600,17 @@ functions:
COMPASS_E2E_TEST_GROUPS: ${e2e_test_groups}
COMPASS_E2E_TEST_GROUP: ${e2e_test_group}
ATLAS_LOCAL_VERSION: latest
ARTIFACTORY_USERNAME: ${artifactory_username}
ARTIFACTORY_PASSWORD: ${artifactory_password}
DOCKER_REGISTRY: artifactory.corp.mongodb.com
script: |
set -e
# Load environment variables
eval $(.evergreen/print-compass-env.sh)
# Authenticate with the Artifactory docker registry
docker login "${DOCKER_REGISTRY}" -u "${ARTIFACTORY_USER}" -p "${ARTIFACTORY_PASSWORD}"
# Start atlas local to test Atlas Search
source .evergreen/start-atlas-local.sh
Expand Down Expand Up @@ -690,14 +696,24 @@ functions:
MCLI_ORG_ID: ${e2e_tests_mcli_org_id}
MCLI_PROJECT_ID: ${e2e_tests_mcli_project_id}
MCLI_OPS_MANAGER_URL: ${e2e_tests_mcli_ops_manager_url}
ARTIFACTORY_USERNAME: ${artifactory_username}
ARTIFACTORY_PASSWORD: ${artifactory_password}
DOCKER_REGISTRY: artifactory.corp.mongodb.com
script: |
set -e
# Load environment variables
eval $(.evergreen/print-compass-env.sh)
# Authenticate with the Artifactory docker registry
docker login "${DOCKER_REGISTRY}" -u "${ARTIFACTORY_USER}" -p "${ARTIFACTORY_PASSWORD}"
# Create Atlas cluster for test project
source .evergreen/start-atlas-cloud-cluster.sh
# Run the tests
echo "Starting e2e tests..."
# We're only running a special subset of tests as provisioning atlas
# clusters in CI is both pricey and flakey, so we want to limit the
# coverage to reduce those factors (at least for now)
Expand Down
4 changes: 3 additions & 1 deletion .evergreen/start-atlas-cloud-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ ATLAS_CLUSTER_NAME="${_ATLAS_CLOUD_TEST_CLUSTER_NAME:-$DEFAULT_ATLAS_CLOUD_TEST_
ATLAS_TEST_DB_USERNAME="testuser-$RUN_ID"
ATLAS_TEST_DB_PASSWORD="$(head -c 32 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9')"

DOCKER_REGISTRY="${DOCKER_REGISTRY-registry.hub.docker.com}"

function atlascli() {
docker run \
-e MCLI_PUBLIC_API_KEY \
-e MCLI_PRIVATE_API_KEY \
-e MCLI_ORG_ID \
-e MCLI_PROJECT_ID \
-e MCLI_OPS_MANAGER_URL \
mongodb/atlas atlas $@
$DOCKER_REGISTRY/library/mongodb/atlas atlas $@
}

cleanup() {
Expand Down
7 changes: 4 additions & 3 deletions .evergreen/start-atlas-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ cleanup() {
trap cleanup EXIT

# Image name with version
IMAGE_NAME="mongodb/mongodb-atlas-local:$ATLAS_LOCAL_VERSION"
echo docker run --rm --name $CONTAINER_NAME -d -e DO_NOT_TRACK=1 -P "$IMAGE_NAME"
DOCKER_REGISTRY="${DOCKER_REGISTRY-registry.hub.docker.com}"
DOCKER_IMAGE="$DOCKER_REGISTRY/library/mongodb/mongodb-atlas-local:$ATLAS_LOCAL_VERSION"
echo docker run --rm --name $CONTAINER_NAME -d -e DO_NOT_TRACK=1 -P "$DOCKER_IMAGE"

# Start the Docker container
docker run --rm --name $CONTAINER_NAME -d -e DO_NOT_TRACK=1 -P "$IMAGE_NAME"
docker run --rm --name $CONTAINER_NAME -d -e DO_NOT_TRACK=1 -P "$DOCKER_IMAGE"

echo "Waiting for container to become healthy..."

Expand Down

0 comments on commit 86912b8

Please sign in to comment.