Skip to content

Commit

Permalink
fix wrong code source in framework
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel40791765 committed Apr 19, 2024
1 parent e55082c commit 9a75435
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
17 changes: 13 additions & 4 deletions tests/ci/cdk/cdk/ssm/general_test_run_ssm_document.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ mainSteps:
- sudo -i
- export DEBIAN_FRONTEND=noninteractive
- export CPU_TYPE=$(dpkg --print-architecture)
- export SOURCE={SOURCE}
# if we have a cpu type of x86, we want linux-x86
- if [ "${CPU_TYPE}" = amd64 ]; then export CPU_ARCH=linux-x86; export AWS_CLI_PREFIX=x86_; sudo sh -c "echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo"; fi
# if we have a cpu type of arm, we want linux-aarch
Expand All @@ -25,9 +26,17 @@ mainSteps:
- curl "https://awscli.amazonaws.com/awscli-exe-linux-${AWS_CLI_PREFIX}64.zip" -o "awscliv2.zip"
- unzip awscliv2.zip
- ./aws/install
- git clone {GITHUB_REPO} aws-lc-pr
- cd aws-lc-pr
- git checkout {COMMIT_ID}
# Check if the source code is on S3, otherwise treat the source as a PR.
- >
if [[ "${SOURCE:0:16}" == 'aws-lc-codebuild' ]]; then
aws s3api get-object --bucket {S3_BUCKET} --key "${SOURCE##{S3_BUCKET}/}" aws-lc-pr.zip
unzip aws-lc-pr.zip
else
git clone {SOURCE} aws-lc-pr
cd aws-lc-pr
git fetch origin pull/{PR_NUM}/head:temp
git checkout temp
fi
# install docker if its not already installed
- chmod +x ./tests/ci/benchmark_framework/install_docker.sh
- ./tests/ci/benchmark_framework/install_docker.sh
Expand All @@ -36,7 +45,7 @@ mainSteps:
- aws ecr get-login-password --region us-west-2 | docker login -u AWS --password-stdin "${ECR_REPO}"
- docker pull "${ECR_REPO}:{ECR_DOCKER_TAG}"
- # start the container and run the bm script
- exec_docker="docker run --env AWS_ACCOUNT_ID={AWS_ACCOUNT_ID} --env PR_NUM={PR_NUM} --env COMMIT_ID={COMMIT_ID} --env CPU_TYPE=${CPU_TYPE} -v `pwd`:`pwd` -w `pwd` ${ECR_REPO}:{ECR_DOCKER_TAG}_latest"
- exec_docker="docker run --env AWS_ACCOUNT_ID={AWS_ACCOUNT_ID} --env PR_NUM={PR_NUM} --env CPU_TYPE=${CPU_TYPE} -v `pwd`:`pwd` -w `pwd` ${ECR_REPO}:{ECR_DOCKER_TAG}_latest"
- chmod +x ./tests/ci/run_posix_sanitizers.sh
- $exec_docker ./tests/ci/run_posix_sanitizers.sh
- chmod +x ./tests/ci/run_fips_tests.sh
Expand Down
9 changes: 4 additions & 5 deletions tests/ci/run_ec2_test_framework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ cleanup() {
generate_ssm_document_file() {
# use sed to replace placeholder values inside preexisting document
sed -e "s,{AWS_ACCOUNT_ID},${AWS_ACCOUNT_ID},g" \
-e "s,{PR_NUM},${CODEBUILD_WEBHOOK_TRIGGER},g" \
-e "s,{COMMIT_ID},${CODEBUILD_SOURCE_VERSION},g" \
-e "s,{GITHUB_REPO},${CODEBUILD_SOURCE_REPO_URL},g" \
-e "s,{PR_NUM},${CODEBUILD_WEBHOOK_TRIGGER//pr\/},g" \
-e "s,{SOURCE},${CODEBUILD_SOURCE_REPO_URL},g" \
-e "s,{S3_BUCKET},${s3_bucket_name},g" \
-e "s,{ECR_DOCKER_TAG},${ecr_docker_tag},g" \
tests/ci/cdk/cdk/ssm/general_test_run_ssm_document.yaml \
> "tests/ci/cdk/cdk/ssm/${ec2_ami_id}_ssm_document.yaml"
Expand All @@ -45,9 +45,8 @@ trap cleanup EXIT

# print some information for reference
echo GitHub PR Number: "${CODEBUILD_WEBHOOK_TRIGGER}"
echo GitHub Commit Version: "${CODEBUILD_SOURCE_VERSION}"
echo AWS Account ID: "${AWS_ACCOUNT_ID}"
echo GitHub Repo Link: "${CODEBUILD_SOURCE_REPO_URL}"
echo Source: "${CODEBUILD_SOURCE_REPO_URL}"
export ec2_ami_id="$1"
export ec2_instance_type="$2"
export ecr_docker_tag="$3"
Expand Down

0 comments on commit 9a75435

Please sign in to comment.