Skip to content

Commit 8e8fbe3

Browse files
committed
Workflow file
1 parent a85a79b commit 8e8fbe3

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Metal MLX Job
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
run_id:
6+
description: 'Unique identifier for this run'
7+
required: true
8+
type: string
9+
payload:
10+
description: 'Content of the user submission, as json string'
11+
required: true
12+
type: string
13+
runner:
14+
description: 'Metal runner to run workflow on'
15+
required: true
16+
default: "arc-metal-runner-set"
17+
type: string
18+
requirements:
19+
description: 'Contents for a requirements.txt file'
20+
required: false
21+
type: string
22+
23+
run-name: 'Metal Job - ${{ github.event.inputs.run_id }}'
24+
25+
jobs:
26+
run:
27+
runs-on: ${{ github.event.inputs.runner }}
28+
timeout-minutes: 20
29+
steps:
30+
- uses: actions/checkout@v3
31+
32+
- name: Create input files
33+
shell: bash
34+
run: |
35+
# Extract the payload content without printing it
36+
PAYLOAD=$(jq -r '.inputs.payload' $GITHUB_EVENT_PATH)
37+
38+
# Apply mask to the extracted content
39+
echo "::add-mask::$PAYLOAD"
40+
41+
# Now write to file (won't be logged since it's masked)
42+
echo "$PAYLOAD" > payload.json
43+
44+
- name: Setup Virtual Environment and Install Dependencies
45+
shell: bash
46+
run: |
47+
pip install --break-system-packages --upgrade pip
48+
pip install --break-system-packages -e .
49+
50+
- name: Install requirements
51+
if: ${{ github.event.inputs.requirements != '' }}
52+
shell: bash
53+
run: |
54+
echo "${{ github.event.inputs.requirements }}" > requirements.txt
55+
pip install --break-system-packages -r requirements.txt
56+
57+
- name: Run script
58+
shell: bash
59+
run: |
60+
python3 src/runners/github-runner.py
61+
62+
- name: Upload training artifacts
63+
uses: actions/upload-artifact@v4
64+
if: always()
65+
with:
66+
name: run-result
67+
path: result.json
68+
69+
- name: Upload profiling artifacts
70+
uses: actions/upload-artifact@v4
71+
if: always()
72+
with:
73+
name: profile-data
74+
path: profile_data/*
75+
retention-days: 1

0 commit comments

Comments
 (0)