-
Notifications
You must be signed in to change notification settings - Fork 131
Create pre-production stage for CI pipeline #2282
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
Open
nhatnghiho
wants to merge
10
commits into
aws:main
Choose a base branch
from
nhatnghiho:ci-pipeline
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
45a1b91
Create pipeline
nhatnghiho 310e375
Update cdk instructions
nhatnghiho 4fadbc4
Add typing and cleanup
nhatnghiho 10d511f
Reformat code
nhatnghiho 7ec6289
Fix minor bugs
nhatnghiho 775eeed
Add step to auto-sync private repo
nhatnghiho 3537e22
Fix dev pipeline deployment bug
nhatnghiho 0a19c45
More cleanup
nhatnghiho 1d84eea
Incorporate comments
nhatnghiho cf7cdeb
Remove stale benchmark scripts
nhatnghiho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,56 +5,47 @@ | |
|
||
from aws_cdk import Environment, App | ||
|
||
# from cdk.bm_framework_stack import BmFrameworkStack | ||
from cdk.aws_lc_analytics_stack import AwsLcGitHubAnalyticsStack | ||
from cdk.aws_lc_android_ci_stack import AwsLcAndroidCIStack | ||
from cdk.aws_lc_github_ci_stack import AwsLcGitHubCIStack | ||
from cdk.aws_lc_github_fuzz_ci_stack import AwsLcGitHubFuzzCIStack | ||
from cdk.aws_lc_ec2_test_framework_ci_stack import AwsLcEC2TestingCIStack | ||
from cdk.linux_docker_image_batch_build_stack import LinuxDockerImageBatchBuildStack | ||
from pipeline.ci_util import add_ci_stacks | ||
from pipeline.pipeline_stack import AwsLcCiPipeline | ||
from cdk.windows_docker_image_build_stack import WindowsDockerImageBuildStack | ||
from cdk.aws_lc_github_ci_x509_stack import AwsLcGitHubX509CIStack | ||
from cdk.ecr_stack import EcrStack | ||
from util.metadata import AWS_ACCOUNT, AWS_REGION, LINUX_X86_ECR_REPO, LINUX_AARCH_ECR_REPO, WINDOWS_X86_ECR_REPO | ||
from util.metadata import ( | ||
LINUX_X86_ECR_REPO, | ||
LINUX_AARCH_ECR_REPO, | ||
WINDOWS_X86_ECR_REPO, | ||
PIPELINE_ACCOUNT, | ||
PIPELINE_REGION, | ||
DEPLOY_ACCOUNT, | ||
DEPLOY_REGION, | ||
) | ||
|
||
# Initialize app. | ||
app = App() | ||
|
||
# Initialize env. | ||
env = Environment(account=AWS_ACCOUNT, region=AWS_REGION) | ||
|
||
# Define AWS ECR stacks. | ||
# ECR holds the docker images, which are pre-built to accelerate the code builds/tests of git pull requests. | ||
EcrStack(app, "aws-lc-ecr-linux-x86", LINUX_X86_ECR_REPO, env=env) | ||
EcrStack(app, "aws-lc-ecr-linux-aarch", LINUX_AARCH_ECR_REPO, env=env) | ||
EcrStack(app, "aws-lc-ecr-windows-x86", WINDOWS_X86_ECR_REPO, env=env) | ||
|
||
# Define CodeBuild Batch job for building Docker images. | ||
LinuxDockerImageBatchBuildStack(app, "aws-lc-docker-image-build-linux", env=env) | ||
|
||
# AWS CodeBuild cannot build Windows Docker images because DIND (Docker In Docker) is not supported on Windows. | ||
# Windows Docker images are created by running commands in Windows EC2 instance. | ||
WindowsDockerImageBuildStack(app, "aws-lc-docker-image-build-windows", env=env) | ||
|
||
# Define CodeBuild Batch job for testing code. | ||
x86_build_spec_file = "cdk/codebuild/github_ci_linux_x86_omnibus.yaml" | ||
AwsLcGitHubCIStack(app, "aws-lc-ci-linux-x86", x86_build_spec_file, env=env) | ||
arm_build_spec_file = "cdk/codebuild/github_ci_linux_arm_omnibus.yaml" | ||
AwsLcGitHubCIStack(app, "aws-lc-ci-linux-arm", arm_build_spec_file, env=env) | ||
integration_build_spec_file = "cdk/codebuild/github_ci_integration_omnibus.yaml" | ||
AwsLcGitHubCIStack(app, "aws-lc-ci-integration", integration_build_spec_file, env=env) | ||
win_x86_build_spec_file = "cdk/codebuild/github_ci_windows_x86_omnibus.yaml" | ||
AwsLcGitHubCIStack(app, "aws-lc-ci-windows-x86", win_x86_build_spec_file, env=env) | ||
fuzz_build_spec_file = "cdk/codebuild/github_ci_fuzzing_omnibus.yaml" | ||
AwsLcGitHubFuzzCIStack(app, "aws-lc-ci-fuzzing", fuzz_build_spec_file, env=env) | ||
analytics_build_spec_file = "cdk/codebuild/github_ci_analytics_omnibus.yaml" | ||
AwsLcGitHubAnalyticsStack(app, "aws-lc-ci-analytics", analytics_build_spec_file, env=env) | ||
# bm_framework_build_spec_file = "cdk/codebuild/bm_framework_omnibus.yaml" | ||
# BmFrameworkStack(app, "aws-lc-ci-bm-framework", bm_framework_build_spec_file, env=env) | ||
ec2_test_framework_build_spec_file = "cdk/codebuild/ec2_test_framework_omnibus.yaml" | ||
AwsLcEC2TestingCIStack(app, "aws-lc-ci-ec2-test-framework", ec2_test_framework_build_spec_file, env=env) | ||
android_build_spec_file = "cdk/codebuild/github_ci_android_omnibus.yaml" | ||
AwsLcAndroidCIStack(app, "aws-lc-ci-devicefarm-android", android_build_spec_file, env=env) | ||
AwsLcGitHubX509CIStack(app, "aws-lc-ci-x509") | ||
AwsLcCiPipeline( | ||
app, | ||
"AwsLcCiPipeline", | ||
env=Environment(account=PIPELINE_ACCOUNT, region=PIPELINE_REGION), | ||
) | ||
|
||
if DEPLOY_ACCOUNT and DEPLOY_REGION: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If these aren't set what happens when this calls app.synth? |
||
# Initialize env. | ||
env = Environment(account=DEPLOY_ACCOUNT, region=DEPLOY_REGION) | ||
|
||
# Define AWS ECR stacks. | ||
# ECR holds the docker images, which are pre-built to accelerate the code builds/tests of git pull requests. | ||
EcrStack(app, "aws-lc-ecr-linux-x86", LINUX_X86_ECR_REPO, env=env) | ||
EcrStack(app, "aws-lc-ecr-linux-aarch", LINUX_AARCH_ECR_REPO, env=env) | ||
EcrStack(app, "aws-lc-ecr-windows-x86", WINDOWS_X86_ECR_REPO, env=env) | ||
|
||
# Define CodeBuild Batch job for building Docker images. | ||
LinuxDockerImageBatchBuildStack(app, "aws-lc-docker-image-build-linux", env=env) | ||
|
||
# AWS CodeBuild cannot build Windows Docker images because DIND (Docker In Docker) is not supported on Windows. | ||
# Windows Docker images are created by running commands in Windows EC2 instance. | ||
WindowsDockerImageBuildStack(app, "aws-lc-docker-image-build-windows", env=env) | ||
|
||
add_ci_stacks(app, env=env) | ||
|
||
app.synth() |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to keep this support and documented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is helpful if we want to deploy 1 stack at a time. Say, if I only want to deploy
aws-lc-ci-integration
and don't want to deal with anything else, these commands will come in handy.