Skip to content

Commit 1f997c8

Browse files
committed
Fixes + remove old pipeline and sonar
1 parent 9ced848 commit 1f997c8

Some content is hidden

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

51 files changed

+480
-5692
lines changed

.evergreen-functions.yml

Lines changed: 61 additions & 67 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
@@ -103,6 +115,7 @@ functions:
103115
type: setup
104116
params:
105117
command: "git config --global user.email '[email protected]'"
118+
- *setup_jq # we need jq in the context
106119
- *setup_context
107120

108121
setup_kubectl: &setup_kubectl
@@ -112,13 +125,6 @@ functions:
112125
working_dir: src/github.com/mongodb/mongodb-kubernetes
113126
binary: scripts/evergreen/setup_kubectl.sh
114127

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-
122128
setup_shellcheck:
123129
command: subprocess.exec
124130
type: setup
@@ -225,7 +231,7 @@ functions:
225231
working_dir: src/github.com/mongodb/mongodb-kubernetes
226232
add_to_path:
227233
- ${workdir}/bin
228-
binary: scripts/dev/configure_docker_auth.sh
234+
binary: scripts/dev/configure_container_auth.sh
229235

230236
setup_evg_host: &setup_evg_host
231237
command: subprocess.exec
@@ -256,16 +262,35 @@ functions:
256262
# Configures docker authentication to ECR and RH registries.
257263
setup_building_host:
258264
- *switch_context
265+
- *python_venv
259266
- *setup_aws
260-
- *configure_docker_auth
261267
- *setup_evg_host
262-
- *python_venv
268+
- *configure_docker_auth
263269

264-
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
265274
- command: subprocess.exec
266275
type: setup
267276
params:
268-
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
269294
270295
# the task configures the set of tools necessary for any task working with K8 cluster:
271296
# installs kubectl, jq, kind (if necessary), configures docker authentication
@@ -327,20 +352,19 @@ functions:
327352
shell: bash
328353
working_dir: src/github.com/mongodb/mongodb-kubernetes
329354
script: |
330-
source .generated/context.export.env
331-
scripts/evergreen/e2e/setup_cloud_qa.py create
355+
scripts/dev/run_python.sh scripts/evergreen/e2e/setup_cloud_qa.py create
332356
# The additional switch is needed, since we now have created the needed OM exports.
333357
- *switch_context
334358

335359
teardown_cloud_qa:
336360
- command: shell.exec
337361
type: setup
338362
params:
363+
continue_on_err: true
339364
shell: bash
340365
working_dir: src/github.com/mongodb/mongodb-kubernetes
341366
script: |
342-
source .generated/context.export.env
343-
scripts/evergreen/e2e/setup_cloud_qa.py delete
367+
scripts/dev/run_python.sh scripts/evergreen/e2e/setup_cloud_qa.py delete
344368
345369
dump_diagnostic_information_from_all_namespaces:
346370
- command: subprocess.exec
@@ -420,6 +444,7 @@ functions:
420444
upload_e2e_logs:
421445
- command: s3.put
422446
params:
447+
continue_on_err: true
423448
aws_key: ${enterprise_aws_access_key_id}
424449
aws_secret: ${enterprise_aws_secret_access_key}
425450
local_files_include_filter:
@@ -431,6 +456,7 @@ functions:
431456
content_type: text/plain
432457
- command: attach.xunit_results
433458
params:
459+
continue_on_err: true
434460
file: "src/github.com/mongodb/mongodb-kubernetes/logs/myreport.xml"
435461

436462
upload_e2e_logs_gotest:
@@ -504,84 +530,52 @@ functions:
504530
- ${workdir}/bin
505531
- ${workdir}
506532

507-
pipeline:
533+
build_test_image_ibm:
508534
- *switch_context
509-
- command: shell.exec
510-
type: setup
535+
- command: subprocess.exec
511536
params:
512537
shell: bash
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
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
518547
- command: subprocess.exec
519-
retry_on_failure: true
548+
retry_on_failure: false
520549
type: setup
521550
params:
522551
shell: bash
523552
<<: *e2e_include_expansions_in_env
524553
working_dir: src/github.com/mongodb/mongodb-kubernetes
525-
binary: scripts/dev/run_python.sh scripts/release/pipeline_main.py --parallel ${image_name}
554+
binary: scripts/release/pipeline_migrate_agent.sh
526555

527-
release_pipeline:
556+
pipeline:
528557
- *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
538558
- command: subprocess.exec
539559
retry_on_failure: true
540560
type: setup
541561
params:
542562
shell: bash
543563
<<: *e2e_include_expansions_in_env
544564
working_dir: src/github.com/mongodb/mongodb-kubernetes
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}
565+
binary: scripts/dev/run_python.sh scripts/release/pipeline_main.py --parallel ${image_name} ${all_agents} ${build_scenario}
548566

549-
# TODO: CLOUDP-335471 ; once all image builds are made with the new atomic pipeline, remove the following function
550-
legacy_pipeline:
567+
release_pipeline:
551568
- *switch_context
552-
- command: shell.exec
553-
type: setup
554-
params:
555-
shell: bash
556-
script: |
557-
# Docker Hub workaround
558-
# docker buildx needs the moby/buildkit image when setting up a builder so we pull it from our mirror
559-
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
560-
docker buildx inspect --bootstrap
561-
- command: ec2.assume_role
562-
display_name: Assume IAM role with permissions to pull Kondukto API token
563-
params:
564-
role_arn: ${kondukto_role_arn}
565-
- command: shell.exec
566-
display_name: Pull Kondukto API token from AWS Secrets Manager and write it to file
567-
params:
568-
silent: true
569-
shell: bash
570-
include_expansions_in_env: [AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN]
571-
script: |
572-
set -e
573-
# use AWS CLI to get the Kondukto API token from AWS Secrets Manager
574-
kondukto_token=$(aws secretsmanager get-secret-value --secret-id "kondukto-token" --region "us-east-1" --query 'SecretString' --output text)
575-
# write the KONDUKTO_TOKEN environment variable to Silkbomb environment file
576-
echo "KONDUKTO_TOKEN=$kondukto_token" > ${workdir}/silkbomb.env
577569
- command: subprocess.exec
578570
retry_on_failure: true
579571
type: setup
580572
params:
581573
shell: bash
582574
<<: *e2e_include_expansions_in_env
583575
working_dir: src/github.com/mongodb/mongodb-kubernetes
584-
binary: scripts/dev/run_python.sh pipeline.py --include ${image_name} --parallel --sign
576+
env:
577+
git_tag: ${triggered_by_git_tag}
578+
binary: scripts/dev/run_python.sh scripts/release/pipeline_main.py ${image_name} --build-scenario release --version ${git_tag}
585579

586580
teardown_cloud_qa_all:
587581
- *switch_context

PIPELINE.md

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

0 commit comments

Comments
 (0)