Skip to content

Commit 9ced848

Browse files
committed
CLOUDP-295785 - Release tasks reorg to use new atomic_pipeline
1 parent 1801c66 commit 9ced848

20 files changed

+1043
-1394
lines changed

.evergreen-functions.yml

Lines changed: 101 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,10 @@ 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-
6454
setup_context: &setup_context # Running the first switch is important to fill the workdir and other important initial env vars
6555
command: shell.exec
6656
type: setup
6757
params:
68-
add_to_path:
69-
- ${workdir}/bin
7058
shell: bash
7159
working_dir: src/github.com/mongodb/mongodb-kubernetes
7260
<<: *e2e_include_expansions_in_env
@@ -115,7 +103,6 @@ functions:
115103
type: setup
116104
params:
117105
command: "git config --global user.email '[email protected]'"
118-
- *setup_jq # we need jq in the context
119106
- *setup_context
120107

121108
setup_kubectl: &setup_kubectl
@@ -125,6 +112,13 @@ functions:
125112
working_dir: src/github.com/mongodb/mongodb-kubernetes
126113
binary: scripts/evergreen/setup_kubectl.sh
127114

115+
setup_jq: &setup_jq
116+
command: subprocess.exec
117+
type: setup
118+
params:
119+
working_dir: src/github.com/mongodb/mongodb-kubernetes
120+
binary: scripts/evergreen/setup_jq.sh
121+
128122
setup_shellcheck:
129123
command: subprocess.exec
130124
type: setup
@@ -231,7 +225,7 @@ functions:
231225
working_dir: src/github.com/mongodb/mongodb-kubernetes
232226
add_to_path:
233227
- ${workdir}/bin
234-
binary: scripts/dev/configure_container_auth.sh
228+
binary: scripts/dev/configure_docker_auth.sh
235229

236230
setup_evg_host: &setup_evg_host
237231
command: subprocess.exec
@@ -262,35 +256,16 @@ functions:
262256
# Configures docker authentication to ECR and RH registries.
263257
setup_building_host:
264258
- *switch_context
265-
- *python_venv
266259
- *setup_aws
267-
- *setup_evg_host
268260
- *configure_docker_auth
269-
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
274-
- command: subprocess.exec
275-
type: setup
276-
params:
277-
working_dir: src/github.com/mongodb/mongodb-kubernetes
278-
add_to_path:
279-
- ${workdir}/bin
280-
command: scripts/evergreen/setup_minikube_host.sh
261+
- *setup_evg_host
262+
- *python_venv
281263

282264
prune_docker_resources:
283-
- command: shell.exec
265+
- command: subprocess.exec
284266
type: setup
285267
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
268+
command: "docker system prune -a -f"
294269

295270
# the task configures the set of tools necessary for any task working with K8 cluster:
296271
# installs kubectl, jq, kind (if necessary), configures docker authentication
@@ -352,19 +327,20 @@ functions:
352327
shell: bash
353328
working_dir: src/github.com/mongodb/mongodb-kubernetes
354329
script: |
355-
scripts/dev/run_python.sh scripts/evergreen/e2e/setup_cloud_qa.py create
330+
source .generated/context.export.env
331+
scripts/evergreen/e2e/setup_cloud_qa.py create
356332
# The additional switch is needed, since we now have created the needed OM exports.
357333
- *switch_context
358334

359335
teardown_cloud_qa:
360336
- command: shell.exec
361337
type: setup
362338
params:
363-
continue_on_err: true
364339
shell: bash
365340
working_dir: src/github.com/mongodb/mongodb-kubernetes
366341
script: |
367-
scripts/dev/run_python.sh scripts/evergreen/e2e/setup_cloud_qa.py delete
342+
source .generated/context.export.env
343+
scripts/evergreen/e2e/setup_cloud_qa.py delete
368344
369345
dump_diagnostic_information_from_all_namespaces:
370346
- command: subprocess.exec
@@ -444,7 +420,6 @@ functions:
444420
upload_e2e_logs:
445421
- command: s3.put
446422
params:
447-
continue_on_err: true
448423
aws_key: ${enterprise_aws_access_key_id}
449424
aws_secret: ${enterprise_aws_secret_access_key}
450425
local_files_include_filter:
@@ -456,7 +431,6 @@ functions:
456431
content_type: text/plain
457432
- command: attach.xunit_results
458433
params:
459-
continue_on_err: true
460434
file: "src/github.com/mongodb/mongodb-kubernetes/logs/myreport.xml"
461435

462436
upload_e2e_logs_gotest:
@@ -530,39 +504,47 @@ functions:
530504
- ${workdir}/bin
531505
- ${workdir}
532506

