Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-pull aws crt Docker images. #102

Merged
merged 4 commits into from
Mar 8, 2021

Conversation

bryce-shang
Copy link
Contributor

@bryce-shang bryce-shang commented Mar 1, 2021

Issues:

Addresses CryptoAlg-663

Description of changes:

This PR adds scripts to pull aws crt Docker images from docker.pkg.github.com.

Call-outs:

Next PR #103 will integrate the scripts with CI setup code.

Testing:

# Pull images.
GITHUB_READ_PKG_ACCESS_TOKEN=xxx
./pull_github_pkg.sh

# Push images.
ECS_REPO="654358955777.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-x86"
$(aws ecr get-login --no-include-email)
source ./aws-crt/aws-crt-common.sh
push_aws_crt_docker_img

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

source "${parent_dir}/common.sh"

#################################
# Sett up environment variables #
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed. Good catch.


## Docker image push.
To push to the ECR repository of default AWS account, run `push_images.sh`.
To push to the ECR repository pass in a complete ECS url `push_images.sh ${ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com/${REPOSITORY}`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I understand, the handling of CRT images is different from the rest of the images, correct? Can this be briefly described here? CRT is Common Runtime?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This README.md is overview of linux-x86 Docker images build. I added some crt related comments in aws-crt-common.sh.

@bryce-shang bryce-shang requested a review from nebeid March 3, 2021 17:16
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

parent_dir="$(dirname -- "$(realpath -- "$file_name")")"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is file_name not undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed. Move this source to upper dir.

# Test in aws-lc/tests/ci/docker_images/linux-x86
+++ dirname ./pull_github_pkg.sh
++ cd .
++ pwd
+ cur_dir=/home/ubuntu/bryce-shang/aws-lc/tests/ci/docker_images/linux-x86
+ source /home/ubuntu/bryce-shang/aws-lc/tests/ci/docker_images/linux-x86/common.sh
+ source /home/ubuntu/bryce-shang/aws-lc/tests/ci/docker_images/linux-x86/aws-crt/aws-crt-common.sh

# Test in aws-lc
+++ dirname ./tests/ci/docker_images/linux-x86/pull_github_pkg.sh
++ cd ./tests/ci/docker_images/linux-x86
++ pwd
+ cur_dir=/home/ubuntu/bryce-shang/aws-lc/tests/ci/docker_images/linux-x86
+ source /home/ubuntu/bryce-shang/aws-lc/tests/ci/docker_images/linux-x86/common.sh
+ source /home/ubuntu/bryce-shang/aws-lc/tests/ci/docker_images/linux-x86/aws-crt/aws-crt-common.sh

# Pull Docker images used by https://github.com/awslabs/aws-c-cal
# These Docker images are hosted in 'docker.pkg.github.com', which needs GitHub personal access token.
cur_dir="$(cd "$(dirname "$0")" && pwd)"
# shellcheck source=./common.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these shellcheck comments for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/koalaman/shellcheck
For bash scripts, some IDEs use shellcheck, which is a static analysis tool. # shellcheck is used to suppress the tool warning because the tool cannot check the runtime value (cur_dir).

@bryce-shang bryce-shang merged commit 2440771 into aws:aws-c-cal-ci Mar 8, 2021
@bryce-shang bryce-shang deleted the aws-crt-img branch March 8, 2021 18:19
bryce-shang added a commit that referenced this pull request Mar 25, 2021
* Pre-pull aws crt Docker images.

* Remove unused code.

* Run pull_github_pkg.sh in CodeBuild.

* Update files under 'generated-src' dir.

* Pre-pull aws crt Docker images. (#102)

* Pre-pull aws crt Docker images.

* Remove unused code.

* Address comments.

* Move common source.

* Integrate pull script with CDK. (#103)

* Pre-pull aws crt Docker images.

* Remove unused code.

* Run pull_github_pkg.sh in CodeBuild.

* Address comments.

* Move common source.

* Change README.md

* Address comments.

* Build and test without Perl/Go. (#107)

* Build and test without Perl/Go.

* Revert 'delete update-webhook cli'

* Fix typo.

* Adds build flavor -DBUILD_TESTING=0 -DBUILD_SSL=0.

* Adds build flavor -DBUILD_TESTING=0 -DBUILD_SSL=0 with release mode.

* Fix typo.

* Remove 'AWS_LC' prefix.

* Fix build flag.

* Add note.

* Remove build with -DBUILD_TESTING=0 -DBUILD_SSL=0.

* Remove build flags - BUILD_WITHOUT_GO and BUILD_WITHOUT_PERL..
dkostic pushed a commit to dkostic/aws-lc that referenced this pull request Dec 5, 2024
Print running times of proofs, factor out proof runner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants