Skip to content

Commit e741d57

Browse files
committed
Migrate all agents script
1 parent 355e63d commit e741d57

File tree

4 files changed

+59
-17
lines changed

4 files changed

+59
-17
lines changed

.evergreen-functions.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ functions:
8686
working_dir: src/github.com/mongodb/mongodb-kubernetes
8787
command: scripts/dev/recreate_python_venv.sh
8888

89+
docker_buildkit: &docker_buildkit
90+
command: shell.exec
91+
type: setup
92+
params:
93+
shell: bash
94+
script: |
95+
# Docker Hub workaround
96+
# docker buildx needs the moby/buildkit image when setting up a builder so we pull it from our mirror
97+
docker buildx create --driver=docker-container --driver-opt=image=268558157000.dkr.ecr.eu-west-1.amazonaws.com/docker-hub-mirrors/moby/buildkit:buildx-stable-1 --use
98+
docker buildx inspect --bootstrap
99+
89100
"clone":
90101
- command: subprocess.exec
91102
type: setup
@@ -508,15 +519,7 @@ functions:
508519

509520
pipeline:
510521
- *switch_context
511-
- command: shell.exec
512-
type: setup
513-
params:
514-
shell: bash
515-
script: |
516-
# Docker Hub workaround
517-
# docker buildx needs the moby/buildkit image when setting up a builder so we pull it from our mirror
518-
docker buildx create --driver=docker-container --driver-opt=image=268558157000.dkr.ecr.eu-west-1.amazonaws.com/docker-hub-mirrors/moby/buildkit:buildx-stable-1 --use
519-
docker buildx inspect --bootstrap
522+
- *docker_buildkit
520523
- command: subprocess.exec
521524
retry_on_failure: true
522525
type: setup
@@ -526,18 +529,22 @@ functions:
526529
working_dir: src/github.com/mongodb/mongodb-kubernetes
527530
binary: scripts/dev/run_python.sh scripts/release/pipeline_main.py --parallel ${image_name} ${all_agents} ${build_scenario}
528531

529-
# TODO: CLOUDP-335471 ; once all image builds are made with the new atomic pipeline, remove the following function
530-
legacy_pipeline:
532+
pipeline_migrate_agents:
531533
- *switch_context
532-
- command: shell.exec
534+
- *docker_buildkit
535+
- command: subprocess.exec
536+
retry_on_failure: false
533537
type: setup
534538
params:
535539
shell: bash
536-
script: |
537-
# Docker Hub workaround
538-
# docker buildx needs the moby/buildkit image when setting up a builder so we pull it from our mirror
539-
docker buildx create --driver=docker-container --driver-opt=image=268558157000.dkr.ecr.eu-west-1.amazonaws.com/docker-hub-mirrors/moby/buildkit:buildx-stable-1 --use
540-
docker buildx inspect --bootstrap
540+
<<: *e2e_include_expansions_in_env
541+
working_dir: src/github.com/mongodb/mongodb-kubernetes
542+
binary: scripts/release/pipeline_migrate_agent.sh
543+
544+
# TODO: CLOUDP-335471 ; once all image builds are made with the new atomic pipeline, remove the following function
545+
legacy_pipeline:
546+
- *switch_context
547+
- *docker_buildkit
541548
- command: ec2.assume_role
542549
display_name: Assume IAM role with permissions to pull Kondukto API token
543550
params:

.evergreen.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,15 @@ tasks:
349349
image_name: agent
350350
build_scenario: --build-scenario manual_release
351351

352+
- name: migrate_all_agents
353+
# this enables us to run this variant manually to build all the agents for the new registry
354+
allowed_requesters: [ "patch" ]
355+
# TODO: add quay login back
356+
commands:
357+
- func: clone
358+
- func: setup_building_host
359+
- func: pipeline_migrate_agents
360+
352361
- name: run_precommit_and_push
353362
tags: ["patch-run"]
354363
commands:
@@ -1907,3 +1916,11 @@ buildvariants:
19071916
tasks:
19081917
- name: publish_ops_manager
19091918
- name: release_agent
1919+
1920+
- name: publish_agent_images_manual
1921+
display_name: publish_agent_images_manual
1922+
allowed_requesters: [ "patch" ]
1923+
run_on:
1924+
- ubuntu2204-large
1925+
tasks:
1926+
- name: migrate_all_agents
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
set -Eeou pipefail
4+
5+
script_name=$(readlink -f "${BASH_SOURCE[0]}")
6+
script_dir=$(dirname "${script_name}")
7+
8+
source "${script_dir}/root-context"
9+
10+
export preflight_submit=true
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
set -Eeou pipefail
4+
5+
scripts/dev/run_python.sh scripts/release/pipeline_main.py --parallel agent \
6+
--all-agents \
7+
--build-scenario manual_release \
8+
-r 268558157000.dkr.ecr.us-east-1.amazonaws.com/lucian.tosa/mongodb-agent

0 commit comments

Comments
 (0)