Skip to content

Commit e21abfb

Browse files
committed
test
1 parent cc4f973 commit e21abfb

File tree

2 files changed

+28
-37
lines changed

2 files changed

+28
-37
lines changed

.github/workflows/_runner_ondemand_slurm.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
id: meta
4545
shell: bash -x -e {0}
4646
run: |
47-
JOB_NAME=${{ inputs.NAME }}-$(printf "%04x%04x" $RANDOM $RANDOM)
47+
JOB_NAME=${{ inputs.NAME }}-$(printf "%8x" $((RANDOM<<16+RANDOM)))
4848
LOG_FILE=/nfs/cluster/${JOB_NAME}.log
4949
for var in JOB_NAME LOG_FILE; do
5050
echo "$var=${!var}" >> $GITHUB_OUTPUT
@@ -59,7 +59,7 @@ jobs:
5959
sbatch --parsable \
6060
<<"EOF"
6161
#!/bin/bash
62-
#SBATCH --job-name=${{steps.meta.outputs.JOB_NAME }}
62+
#SBATCH --job-name=${{ steps.meta.outputs.JOB_NAME }}
6363
#SBATCH --exclusive
6464
#SBATCH --nodes=1
6565
#SBATCH --tasks=1
@@ -85,7 +85,7 @@ jobs:
8585
--gpus all \
8686
--privileged \
8787
-v /runner \
88-
-e RUNNER_NAME="${{ inputs.NAME }}" \
88+
-e RUNNER_NAME="${{ steps.meta.outputs.JOB_NAME }}" \
8989
-e RUNNER_LABELS="${{ inputs.LABELS }}" \
9090
-e RUNNER_REPO="${{ github.repository }}" \
9191
-e RUNNER_TOKEN="${RUNNER_TOKEN}" \

.github/workflows/_sandbox.yaml

+25-34
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,32 @@
11
name: "~Sandbox"
22

33
on:
4-
workflow_dispatch:
4+
push:
55

66
jobs:
7-
sandbox:
8-
runs-on: ubuntu-22.04
9-
steps:
10-
- name: Login to GitHub Container Registry
11-
uses: docker/login-action@v3
12-
with:
13-
registry: ghcr.io
14-
username: ${{ github.repository_owner }}
15-
password: ${{ secrets.GITHUB_TOKEN }}
7+
runner:
8+
uses: ./.github/workflows/_runner_ondemand_slurm.yaml
9+
with:
10+
NAME: "TEST"
11+
LABELS: "A100,${{ github.run_id }}"
12+
TIME: "01:00:00"
13+
secrets: inherit
1614

17-
- name: Print usage
18-
run: |
19-
cat << EOF
20-
This is an empty workflow file located in the main branch of your
21-
repository. It serves as a testing ground for new GitHub Actions on
22-
development branches before merging them to the main branch. By
23-
defining and overloading this workflow on your development branch,
24-
you can test new actions without affecting your main branch, ensuring
25-
a smooth integration process once the changes are ready to be merged.
15+
jax-unit-test:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
GPU_ARCH: [V100, A100]
20+
# ensures A100 job lands on dedicated runner for this particular job
21+
runs-on:
22+
- self-hosted
23+
- "${{ matrix.GPU_ARCH }}"
24+
- "${{ matrix.GPU_ARCH == 'A100' && github.run_id || '' }}"
25+
env:
26+
BADGE_FILENAME_FULL: ${{ inputs.BADGE_FILENAME }}-${{ matrix.GPU_ARCH }}.json
27+
steps:
28+
- name: Print environment variables
29+
run: env
2630

27-
Usage:
28-
29-
1. In your development branch, modify the sandbox.yml workflow file
30-
to include the new actions you want to test. Make sure to commit
31-
the changes to the development branch.
32-
2. Navigate to the 'Actions' tab in your repository, select the
33-
'~Sandbox' workflow, and choose your development branch from the
34-
branch dropdown menu. Click on 'Run workflow' to trigger the
35-
workflow on your development branch.
36-
3. Once you have tested and verified the new actions in the Sandbox
37-
workflow, you can incorporate them into your main workflow(s) and
38-
merge the development branch into the main branch. Remember to
39-
revert the changes to the sandbox.yml file in the main branch to
40-
keep it empty for future testing.
41-
EOF
31+
- name: Print GPU information
32+
run: nvidia-smi

0 commit comments

Comments
 (0)