-
Notifications
You must be signed in to change notification settings - Fork 9
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
Stop Workflows From Using Root Permissions in Cypress Container #1480
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b3ecfa8
Create a11y testing workflow file.
olivereri f13391a
Remove root user option from cypress test container run.
olivereri 5a0c6da
Remove build and upload portions of content-build. Download build art…
olivereri b106e35
change cypress container version. Matches vets-website e2e workflow
olivereri da2321e
fix typo
olivereri 1bbea65
remove testing file. Remove root user from a11y workflows.
olivereri c4273bd
Remove root user from CI workflows.
olivereri fd6952f
Mount /etc/ssl/certs to containers respective folder. remove mv step.
olivereri 67b10f5
Dont mount host cert directory. Copy VA certs to container cert direc…
olivereri c64af44
Run CI job on Content-Build ASG. Comment out on-demand runner
olivereri 6fcceda
Fix typo
olivereri 5e0787a
Remove On-demand Runner jobs
olivereri 6779e6b
Remove cert mv step. No longer needed.
olivereri c84c2b7
Use verbose docker run options.
olivereri 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 contains 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 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 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 |
---|---|---|
|
@@ -243,63 +243,6 @@ jobs: | |
payload: ${{ steps.get-broken-link-info.outputs.SLACK_BLOCKS }} | ||
channel-id: ${{ env.BROKEN_LINKS_SLACK }} | ||
|
||
start-runner: | ||
runs-on: [self-hosted] | ||
outputs: | ||
label: ${{ steps.start-ec2-runner.outputs.label }} | ||
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }} | ||
timeout-minutes: 15 | ||
|
||
steps: | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-gov-west-1 | ||
|
||
- name: Get bot token from Parameter Store | ||
uses: marvinpinto/action-inject-ssm-secrets@v1.2.1 | ||
with: | ||
ssm_parameter: /devops/VA_VSP_BOT_GITHUB_TOKEN | ||
env_variable_name: VA_VSP_BOT_GITHUB_TOKEN | ||
|
||
- name: Get latest GHA Runner AMI ID | ||
run: | | ||
echo "RUNNER_AMI_ID=$(aws ec2 describe-images \ | ||
--owners 008577686731 \ | ||
--filters "Name=state,Values=available" "Name=name,Values=platform-gha-runner-ubuntu*" \ | ||
--query 'sort_by(Images,&CreationDate)[-1].ImageId' \ | ||
--output text)" >> $GITHUB_ENV | ||
|
||
- name: Get Subnet with the most free IPs # We will run these in the dsva-vagov-utility-2x subnet, so filter for those | ||
run: | | ||
echo "SUBNET_ID=$(aws ec2 describe-subnets \ | ||
--filters "Name=tag:Name,Values=dsva-vagov-utility-subnet-2*" \ | ||
--query 'sort_by(Subnets,&AvailableIpAddressCount)[-1].SubnetId' \ | ||
--output text)" >> $GITHUB_ENV | ||
|
||
- name: Start EC2 Runner | ||
id: start-ec2-runner | ||
uses: department-of-veterans-affairs/ec2-github-runner@main | ||
with: | ||
mode: start | ||
github-token: ${{ env.VA_VSP_BOT_GITHUB_TOKEN }} | ||
ec2-image-id: ${{ env.RUNNER_AMI_ID }} | ||
ec2-instance-type: ${{ env.INSTANCE_TYPE }} | ||
subnet-id: ${{ env.SUBNET_ID }} | ||
security-group-id: sg-0e23b56be3798e3a1 | ||
max_attempts: 3 | ||
aws-resource-tags: > | ||
[ | ||
{"Key": "Name", "Value": "dsva-vagov-content-build-gha-runner"}, | ||
{"Key": "project", "Value": "vagov"}, | ||
{"Key": "office", "Value": "dsva"}, | ||
{"Key": "application", "Value": "gha-runner"}, | ||
{"Key": "VAECID", "Value": "AWG20180517003"}, | ||
{"Key": "environment", "Value": "utility"} | ||
] | ||
|
||
unit-tests: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
|
@@ -409,29 +352,28 @@ jobs: | |
|
||
cypress-tests: | ||
name: Cypress E2E Tests | ||
runs-on: ${{ needs.start-runner.outputs.label }} | ||
runs-on: [self-hosted, asg] | ||
needs: | ||
- start-runner | ||
- build | ||
timeout-minutes: 30 | ||
container: | ||
image: public.ecr.aws/cypress-io/cypress/browsers:node16.13.2-chrome100-ff98 | ||
options: -u 0 | ||
options: -u 1001:1001 | ||
volumes: | ||
- /usr/local/share:/share | ||
- /etc/ssl/certs | ||
- /etc/ssl/certs:/etc/ssl/certs | ||
|
||
env: | ||
NODE_EXTRA_CA_CERTS: /etc/ssl/certs/VA-Internal-S2-RCA-combined.pem | ||
NODE_EXTRA_CA_CERTS: /etc/ssl/certs/ca-certificates.crt | ||
CHROMEDRIVER_FILEPATH: /share/chrome_driver/chromedriver | ||
|
||
steps: | ||
- name: Checkout content-build | ||
uses: actions/checkout@v3 | ||
|
||
# Required for Docker | ||
- name: Move VA cert to /etc/ssl/certs | ||
run: mv certs/VA-Internal-S2-RCA-combined.pem /etc/ssl/certs/ | ||
#- name: Move VA cert to /etc/ssl/certs | ||
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 we don't need these, should we remove them? 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. You're right, will do. |
||
# run: mv certs/VA-Internal-S2-RCA-combined.pem /etc/ssl/certs/ | ||
|
||
- name: Download production build | ||
run: curl -L "https://s3-us-gov-west-1.amazonaws.com/vetsgov-website-builds-s3-upload/content-build/${{ github.sha }}/vagovprod.tar.bz2" -o vagovprod.tar.bz2 | ||
|
@@ -785,35 +727,3 @@ jobs: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
|
||
stop-runner: | ||
name: Stop on-demand-runner | ||
needs: | ||
- start-runner | ||
- cypress-tests | ||
runs-on: ubuntu-latest | ||
if: ${{ always() }} # Even if an error happened, let's stop the runner | ||
env: | ||
INSTANCE_TYPE: c5.4xlarge | ||
timeout-minutes: 15 | ||
|
||
steps: | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-gov-west-1 | ||
|
||
- name: Get bot token from Parameter Store | ||
uses: marvinpinto/action-inject-ssm-secrets@v1.2.1 | ||
with: | ||
ssm_parameter: /devops/VA_VSP_BOT_GITHUB_TOKEN | ||
env_variable_name: VA_VSP_BOT_GITHUB_TOKEN | ||
|
||
- name: Stop Runner | ||
uses: department-of-veterans-affairs/ec2-github-runner@main | ||
with: | ||
mode: stop | ||
github-token: ${{ env.VA_VSP_BOT_GITHUB_TOKEN }} | ||
label: ${{ needs.start-runner.outputs.label }} | ||
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }} |
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.
might be nice to change the flags here to
--user
and--volume
here, because we really should've noticed earlier that we were specifying the same argument twiceThere 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.
/channeling inner Elijah
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.
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.