Skip to content

Commit cc0afab

Browse files
authoredAug 26, 2024··
CLOUDP-269871 Allow image build to be triggered on demand (#3212)
1 parent 5b52959 commit cc0afab

File tree

3 files changed

+263
-348
lines changed

3 files changed

+263
-348
lines changed
 

‎build/ci/evergreen.yml

+263-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ command_type: system
1818
pre_error_fails_task: true
1919
include:
2020
- filename: build/ci/release.yml
21-
- filename: build/ci/evergreen_common.yml
2221

2322
variables:
2423
- &go_linux_version
@@ -50,6 +49,165 @@ post:
5049
- command: attach.xunit_results
5150
params:
5251
files: ["src/github.com/mongodb/mongodb-atlas-cli/*.xml"]
52+
functions:
53+
"clone":
54+
- command: git.get_project
55+
type: setup
56+
params:
57+
directory: src/github.com/mongodb/mongodb-atlas-cli
58+
"build":
59+
- command: subprocess.exec
60+
type: test
61+
params:
62+
<<: *go_options
63+
command: make build
64+
"install mongodb database tools":
65+
- command: shell.exec
66+
type: setup
67+
params:
68+
<<: *go_options
69+
working_dir: src/github.com/mongodb/mongodb-atlas-cli/bin
70+
shell: bash
71+
env:
72+
<<: *go_env
73+
MONGODB_DATABASE_TOOLS_VERSION: 100.10.0
74+
script: |
75+
set -Eeou pipefail
76+
if [[ "$(uname -s)" == "Darwin"* ]]; then
77+
curl -sLo mongodb-database-tools.zip "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-macos-arm64-$MONGODB_DATABASE_TOOLS_VERSION.zip"
78+
unzip mongodb-database-tools.zip
79+
mv mongodb-database-tools-*/bin/* .
80+
rm -rf mongodb-database-tools-* mongodb-database-tools.zip
81+
else
82+
mkdir -p mongodb-database-tools
83+
curl -sfL "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-rhel70-x86_64-$MONGODB_DATABASE_TOOLS_VERSION.tgz" | tar zx -C mongodb-database-tools --strip-components 1
84+
mv mongodb-database-tools/bin/* .
85+
rm -rf mongodb-database-tools
86+
fi
87+
"e2e test":
88+
- command: subprocess.exec
89+
type: test
90+
params:
91+
<<: *go_options
92+
include_expansions_in_env:
93+
- go_base_path
94+
- workdir
95+
- MCLI_ORG_ID
96+
- MCLI_PROJECT_ID
97+
- MCLI_PRIVATE_API_KEY
98+
- MCLI_PUBLIC_API_KEY
99+
- MCLI_SERVICE
100+
- TEST_CMD
101+
- E2E_TAGS
102+
- E2E_TEST_BUCKET
103+
- E2E_CLOUD_ROLE_ID
104+
- MCLI_OPS_MANAGER_URL
105+
- OM_VERSION
106+
- LOCAL_KEY
107+
- KMIP_CA
108+
- KMIP_CERT
109+
- GCP_CREDENTIALS
110+
- AWS_ACCESS_KEY
111+
- AWS_SECRET_ACCESS_KEY
112+
- AZURE_TENANT_ID
113+
- AZURE_CLIENT_ID
114+
- AZURE_CLIENT_SECRET
115+
- E2E_TIMEOUT
116+
- E2E_SERVERLESS_INSTANCE_NAME
117+
- E2E_PARALLEL
118+
- IDENTITY_PROVIDER_ID
119+
- revision
120+
env:
121+
<<: *go_env
122+
MCLI_SKIP_UPDATE_CHECK: "yes"
123+
TEST_CMD: gotestsum --junitfile e2e-tests.xml --format standard-verbose --
124+
command: make e2e-test
125+
"install gotestsum":
126+
- command: shell.exec
127+
type: setup
128+
params:
129+
<<: *go_options
130+
working_dir: src/github.com/mongodb/mongodb-atlas-cli/bin
131+
shell: bash
132+
script: |
133+
set -Eeou pipefail
134+
export PATH="$ADD_PATH:$PATH"
135+
if [[ "$(uname -s)" == "Darwin"* ]]; then
136+
URL=https://github.com/gotestyourself/gotestsum/releases/download/v${gotestsum_ver}/gotestsum_${gotestsum_ver}_darwin_arm64.tar.gz
137+
else
138+
URL=https://github.com/gotestyourself/gotestsum/releases/download/v${gotestsum_ver}/gotestsum_${gotestsum_ver}_linux_amd64.tar.gz
139+
fi
140+
curl -sfL $URL | tar zx
141+
"generate evergreen":
142+
- command: subprocess.exec
143+
type: test
144+
params:
145+
<<: *go_options
146+
include_expansions_in_env:
147+
- go_base_path
148+
- workdir
149+
- task_type
150+
binary: build/ci/evergreen-generate-tasks.sh
151+
- command: s3.put
152+
params:
153+
aws_key: ${aws_key}
154+
aws_secret: ${aws_secret}
155+
local_files_include_filter:
156+
- src/github.com/mongodb/mongodb-atlas-cli/tasks.json
157+
remote_file: ${project}/dist/${revision}_${created_at}/atlascli/${task_type}/
158+
bucket: mongodb-mongocli-build
159+
permissions: public-read
160+
content_type: ${content_type|application/json}
161+
display_name: internal-bucket
162+
- command: generate.tasks
163+
params:
164+
files:
165+
- tasks.json
166+
"increase inotify limits":
167+
- command: shell.exec
168+
params:
169+
shell: bash
170+
script: |
171+
set -e
172+
if [[ "$(uname -s)" == "Darwin"* ]]; then
173+
echo "No need to increase inotify limits on macOS"
174+
else
175+
cat /proc/sys/fs/inotify/max_user_watches
176+
cat /proc/sys/fs/inotify/max_user_instances
177+
echo 1024 | sudo tee /proc/sys/fs/inotify/max_user_instances
178+
cat /proc/sys/fs/inotify/max_user_instances
179+
fi
180+
"install packer":
181+
- command: shell.exec
182+
params:
183+
<<: *go_options
184+
working_dir: src/github.com/mongodb/mongodb-atlas-cli/bin
185+
env:
186+
<<: *go_env
187+
PACKER_VERSION: 1.11.2
188+
shell: bash
189+
script: |
190+
set -Eeou pipefail
191+
curl -sLo packer.zip https://releases.hashicorp.com/packer/$PACKER_VERSION/packer_$(echo $PACKER_VERSION)_linux_amd64.zip
192+
unzip packer.zip
193+
rm packer.zip LICENSE.txt
194+
packer -v
195+
"run packer":
196+
- command: shell.exec
197+
params:
198+
<<: *go_options
199+
working_dir: src/github.com/mongodb/mongodb-atlas-cli/build/ci/packer
200+
env:
201+
<<: *go_env
202+
AZURE_APP_ID: ${azure_app_id}
203+
AZURE_DISPLAY_NAME: ${azure_display_name}
204+
AZURE_PASSWORD: ${azure_password}
205+
AZURE_TENANT: ${azure_tenant}
206+
AZURE_SUBSCRIPTION_ID: ${azure_subscription_id}
207+
shell: bash
208+
script: |
209+
packer init ${file}
210+
packer build -force ${file}
53211
tasks:
54212
- name: compile
55213
tags: ["code_health"]
@@ -1086,6 +1244,77 @@ tasks:
10861244
MCLI_SERVICE: cloud
10871245
E2E_TAGS: atlas,deployments,atlasclusters
10881246
E2E_TIMEOUT: 3h
1247+
- name: atlas_deployments_local_noauth_e2e
1248+
tags: ["e2e","deployments","local","noauth"]
1249+
must_have_test_results: true
1250+
exec_timeout_secs: 11400 # 3 hours 10 minutes
1251+
commands:
1252+
- func: "install gotestsum"
1253+
- func: "install mongodb database tools"
1254+
- func: "increase inotify limits"
1255+
- func: "e2e test"
1256+
timeout_secs: 11400 # 3 hours 10 minutes
1257+
vars:
1258+
MCLI_ORG_ID: ${atlas_org_id}
1259+
MCLI_PROJECT_ID: ${atlas_project_id}
1260+
MCLI_PRIVATE_API_KEY: ${atlas_private_api_key}
1261+
MCLI_PUBLIC_API_KEY: ${atlas_public_api_key}
1262+
MCLI_OPS_MANAGER_URL: ${mcli_ops_manager_url}
1263+
MCLI_SERVICE: cloud
1264+
E2E_TAGS: atlas,deployments,local,noauth
1265+
E2E_TIMEOUT: 3h
1266+
- name: atlas_deployments_local_nocli_e2e
1267+
tags: ["e2e","deployments","local","nocli"]
1268+
must_have_test_results: true
1269+
exec_timeout_secs: 11400 # 3 hours 10 minutes
1270+
commands:
1271+
- func: "install gotestsum"
1272+
- func: "install mongodb database tools"
1273+
- func: "increase inotify limits"
1274+
- func: "e2e test"
1275+
timeout_secs: 11400 # 3 hours 10 minutes
1276+
vars:
1277+
MCLI_ORG_ID: ${atlas_org_id}
1278+
MCLI_PROJECT_ID: ${atlas_project_id}
1279+
MCLI_PRIVATE_API_KEY: ${atlas_private_api_key}
1280+
MCLI_PUBLIC_API_KEY: ${atlas_public_api_key}
1281+
MCLI_OPS_MANAGER_URL: ${mcli_ops_manager_url}
1282+
MCLI_SERVICE: cloud
1283+
E2E_TAGS: atlas,deployments,local,nocli
1284+
E2E_TIMEOUT: 3h
1285+
- name: atlas_deployments_local_auth_e2e
1286+
tags: ["e2e","deployments","local","auth"]
1287+
must_have_test_results: true
1288+
exec_timeout_secs: 11400 # 3 hours 10 minutes
1289+
commands:
1290+
- func: "install gotestsum"
1291+
- func: "install mongodb database tools"
1292+
- func: "increase inotify limits"
1293+
- func: "e2e test"
1294+
timeout_secs: 11400 # 3 hours 10 minutes
1295+
vars:
1296+
MCLI_ORG_ID: ${atlas_org_id}
1297+
MCLI_PROJECT_ID: ${atlas_project_id}
1298+
MCLI_PRIVATE_API_KEY: ${atlas_private_api_key}
1299+
MCLI_PUBLIC_API_KEY: ${atlas_public_api_key}
1300+
MCLI_OPS_MANAGER_URL: ${mcli_ops_manager_url}
1301+
MCLI_SERVICE: cloud
1302+
E2E_TAGS: atlas,deployments,local,auth
1303+
E2E_TIMEOUT: 3h
1304+
- name: build_win11_image
1305+
tags: ["packer", "windows", "win11"]
1306+
commands:
1307+
- func: "install packer"
1308+
- func: "run packer"
1309+
vars:
1310+
file: "windows-11-azure.pkr.hcl"
1311+
- name: build_win10_image
1312+
tags: ["packer", "windows", "win10"]
1313+
commands:
1314+
- func: "install packer"
1315+
- func: "run packer"
1316+
vars:
1317+
file: "windows-10-azure.pkr.hcl"
10891318
buildvariants:
10901319
- name: code_health
10911320
display_name: "Code Health"
@@ -1236,6 +1465,39 @@ buildvariants:
12361465
<<: *go_linux_version
12371466
tasks:
12381467
- name: ".e2e .atlas .plugin"
1468+
- name: e2e_local_deployments_rhel
1469+
display_name: "E2E Local Deployments Tests (rhel/podman)"
1470+
allowed_requesters: ["patch", "ad_hoc", "github_pr"]
1471+
tags:
1472+
- localdev
1473+
run_on:
1474+
- rhel90-small
1475+
expansions:
1476+
<<: *go_linux_version
1477+
tasks:
1478+
- name: ".e2e .deployments .local"
1479+
- name: e2e_local_deployments_macos
1480+
display_name: "E2E Local Deployments Tests (macos/docker)"
1481+
allowed_requesters: ["patch", "ad_hoc", "github_pr"]
1482+
tags:
1483+
- localdev
1484+
run_on:
1485+
- macos-14-arm64-docker
1486+
expansions:
1487+
<<: *go_linux_version
1488+
tasks:
1489+
- name: ".e2e .deployments .local"
1490+
- name: build_images
1491+
display_name: "Build Windows Images"
1492+
allowed_requesters: ["patch", "ad_hoc", "github_pr"]
1493+
tags:
1494+
- packer
1495+
run_on:
1496+
- rhel80-small
1497+
expansions:
1498+
<<: *go_linux_version
1499+
tasks:
1500+
- name: ".packer .windows"
12391501
patch_aliases:
12401502
- alias: "localdev"
12411503
variant_tags: ["localdev"]

‎build/ci/evergreen_common.yml

-221
This file was deleted.

‎build/ci/periodic_build.yml

-126
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.