Skip to content
This repository was archived by the owner on Apr 30, 2026. It is now read-only.

Commit f1692aa

Browse files
committed
Add AWS region fallback to functional-gpu workflow
We're getting out of capacity issues with these smaller instances as well, so add the region fallback logic from our larger e2e jobs to this workflow. Signed-off-by: Ben Browning <bbrownin@redhat.com> (cherry picked from commit 8ee175e) # Conflicts: # .github/workflows/functional-gpu-nvidia-t4-x1.yml
1 parent 762980b commit f1692aa

1 file changed

Lines changed: 52 additions & 20 deletions

File tree

.github/workflows/functional-gpu-nvidia-t4-x1.yml

Lines changed: 52 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
name: Functional GPU (NVIDIA Tesla T4 x1)
44

55
on:
6+
workflow_dispatch: {}
67
# run against every merge commit to 'main' and release branches
78
push:
89
branches:
@@ -39,28 +40,59 @@ jobs:
3940
start-small-ec2-runner:
4041
runs-on: ubuntu-latest
4142
outputs:
42-
label: ${{ steps.start-ec2-runner.outputs.label }}
43-
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
43+
label: ${{ steps.launch-ec2-instance-with-fallback.outputs.label }}
44+
ec2-instance-id: ${{ steps.launch-ec2-instance-with-fallback.outputs.ec2-instance-id }}
45+
ec2-instance-region: ${{ steps.launch-ec2-instance-with-fallback.outputs.ec2-instance-region }}
4446
steps:
45-
- name: Configure AWS credentials
46-
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
47+
- name: Checkout "launch-ec2-runner-with-fallback" in-house CI action
48+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4749
with:
48-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
49-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
50-
aws-region: ${{ vars.AWS_REGION }}
51-
52-
- name: Start EC2 runner
53-
id: start-ec2-runner
54-
uses: machulav/ec2-github-runner@a8c20fc0876503410b2b966c124abc2311984ce2 # v2.3.9
50+
repository: instructlab/ci-actions
51+
# clone the "ci-actions" repo to a local directory called "ci-actions", instead of
52+
# overwriting the current WORKDIR contents
53+
path: ci-actions
54+
ref: release-v0.1
55+
sparse-checkout: |
56+
actions/launch-ec2-runner-with-fallback
57+
58+
- name: Launch EC2 Runner with Fallback
59+
id: launch-ec2-instance-with-fallback
60+
uses: ./ci-actions/actions/launch-ec2-runner-with-fallback
61+
env:
62+
TMPDIR: "/tmp"
5563
with:
56-
mode: start
57-
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
58-
ec2-image-id: ${{ vars.AWS_EC2_AMI }}
59-
ec2-instance-type: g4dn.2xlarge
60-
subnet-id: subnet-02d230cffd9385bd4
61-
security-group-id: sg-06300447c4a5fbef3
62-
iam-role-name: instructlab-ci-runner
63-
aws-resource-tags: >
64+
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
65+
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
66+
github_token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
67+
regions_config: >
68+
[
69+
{
70+
"region": "us-east-2",
71+
"subnets": {
72+
"us-east-2a": "${{ vars.SUBNET_US_EAST_2A }}",
73+
"us-east-2b": "${{ vars.SUBNET_US_EAST_2B }}",
74+
"us-east-2c": "${{ vars.SUBNET_US_EAST_2C }}"
75+
},
76+
"ec2-ami": "${{ vars.AWS_EC2_AMI_US_EAST_2 }}",
77+
"security-group-id": "${{ vars.SECURITY_GROUP_ID_US_EAST_2 }}"
78+
},
79+
{
80+
"region": "us-east-1",
81+
"subnets": {
82+
"us-east-1a": "${{ vars.SUBNET_US_EAST_1A }}",
83+
"us-east-1b": "${{ vars.SUBNET_US_EAST_1B }}",
84+
"us-east-1c": "${{ vars.SUBNET_US_EAST_1C }}",
85+
"us-east-1d": "${{ vars.SUBNET_US_EAST_1D }}",
86+
"us-east-1e": "${{ vars.SUBNET_US_EAST_1E }}",
87+
"us-east-1f": "${{ vars.SUBNET_US_EAST_1F }}"
88+
},
89+
"ec2-ami": "${{ vars.AWS_EC2_AMI_US_EAST_1 }}",
90+
"security-group-id": "${{ vars.SECURITY_GROUP_ID_US_EAST_1 }}"
91+
}
92+
]
93+
try_spot_instance_first: false
94+
ec2_instance_type: g4dn.2xlarge
95+
aws_resource_tags: >
6496
[
6597
{"Key": "Name", "Value": "instructlab-ci-github-small-runner"},
6698
{"Key": "GitHubRepository", "Value": "${{ github.repository }}"},
@@ -133,7 +165,7 @@ jobs:
133165
with:
134166
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
135167
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
136-
aws-region: ${{ vars.AWS_REGION }}
168+
aws-region: ${{ needs.start-small-ec2-runner.outputs.ec2-instance-region }}
137169

138170
- name: Stop EC2 runner
139171
uses: machulav/ec2-github-runner@a8c20fc0876503410b2b966c124abc2311984ce2 # v2.3.9

0 commit comments

Comments
 (0)