533-
build_test_image_ibm:
507+
pipeline:
534508
- *switch_context
535-
- command: subprocess.exec
509+
- command: shell.exec
510+
type: setup
536511
params:
537512
shell: bash
538-
working_dir: src/github.com/mongodb/mongodb-kubernetes
539-
include_expansions_in_env:
540-
- version_id
541-
add_to_path:
542-
- ${workdir}/bin
543-
binary: scripts/evergreen/e2e/build_tests_image_ibm.sh
544-
545-
pipeline_migrate_agents:
546-
- *switch_context
513+
script: |
514+
# Docker Hub workaround
515+
# docker buildx needs the moby/buildkit image when setting up a builder so we pull it from our mirror
516+
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
517+
docker buildx inspect --bootstrap
547518
- command: subprocess.exec
548-
retry_on_failure: false
519+
retry_on_failure: true
549520
type: setup
550521
params:
551522
shell: bash
552523
<<: *e2e_include_expansions_in_env
553524
working_dir: src/github.com/mongodb/mongodb-kubernetes
554-
binary: scripts/release/pipeline_migrate_agent.sh
525+
binary: scripts/dev/run_python.sh scripts/release/pipeline_main.py --parallel ${image_name}
555526

556-
pipeline:
527+
release_pipeline:
557528
- *switch_context
529+
- command: shell.exec
530+
type: setup
531+
params:
532+
shell: bash
533+
script: |
534+
# Docker Hub workaround
535+
# docker buildx needs the moby/buildkit image when setting up a builder so we pull it from our mirror
536+
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
537+
docker buildx inspect --bootstrap
558538
- command: subprocess.exec
559539
retry_on_failure: true
560540
type: setup
561541
params:
562542
shell: bash
563543
<<: *e2e_include_expansions_in_env
564544
working_dir: src/github.com/mongodb/mongodb-kubernetes
565-
binary: scripts/dev/run_python.sh scripts/release/pipeline_main.py --parallel ${image_name} ${all_agents} ${build_scenario}
545+
env:
546+
git_tag: ${triggered_by_git_tag}
547+
binary: scripts/dev/run_python.sh scripts/release/pipeline_main.py ${image_name} --build-scenario release --version ${git_tag}
566548

567549
# TODO: CLOUDP-335471 ; once all image builds are made with the new atomic pipeline, remove the following function
568550
legacy_pipeline:
@@ -845,3 +827,65 @@ functions:
845827
- task_name
846828
script: |
847829
./scripts/code_snippets/${task_name}_test.sh
830+
831+
#
832+
# kubectl mongodb plugin release functions
833+
#
834+
install_goreleaser:
835+
- command: shell.exec
836+
type: setup
837+
include_expansions_in_env:
838+
- goreleaser_pro_tar_gz
839+
params:
840+
script: |
841+
set -Eeu pipefail
842+
curl -fL "${goreleaser_pro_tar_gz}" --output goreleaser_Linux_x86_64.tar.gz
843+
tar -xf goreleaser_Linux_x86_64.tar.gz
844+
chmod 755 ./goreleaser
845+
846+
install_macos_notarization_service:
847+
- command: shell.exec
848+
type: setup
849+
params:
850+
include_expansions_in_env:
851+
- notary_service_url
852+
script: |
853+
set -Eeu pipefail
854+
855+
curl "${notary_service_url}" --output macos-notary.zip
856+
unzip -u macos-notary.zip
857+
chmod 755 ./linux_amd64/macnotary
858+
859+
release_kubectl_mongodb_plugin:
860+
- command: github.generate_token
861+
params:
862+
expansion_name: generated_token
863+
- command: shell.exec
864+
type: setup
865+
params:
866+
working_dir: src/github.com/mongodb/mongodb-kubernetes
867+
include_expansions_in_env:
868+
- GRS_USERNAME
869+
- GRS_PASSWORD
870+
- PKCS11_URI
871+
- ARTIFACTORY_URL
872+
- ARTIFACTORY_PASSWORD
873+
- SIGNING_IMAGE_URI
874+
- macos_notary_keyid
875+
- macos_notary_secret
876+
- workdir
877+
- triggered_by_git_tag
878+
env:
879+
XDG_CONFIG_HOME: ${go_base_path}${workdir}
880+
GO111MODULE: "on"
881+
GOROOT: "/opt/golang/go1.24"
882+
MACOS_NOTARY_KEY: ${macos_notary_keyid}
883+
MACOS_NOTARY_SECRET: ${macos_notary_secret}
884+
GORELEASER_CURRENT_TAG: ${triggered_by_git_tag}
885+
# shell.exec EVG Task doesn't have add_to_path, so we need to explicitly add the path export below.
886+
script: |
887+
set -Eeu pipefail
888+
889+
export PATH=$GOROOT/bin:$PATH
890+
export GITHUB_TOKEN=${generated_token}
891+
${workdir}/goreleaser release --clean

.evergreen-kubectlplugin.yml

Lines changed: 0 additions & 99 deletions
This file was deleted.

0 commit comments

Comments
 (0)