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

[NONEVM-641] Starting Gauntlet Plus Plus Container on CTF Run Tests Start up #720

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/fluffy-trainers-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"ctf-setup-gauntlet-plus-plus": major
"ctf-setup-run-tests-environment": minor
"ctf-run-tests": minor
---

Adding support to include pulling the gauntlet-plus-plus image from the prod ECR
18 changes: 17 additions & 1 deletion actions/ctf-run-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ inputs:
QA_AWS_ROLE_TO_ASSUME:
required: true
description: The AWS role to assume
PROD_AWS_REGION:
required: false
description: The AWS region to use for prod ECR
PROD_AWS_ROLE_TO_ASSUME:
required: false
description: The AWS role to assume for prod ECR
PROD_AWS_ACCOUNT_NUMBER:
required: false
description: The AWS Account number for the prod AWS account
gauntlet_plus_plus_image:
required: false
description: Gauntlet-plus-plus image link
QA_KUBECONFIG:
required: false
description: The kubernetes configuration to use
Expand Down Expand Up @@ -172,7 +184,7 @@ runs:
# Setup Tools and libraries
- name: Setup environment
if: inputs.run_setup == 'true'
uses: smartcontractkit/.github/actions/ctf-setup-run-tests-environment@2c41e20994aa9c0ae1af1ab467c64ac4acb15f2d # ctf-setup-run-tests-environment@0.0.0
uses: smartcontractkit/.github/actions/ctf-setup-run-tests-environment@7eb75e8cf85f9d6237080b62668114cc00aaecfc # ctf-setup-run-tests-environment@0.0.0
with:
test_download_vendor_packages_command:
${{ inputs.test_download_vendor_packages_command }}
Expand All @@ -189,6 +201,10 @@ runs:
QA_KUBECONFIG: ${{ inputs.QA_KUBECONFIG }}
should_tidy: ${{ inputs.should_tidy }}
no_cache: ${{ inputs.no_cache }}
PROD_AWS_ROLE_TO_ASSUME: ${{ inputs.PROD_AWS_ROLE_TO_ASSUME }}
PROD_AWS_REGION: ${{ inputs.PROD_AWS_REGION }}
gauntlet_plus_plus_image: ${{ inputs.gauntlet_plus_plus_image }}
prod_aws_account_number: ${{ inputs.PROD_AWS_ACCOUNT_NUMBER }}
gati_token: ${{ inputs.gati_token }}

- name: Replace chainlink/integration-tests deps
Expand Down
Empty file.
52 changes: 52 additions & 0 deletions actions/ctf-setup-gauntlet-plus-plus/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: ctf-setup-gauntlet-plus-plus
description: "Common gauntlet-plus-plus setup for CTF"

inputs:
dockerhub_username:
description:
Username for Docker Hub to avoid rate limits when pulling public images
required: false
dockerhub_password:
description:
Password for Docker Hub to avoid rate limits when pulling public images
required: false
PROD_AWS_REGION:
required: true
description: The AWS region to use
PROD_AWS_ROLE_TO_ASSUME:
required: true
description: The AWS role to assume
gauntlet_plus_plus_image:
required: true
description: Gauntlet-plus-plus image link
aws_role_duration_seconds:
required: false
default: "3600"
description: The duration to be logged into the aws role for
aws_account_number:
required: true
description: AWS Account number that holds the gauntlet_plus_plus

runs:
using: composite
steps:
# Setup AWS cred and K8s context
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1
with:
aws-region: ${{ inputs.PROD_AWS_REGION }}
role-to-assume: ${{ inputs.PROD_AWS_ROLE_TO_ASSUME }}
role-duration-seconds: ${{ inputs.aws_role_duration_seconds }}
mask-aws-account-id: true
- name: Login to Amazon ECR
if: inputs.aws_account_number && inputs.PROD_AWS_REGION
id: login-ecr
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
with:
registries: ${{ inputs.aws_account_number }}
env:
AWS_REGION: ${{ inputs.PROD_AWS_REGION }}
- name: Pull Gauntlet Plus Plus Image
shell: bash # Specify the shell to be used
run: |
docker pull ${{ inputs.gauntlet_plus_plus_image }}
11 changes: 11 additions & 0 deletions actions/ctf-setup-gauntlet-plus-plus/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "ctf-setup-gauntlet-plus-plus",
"version": "0.1.1",
"description": "Action that pulls the gauntlet-plus-plus image",
"private": true,
"scripts": {},
"author": "@smartcontractkit",
"license": "MIT",
"dependencies": {},
"repository": "https://github.com/smartcontractkit/.github"
}
7 changes: 7 additions & 0 deletions actions/ctf-setup-gauntlet-plus-plus/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "ctf-setup-gauntlet-plus-plus",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "actions/ctf-setup-gauntlet-plus-plus",
"targets": {}
}
24 changes: 24 additions & 0 deletions actions/ctf-setup-run-tests-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ inputs:
QA_AWS_ROLE_TO_ASSUME:
required: true
description: The AWS role to assume
PROD_AWS_REGION:
required: false
description: The AWS region to use for prod ECR
PROD_AWS_ROLE_TO_ASSUME:
required: false
description: The AWS role to assume for prod ECR
QA_KUBECONFIG:
required: false
description: The kubernetes configuration to use
Expand All @@ -61,6 +67,12 @@ inputs:
required: false
description: Do not use a go cache
default: "false"
gauntlet_plus_plus_image:
required: false
description: Gauntlet-plus-plus image link
prod_aws_account_number:
required: false
description: AWS Account number that holds the gauntlet_plus_plus
gati_token:
required: false
description: Token provided by GATI to pull from private repos
Expand All @@ -83,6 +95,18 @@ runs:
${{ inputs.test_download_vendor_packages_command }}
gati_token: ${{ inputs.gati_token }}

# Setup Gauntlet plus plus
- name: Setup gauntlet plus plus
if: inputs.gauntlet_plus_plus_image
uses: smartcontractkit/.github/actions/ctf-setup-gauntlet-plus-plus@11b8e8eda31ec2711f0b9f4ee71547c6b740d2ff # ctf-setup-gauntlet-plus-plus@0.0.1
with:
dockerhub_username: ${{ inputs.docker_username }}
dockerhub_password: ${{ inputs.docker_password }}
PROD_AWS_REGION: ${{ inputs.PROD_AWS_REGION }}
PROD_AWS_ROLE_TO_ASSUME: ${{ inputs.PROD_AWS_ROLE_TO_ASSUME }}
gauntlet_plus_plus_image: ${{ inputs.gauntlet_plus_plus_image }}
aws_account_number: ${{ inputs.prod_aws_account_number }}

# Setup AWS cred and K8s context
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1
Expand Down
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading