-
Notifications
You must be signed in to change notification settings - Fork 50
60 lines (51 loc) · 1.94 KB
/
benchmark.yml
File metadata and controls
60 lines (51 loc) · 1.94 KB
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
name: Run Simple R Script on HPC via Slurm
on:
push:
branches:
- feature/metamorpheus-scripts
# - devel
jobs:
Benchmarking-pipeline:
runs-on: ubuntu-latest
env:
FDR_THRESHOLD: 0.21
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set Up SSH Access
run: |
mkdir -p ~/.ssh
touch ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY_EXPLORER }}" > ~/.ssh/id_rsa
ssh-keyscan -H login.explorer.northeastern.edu >> ~/.ssh/known_hosts || exit 1
- name: Transfer Files to HPC
run: |
scp -r benchmark raina.ans@login.explorer.northeastern.edu:/projects/VitekLab/Projects/Benchmarking || exit 1
- name: Submit Slurm Job and Capture Job ID
id: submit_job
run: |
ssh raina.ans@login.explorer.northeastern.edu "cd /projects/VitekLab/Projects/Benchmarking/benchmark && sbatch config.slurm" | tee slurm_job_id.txt
slurm_job_id=$(grep -oP '\d+' slurm_job_id.txt)
echo "Slurm Job ID is $slurm_job_id"
echo "slurm_job_id=$slurm_job_id" >> $GITHUB_ENV
- name: Monitor Slurm Job
run: |
ssh raina.ans@login.explorer.northeastern.edu "
while squeue -j ${{ env.slurm_job_id }} | grep -q ${{ env.slurm_job_id }}; do
echo 'Job Id : ${{ env.slurm_job_id }} is still running...'
sleep 10
done
echo 'Job has completed.'
"
- name: Fetch Output
run: |
scp -O raina.ans@login.explorer.northeastern.edu:/projects/VitekLab/Projects/Benchmarking/benchmark/job_output.txt job_output.txt
scp -O raina.ans@login.explorer.northeastern.edu:/projects/VitekLab/Projects/Benchmarking/benchmark/job_error.txt job_error.txt
- name: Upload Output as Artifact
uses: actions/upload-artifact@v4
with:
name: benchmark-output
path: |
job_output.txt
job_error.txt