Skip to content

Commit 7157efe

Browse files
committed
Merge branch 'master' into migrate-agents
# Conflicts: # .evergreen-functions.yml
2 parents e741d57 + 1e90170 commit 7157efe

File tree

75 files changed

+2443
-604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2443
-604
lines changed

.evergreen-functions.yml

Lines changed: 65 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,22 @@ functions:
5151

5252
### Setup Functions ###
5353

54+
setup_jq: &setup_jq
55+
command: subprocess.exec
56+
type: setup
57+
params:
58+
<<: *e2e_include_expansions_in_env
59+
add_to_path:
60+
- ${workdir}/bin
61+
working_dir: src/github.com/mongodb/mongodb-kubernetes
62+
binary: scripts/evergreen/setup_jq.sh
63+
5464
setup_context: &setup_context # Running the first switch is important to fill the workdir and other important initial env vars
5565
command: shell.exec
5666
type: setup
5767
params:
68+
add_to_path:
69+
- ${workdir}/bin
5870
shell: bash
5971
working_dir: src/github.com/mongodb/mongodb-kubernetes
6072
<<: *e2e_include_expansions_in_env
@@ -86,17 +98,6 @@ functions:
8698
working_dir: src/github.com/mongodb/mongodb-kubernetes
8799
command: scripts/dev/recreate_python_venv.sh
88100

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-
100101
"clone":
101102
- command: subprocess.exec
102103
type: setup
@@ -114,6 +115,7 @@ functions:
114115
type: setup
115116
params:
116117
command: "git config --global user.email '[email protected]'"
118+
- *setup_jq # we need jq in the context
117119
- *setup_context
118120

119121
setup_kubectl: &setup_kubectl
@@ -123,13 +125,6 @@ functions:
123125
working_dir: src/github.com/mongodb/mongodb-kubernetes
124126
binary: scripts/evergreen/setup_kubectl.sh
125127

126-
setup_jq: &setup_jq
127-
command: subprocess.exec
128-
type: setup
129-
params:
130-
working_dir: src/github.com/mongodb/mongodb-kubernetes
131-
binary: scripts/evergreen/setup_jq.sh
132-
133128
setup_shellcheck:
134129
command: subprocess.exec
135130
type: setup
@@ -236,7 +231,7 @@ functions:
236231
working_dir: src/github.com/mongodb/mongodb-kubernetes
237232
add_to_path:
238233
- ${workdir}/bin
239-
binary: scripts/dev/configure_docker_auth.sh
234+
binary: scripts/dev/configure_container_auth.sh
240235

241236
setup_evg_host: &setup_evg_host
242237
command: subprocess.exec
@@ -267,16 +262,35 @@ functions:
267262
# Configures docker authentication to ECR and RH registries.
268263
setup_building_host:
269264
- *switch_context
265+
- *python_venv
270266
- *setup_aws
271-
- *configure_docker_auth
272267
- *setup_evg_host
273-
- *python_venv
268+
- *configure_docker_auth
274269

275-
prune_docker_resources:
270+
# This differs for normal evg_host as we require minikube instead of kind for
271+
# IBM machines also install aws cli via pip instead and use podman
272+
setup_building_host_minikube:
273+
- *switch_context
276274
- command: subprocess.exec
277275
type: setup
278276
params:
279-
command: "docker system prune -a -f"
277+
working_dir: src/github.com/mongodb/mongodb-kubernetes
278+
add_to_path:
279+
- ${workdir}/bin
280+
command: scripts/evergreen/setup_minikube_host.sh
281+
282+
prune_docker_resources:
283+
- command: shell.exec
284+
type: setup
285+
params:
286+
shell: bash
287+
script: |
288+
if command -v docker >/dev/null 2>&1; then
289+
echo "Docker found, pruning docker resources..."
290+
docker system prune -a -f
291+
else
292+
echo "Docker not found, skipping docker resource pruning"
293+
fi
280294
281295
# the task configures the set of tools necessary for any task working with K8 cluster:
282296
# installs kubectl, jq, kind (if necessary), configures docker authentication
@@ -338,8 +352,7 @@ functions:
338352
shell: bash
339353
working_dir: src/github.com/mongodb/mongodb-kubernetes
340354
script: |
341-
source .generated/context.export.env
342-
scripts/evergreen/e2e/setup_cloud_qa.py create
355+
scripts/dev/run_python.sh scripts/evergreen/e2e/setup_cloud_qa.py create
343356
# The additional switch is needed, since we now have created the needed OM exports.
344357
- *switch_context
345358

@@ -351,8 +364,7 @@ functions:
351364
shell: bash
352365
working_dir: src/github.com/mongodb/mongodb-kubernetes
353366
script: |
354-
source .generated/context.export.env
355-
scripts/evergreen/e2e/setup_cloud_qa.py delete
367+
scripts/dev/run_python.sh scripts/evergreen/e2e/setup_cloud_qa.py delete
356368
357369
dump_diagnostic_information_from_all_namespaces:
358370
- command: subprocess.exec
@@ -517,21 +529,20 @@ functions:
517529
- ${workdir}/bin
518530
- ${workdir}
519531

520-
pipeline:
532+
build_test_image_ibm:
521533
- *switch_context
522-
- *docker_buildkit
523534
- command: subprocess.exec
524-
retry_on_failure: true
525-
type: setup
526535
params:
527536
shell: bash
528-
<<: *e2e_include_expansions_in_env
529537
working_dir: src/github.com/mongodb/mongodb-kubernetes
530-
binary: scripts/dev/run_python.sh scripts/release/pipeline_main.py --parallel ${image_name} ${all_agents} ${build_scenario}
538+
include_expansions_in_env:
539+
- version_id
540+
add_to_path:
541+
- ${workdir}/bin
542+
binary: scripts/evergreen/e2e/build_tests_image_ibm.sh
531543

532544
pipeline_migrate_agents:
533545
- *switch_context
534-
- *docker_buildkit
535546
- command: subprocess.exec
536547
retry_on_failure: false
537548
type: setup
@@ -541,10 +552,29 @@ functions:
541552
working_dir: src/github.com/mongodb/mongodb-kubernetes
542553
binary: scripts/release/pipeline_migrate_agent.sh
543554

555+
pipeline:
556+
- *switch_context
557+
- command: subprocess.exec
558+
retry_on_failure: true
559+
type: setup
560+
params:
561+
shell: bash
562+
<<: *e2e_include_expansions_in_env
563+
working_dir: src/github.com/mongodb/mongodb-kubernetes
564+
binary: scripts/dev/run_python.sh scripts/release/pipeline_main.py --parallel ${image_name} ${all_agents} ${build_scenario}
565+
544566
# TODO: CLOUDP-335471 ; once all image builds are made with the new atomic pipeline, remove the following function
545567
legacy_pipeline:
546568
- *switch_context
547-
- *docker_buildkit
569+
- command: shell.exec
570+
type: setup
571+
params:
572+
shell: bash
573+
script: |
574+
# Docker Hub workaround
575+
# docker buildx needs the moby/buildkit image when setting up a builder so we pull it from our mirror
576+
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
577+
docker buildx inspect --bootstrap
548578
- command: ec2.assume_role
549579
display_name: Assume IAM role with permissions to pull Kondukto API token
550580
params:

0 commit comments

Comments
 (0)