Skip to content
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

chore(ci): use artifactory mirror as docker registry #6490

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .evergreen/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -600,11 +600,15 @@ functions:
COMPASS_E2E_TEST_GROUPS: ${e2e_test_groups}
COMPASS_E2E_TEST_GROUP: ${e2e_test_group}
ATLAS_LOCAL_VERSION: latest
DOCKER_REGISTRY: artifactory.corp.mongodb.com
script: |
set -e
# Load environment variables
eval $(.evergreen/print-compass-env.sh)

# Authenticate with the Artifactory docker registry
echo "${ARTIFACTORY_PASSWORD}" | docker login "${DOCKER_REGISTRY}" --username "${ARTIFACTORY_USERNAME}" --password-stdin

# Start atlas local to test Atlas Search
source .evergreen/start-atlas-local.sh

Expand Down Expand Up @@ -690,14 +694,22 @@ 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}
DOCKER_REGISTRY: artifactory.corp.mongodb.com
script: |
set -e

# Load environment variables
eval $(.evergreen/print-compass-env.sh)

# Authenticate with the Artifactory docker registry
echo "${ARTIFACTORY_PASSWORD}" | docker login "${DOCKER_REGISTRY}" --username "${ARTIFACTORY_USERNAME}" --password-stdin

# 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 $@
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Random thought – would this be easier or harder to work with if we included /library/ in the env var value, so that the default would just end up being an empty string if nothing has been explicitly configured before?

}

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
Loading