forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 1
123 lines (113 loc) · 4.7 KB
/
sycl-linux-precommit-aws.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: E2E on AWS CUDA
run-name: E2E on AWS CUDA - ${{ github.event.workflow_run.display_title }}
# Note: This workflow is currently disabled in the Github Actions UI because
# we run CUDA testing on the self-hosted runners.
# We have to keep pre-commit AWS CUDA testing in a separate workflow because we
# need access to AWS secret and that isn't available on pull_request jobs for
# PRs from forks. And github's "require approval for all outside collaborators"
# is bypassed on pull_request_target.
#
# Also, we use commit status and not check suite/run (which, in theory, is more
# powerful) due to https://github.com/orgs/community/discussions/24616.
on:
workflow_run:
workflows: [SYCL Pre Commit on Linux]
types:
- completed
permissions:
contents: read
jobs:
create-check:
runs-on: [Linux, aux-tasks]
permissions:
checks: write
statuses: write
steps:
- uses: actions/github-script@v7
with:
script: |
const sha = context.payload.workflow_run.head_sha
const run_id = '${{ github.run_id }}'
const this_run_url = 'https://github.com/' + context.repo.owner + '/' + context.repo.repo + '/actions/runs/' + run_id
// Create commit status.
await github.request('POST /repos/{owner}/{repo}/statuses/{sha}', {
owner: context.repo.owner,
repo: context.repo.repo,
sha: sha,
state: 'pending',
target_url: this_run_url,
description: 'SYCL E2E on AWS CUDA',
context: 'SYCL E2E on AWS CUDA',
})
aws-start:
runs-on: ubuntu-20.04
environment: aws
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: devops/actions/aws-ec2
- run: npm install ./devops/actions/aws-ec2
- uses: ./devops/actions/aws-ec2
with:
mode: start
runs-on-list: '[{"runs-on":"aws_cuda-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}","aws-ami":"ami-01cb0573cb039ab24","aws-type":["g5.2xlarge","g5.4xlarge"],"aws-disk":"/dev/sda1:64","aws-spot":"false"}]'
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
e2e-cuda:
needs: [aws-start]
uses: ./.github/workflows/sycl-linux-run-tests.yml
with:
name: CUDA E2E
runner: '["aws_cuda-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}"]'
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN --env NVIDIA_DISABLE_REQUIRE=1
target_devices: ext_oneapi_cuda:gpu
# No idea why but that seems to work and be in sync with the main
# pre-commit workflow.
ref: ${{ github.event.workflow_run.referenced_workflows[0].sha }}
merge_ref: ''
sycl_toolchain_artifact: sycl_linux_default
sycl_toolchain_archive: llvm_sycl.tar.zst
sycl_toolchain_decompress_command: zstd
update-check:
needs: [create-check, e2e-cuda]
if: always()
runs-on: [Linux, aux-tasks]
permissions:
checks: write
statuses: write
steps:
- uses: actions/github-script@v7
with:
script: |
const sha = context.payload.workflow_run.head_sha
const run_id = '${{ github.run_id }}'
const this_run_url = 'https://github.com/' + context.repo.owner + '/' + context.repo.repo + '/actions/runs/' + run_id
// Update commit status.
await github.request('POST /repos/{owner}/{repo}/statuses/{sha}', {
owner: context.repo.owner,
repo: context.repo.repo,
sha: sha,
state: '${{ needs.e2e-cuda.result }}',
target_url: this_run_url,
description: 'SYCL E2E on AWS CUDA',
context: 'SYCL E2E on AWS CUDA',
})
aws-stop:
needs: [aws-start, e2e-cuda]
if: always()
runs-on: ubuntu-20.04
environment: aws
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: devops/actions/aws-ec2
- run: npm install ./devops/actions/aws-ec2
- uses: ./devops/actions/aws-ec2
with:
mode: stop
runs-on-list: '[{"runs-on":"aws_cuda-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}","aws-ami":"ami-01cb0573cb039ab24","aws-type":["g5.2xlarge","g5.4xlarge"],"aws-disk":"/dev/sda1:64","aws-spot":"false"}]'
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}