✨ Toy workflow addition
This commit is contained in:
21
example_workflow/job_output/job_FQQUQMTGtqUw/job.sh
Executable file
21
example_workflow/job_output/job_FQQUQMTGtqUw/job.sh
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get job params
|
||||
given_hash=$(grep 'file_hash: *' $(dirname $0)/job.yml | tail -n1 | cut -c 14-)
|
||||
event_path=$(grep 'event_path: *' $(dirname $0)/job.yml | tail -n1 | cut -c 15-)
|
||||
|
||||
echo event_path: $event_path
|
||||
echo given_hash: $given_hash
|
||||
|
||||
# Check hash of input file to avoid race conditions
|
||||
actual_hash=$(sha256sum $event_path | cut -c -64)
|
||||
echo actual_hash: $actual_hash
|
||||
if [ "$given_hash" != "$actual_hash" ]; then
|
||||
echo Job was skipped as triggering file has been modified since scheduling
|
||||
exit 134
|
||||
fi
|
||||
|
||||
# Call actual job script
|
||||
python3 job_queue/job_FQQUQMTGtqUw/recipe.py >>job_queue/job_FQQUQMTGtqUw/output.log 2>&1
|
||||
|
||||
exit $?
|
Reference in New Issue
Block a user