Merge branch '9272-use-container-auth'
[arvados.git] / services / crunch-dispatch-slurm / crunch-finish-slurm.sh
1 #!/bin/sh
2
3 # Script to be called by strigger when a job finishes.  This ensures the job
4 # record has the correct state "Complete" even if the node running the job
5 # failed.
6
7 ARVADOS_API_HOST=$1
8 ARVADOS_API_TOKEN=$2
9 ARVADOS_API_HOST_INSECURE=$3
10 uuid=$4
11 jobid=$5
12
13 # If it is possible to attach metadata to job records we could look up the
14 # above information instead of getting it on the command line.  For example,
15 # this is the recipe for getting the job name (container uuid) from the job id.
16 #uuid=$(squeue --jobs=$jobid --states=all --format=%j --noheader)
17
18 export ARVADOS_API_HOST ARVADOS_API_TOKEN ARVADOS_API_HOST_INSECURE
19
20 exec arv container update --uuid $uuid --container '{"state": "Complete"}'