Skip to content

Commit 7ec6289

Browse files
committed
Fix minor bugs
1 parent 10d511f commit 7ec6289

File tree

6 files changed

+25
-12
lines changed

6 files changed

+25
-12
lines changed

tests/ci/cdk/cdk/aws_lc_github_ci_stack.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
GITHUB_PUSH_CI_BRANCH_TARGETS,
2424
GITHUB_REPO_OWNER,
2525
GITHUB_REPO_NAME,
26-
PIPELINE_ACCOUNT,
2726
PRE_PROD_ACCOUNT,
2827
STAGING_GITHUB_REPO_OWNER,
2928
STAGING_GITHUB_REPO_NAME,

tests/ci/cdk/cdk/ssm/windows_docker_build_ssm_document.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mainSteps:
1313
- $ErrorActionPreference = 'Stop'
1414
- $TRIGGER_TYPE = '{{ TriggerType }}'
1515
- "Get-ChildItem Env: | Sort-Object Name"
16-
- rm -Recurse -Force docker-images
16+
- if (Test-Path "docker-images") { Remove-Item -Recurse -Force "docker-images" }
1717
- mkdir docker-images
1818
- cd docker-images
1919
- Set-ExecutionPolicy Bypass -Scope Process -Force; [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; $env:chocolateyUseWindowsCompression = 'true'; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | Out-Null

tests/ci/cdk/pipeline/pipeline_stack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,12 @@ def deploy_to_environment(
268268

269269
docker_build_wave.add_post(
270270
CodeBuildStep(
271-
f"{deploy_environment_type.value}-CompleteDockerBuild",
271+
f"{deploy_environment_type.value}-FinalizeImages",
272272
input=source,
273273
commands=[
274274
"cd tests/ci/cdk/pipeline/scripts",
275275
"chmod +x finalize_images.sh",
276-
# "./finalize_images.sh --repos \"${ECR_REPOS}\"",
276+
"./finalize_images.sh --repos \"${ECR_REPOS}\"",
277277
],
278278
env={
279279
**codebuild_environment_variables,

tests/ci/cdk/pipeline/scripts/build_target.sh

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,19 @@ function build_codebuild_ci_project() {
3737
start_codebuild_project "${project}" "${source_version}"
3838

3939
while [[ ${attempt} -le ${MAX_RETRY} ]]; do
40+
if [[ $attempt -gt 0 ]]; then
41+
echo "Retrying ${attempt}/${MAX_RETRY}..."
42+
fi
43+
4044
attempt=$((attempt + 1))
4145

4246
echo "Waiting for CI tests for complete. This may take anywhere from 15 minutes to 1 hour"
4347
if ! codebuild_build_status_check "${TIMEOUT}"; then
44-
echo "Tests failed, retrying ${attempt}/${MAX_RETRY}..."
48+
echo "Tests failed."
4549
if [[ ${attempt} -le ${MAX_RETRY} ]]; then
4650
retry_batch_build
4751
else
48-
echo "CI tests failed"
52+
echo "CI tests failed."
4953
exit 1
5054
fi
5155
fi
@@ -61,12 +65,16 @@ function build_linux_docker_images() {
6165
start_codebuild_project aws-lc-docker-image-build-linux "${COMMIT_HASH}"
6266

6367
while [[ ${attempt} -le ${MAX_RETRY} ]]; do
68+
if [[ $attempt -gt 0 ]]; then
69+
echo "Retrying ${attempt}/${MAX_RETRY}..."
70+
fi
71+
6472
attempt=$((attempt + 1))
6573

6674
echo "Waiting for docker images creation. Building the docker images need to take 1 hour."
6775
# TODO(CryptoAlg-624): These image build may fail due to the Docker Hub pull limits made on 2020-11-01.
6876
if ! codebuild_build_status_check "${TIMEOUT}"; then
69-
echo "Build failed, retrying ${attempt}/${MAX_RETRY}..."
77+
echo "Build failed."
7078
if [[ ${attempt} -le ${MAX_RETRY} ]]; then
7179
retry_batch_build
7280
else
@@ -83,17 +91,22 @@ function build_win_docker_images() {
8391
local attempt=0
8492

8593
while [[ ${attempt} -le ${MAX_RETRY} ]]; do
94+
if [[ $attempt -gt 0 ]]; then
95+
echo "Retrying ${attempt}/${MAX_RETRY}..."
96+
fi
97+
8698
attempt=$((attempt + 1))
99+
87100
echo "Executing AWS SSM commands to build Windows docker images."
88101
if ! start_windows_img_build; then
89-
echo "Failed to start build, retrying ${attempt}/${MAX_RETRY}..."
102+
echo "Failed to start build"
90103
continue
91104
fi
92105

93106
echo "Waiting for docker images creation. Building the docker images need to take 1 hour."
94107
# TODO(CryptoAlg-624): These image build may fail due to the Docker Hub pull limits made on 2020-11-01.
95108
if ! win_docker_img_build_status_check "${TIMEOUT}"; then
96-
echo "Build failed, retrying ${attempt}/${MAX_RETRY}..."
109+
echo "Build failed"
97110
continue
98111
fi
99112

tests/ci/cdk/pipeline/scripts/check_trigger_conditions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -exuo pipefail
66

77
source util.sh
88

9-
NEED_REBUILD=${NEED_REBUILD:-1}
9+
NEED_REBUILD=${NEED_REBUILD:-0}
1010
COMMIT_HASH=${COMMIT_HASH:-$CODEBUILD_RESOLVED_SOURCE_VERSION}
1111

1212
LINUX_DOCKER_PATH="tests/ci/docker_images/(dependencies|linux)"

tests/ci/cdk/run-cdk.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ For aws-lc continuous integration setup, this script uses aws cli to build some
296296
297297
Options:
298298
--help Displays this help
299-
--aws-account AWS account for CDK deploy/destroy. Default to '620771051181'.
300-
--aws-region AWS region for AWS resources creation. Default to 'us-west-2'.
299+
--deploy-account AWS account for CDK deploy/destroy. Default to '620771051181'.
300+
--deploy-region AWS region for AWS resources creation. Default to 'us-west-2'.
301301
--github-repo-owner GitHub repository owner. Default to 'aws'.
302302
--github-source-version GitHub source version. Default to 'main'.
303303
--action Required. The value can be
@@ -313,6 +313,7 @@ Options:
313313
'synth': synthesizes and prints the CloudFormation template for the stacks.
314314
'bootstrap': Bootstraps the CDK stack. This is needed before deployment or updating the CI.
315315
'invoke': invoke a custom command. Provide the custom command through '--command <YOUR_CUSTOM_COMMAND>'
316+
--command Custom command to invoke. Required for '--action invoke'.
316317
EOF
317318
}
318319

0 commit comments

Comments
 (0)