forked from sapporo-wes/sapporo-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcwltool_registered_workflow.sh
35 lines (29 loc) · 1.13 KB
/
cwltool_registered_workflow.sh
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
#!/usr/bin/env bash
set -euo pipefail
# Define default values for SAPPORO_HOST and SAPPORO_PORT
SAPPORO_HOST=${SAPPORO_HOST:-127.0.0.1}
SAPPORO_PORT=${SAPPORO_PORT:-1122}
readonly workflow_params='{
"fastq_1": {
"class": "File",
"location": "https://raw.githubusercontent.com/sapporo-wes/sapporo-service/main/tests/resources/cwltool/ERR034597_1.small.fq.gz"
},
"fastq_2": {
"class": "File",
"location": "https://raw.githubusercontent.com/sapporo-wes/sapporo-service/main/tests/resources/cwltool/ERR034597_2.small.fq.gz"
}
}'
response=$(curl -fsSL -X POST \
-H "Content-Type: multipart/form-data" \
-F "workflow_name=Example workflow - CWL - Trimming and QC" \
-F "workflow_params=${workflow_params}" \
-F "workflow_engine=cwltool" \
http://${SAPPORO_HOST}:${SAPPORO_PORT}/runs)
if [[ $? -ne 0 ]]; then
echo -e "Error: Failed to POST runs:\n${response}"
exit 1
fi
run_id=$(echo "${response}" | jq -r '.run_id')
echo -e "POST /runs is succeeded:\n${response}\n"
echo -e "Please access to the following URL to get the run status:\n"
echo -e "curl -fsSL -X GET http://${SAPPORO_HOST}:${SAPPORO_PORT}/runs/${run_id}\n"