|
3 | 3 | name: Functional GPU (NVIDIA Tesla T4 x1) |
4 | 4 |
|
5 | 5 | on: |
| 6 | + workflow_dispatch: {} |
6 | 7 | # run against every merge commit to 'main' and release branches |
7 | 8 | push: |
8 | 9 | branches: |
@@ -39,28 +40,59 @@ jobs: |
39 | 40 | start-small-ec2-runner: |
40 | 41 | runs-on: ubuntu-latest |
41 | 42 | 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 }} |
44 | 46 | 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 |
47 | 49 | 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" |
55 | 63 | 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: > |
64 | 96 | [ |
65 | 97 | {"Key": "Name", "Value": "instructlab-ci-github-small-runner"}, |
66 | 98 | {"Key": "GitHubRepository", "Value": "${{ github.repository }}"}, |
@@ -133,7 +165,7 @@ jobs: |
133 | 165 | with: |
134 | 166 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
135 | 167 | 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 }} |
137 | 169 |
|
138 | 170 | - name: Stop EC2 runner |
139 | 171 | uses: machulav/ec2-github-runner@a8c20fc0876503410b2b966c124abc2311984ce2 # v2.3.9 |
|
0 commit comments