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

Create pre-production stage for CI pipeline #2282

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

nhatnghiho
Copy link
Contributor

@nhatnghiho nhatnghiho commented Mar 20, 2025

Issues:

Resolves #CryptoAlg-2983 and #CryptoAlg-2984

Description of changes:

This PR implements steps to deploy to pre-production in the CI pipeline, which will act as template for production deployment later on. The PR also sets up a dev deployment environment for testing purposes.

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

@codecov-commenter
Copy link

codecov-commenter commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.05%. Comparing base (652f7a9) to head (b93ce94).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2282      +/-   ##
==========================================
+ Coverage   79.02%   79.05%   +0.02%     
==========================================
  Files         614      614              
  Lines      106934   107058     +124     
  Branches    15145    15162      +17     
==========================================
+ Hits        84504    84634     +130     
+ Misses      21777    21771       -6     
  Partials      653      653              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nhatnghiho nhatnghiho force-pushed the ci-pipeline branch 2 times, most recently from 267feb5 to b100ece Compare March 20, 2025 22:30
@nhatnghiho nhatnghiho force-pushed the ci-pipeline branch 3 times, most recently from 3f82970 to edbd376 Compare March 26, 2025 16:37
@nhatnghiho nhatnghiho marked this pull request as ready for review March 26, 2025 16:39
@nhatnghiho nhatnghiho requested a review from a team as a code owner March 26, 2025 16:39
@skmcgrail skmcgrail self-requested a review March 26, 2025 20:34
image: 620771051181.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-x86:ubuntu-20.04_clang-7x-bm-framework_latest
image: 183295444613.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-x86:ubuntu-20.04_clang-7x-bm-framework_latest
Copy link
Member

Choose a reason for hiding this comment

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

Should remain as the team account

image: 620771051181.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-x86:ubuntu-20.04_clang-7x-bm-framework_latest
image: 183295444613.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-x86:ubuntu-20.04_clang-7x-bm-framework_latest
Copy link
Member

Choose a reason for hiding this comment

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

Should remain as the team account

image: 620771051181.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-x86:ubuntu-20.04_clang-7x-bm-framework_latest
image: 183295444613.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-x86:ubuntu-20.04_clang-7x-bm-framework_latest
Copy link
Member

Choose a reason for hiding this comment

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

Should remain as the team account

image: 620771051181.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-x86:ubuntu-20.04_clang-7x-bm-framework_latest
image: 183295444613.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-x86:ubuntu-20.04_clang-7x-bm-framework_latest
Copy link
Member

Choose a reason for hiding this comment

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

Should remain as the team account

Comment on lines +63 to +65
if env.account == PRE_PROD_ACCOUNT:
github_repo_owner = STAGING_GITHUB_REPO_OWNER
github_repo_name = STAGING_GITHUB_REPO_NAME
Copy link
Member

Choose a reason for hiding this comment

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

How does this work for deploying to your own personal account if you want to go through setting up the pipeline and all that?

Copy link
Member

Choose a reason for hiding this comment

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

I guess these are correctly set to the values from the pipeline cdk_env in AwsLcCiPipeline?

Comment on lines +93 to +99
while [[ ${attempt} -le ${MAX_RETRY} ]]; do
if [[ $attempt -gt 0 ]]; then
echo "Retrying ${attempt}/${MAX_RETRY}..."
fi

attempt=$((attempt + 1))

Copy link
Member

Choose a reason for hiding this comment

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

ditto


assume_role

if [[ -z "${BUILD_TYPE+x}" || -z "${BUILD_TYPE}" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if [[ -z "${BUILD_TYPE+x}" || -z "${BUILD_TYPE}" ]]; then
if [[ -z "${BUILD_TYPE:+x}" ]]; then

Does both of these for you. If BUILD_TYPE is either unset / empty string or not defined it will be a empty string substituted for this check. Otherwise x will be substituted and thus not move into the if statement body.

fi

if [[ ${BUILD_TYPE} == "docker" ]]; then
if [[ -z "${PLATFORM+x}" || -z "${PLATFORM}" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Same note as above.

fi

if [[ ${BUILD_TYPE} == "ci" ]]; then
if [[ -z "${PROJECT+x}" || -z "${PROJECT}" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

ditto

Comment on lines +92 to +102
if [[ -z "${BUILD_TYPE+x}" || -z "${BUILD_TYPE}" ]]; then
echo "No build type provided."
exit 1
fi

if [[ -z "${STACKS+x}" || -z "${STACKS}" ]]; then
echo "No stacks provided."
exit 1
fi

if [[ -n "${PREVIOUS_REBUILDS+x}" && -n "${PREVIOUS_REBUILDS}" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

See previous comments

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.

3 participants