Skip to content

Commit 25c8baa

Browse files
authored
Merge pull request #635 from broadinstitute/upgrade-wdl-1.1
Upgrade WDL from 1.0 to 1.1
2 parents 358789e + ecf20b1 commit 25c8baa

112 files changed

Lines changed: 206 additions & 149 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

github_actions_ci/build-dx.sh

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -e -o pipefail
33

44
if [ -z "$DX_API_TOKEN" ]; then
5-
echo "ERROR: DX_API_TOKEN is not set, this is needed to build dxWDL workflows."
5+
echo "ERROR: DX_API_TOKEN is not set, this is needed to build DNAnexus workflows."
66
exit 1
77
fi
88

@@ -14,8 +14,8 @@ source dx-toolkit/environment
1414
dx login --token "$DX_API_TOKEN" --noprojects
1515
dx select $DX_PROJECT
1616

17-
# compile with dxWDL
18-
COMPILE_SUCCESS="dxWDL-compile_all-success.txt"
17+
# compile with dxCompiler
18+
COMPILE_SUCCESS="dxCompiler-compile_all-success.txt"
1919
touch $COMPILE_SUCCESS
2020
for workflow in pipes/WDL/workflows/*.wdl; do
2121
if [ -n "$(grep DX_SKIP_WORKFLOW $workflow)" ]; then
@@ -34,7 +34,7 @@ for workflow in pipes/WDL/workflows/*.wdl; do
3434
extras_json="pipes/dnax/dx-extras.json"
3535
CMD_DEFAULTS+=" -extras $extras_json"
3636

37-
dx_id=$(java -jar dxWDL.jar compile \
37+
dx_id=$(java -jar dxCompiler.jar compile \
3838
$workflow $CMD_DEFAULTS -f -verbose \
3939
-leaveWorkflowsOpen \
4040
-imports pipes/WDL/tasks/ \
@@ -50,27 +50,42 @@ for workflow in pipes/WDL/workflows/*.wdl; do
5050
fi
5151
done
5252

53-
# build consolidate_run_tarballs (native DNAnexus applet) applet
54-
pushd pipes/dnax/dx-launcher
55-
cp consolidate_run_tarballs.yml consolidate_run_tarballs_dxapp.yml
56-
consolidate_tarballs_dx_id=$(./dx-yml-build consolidate_run_tarballs_dxapp.yml -a --destination /build/$VERSION/ | jq -r ".id")
57-
popd
58-
echo -e "consolidate_run_tarballs\t$dx_id" >> $COMPILE_SUCCESS
59-
6053
# Special case: build demux launchers (native DNAnexus applets), embedding the
61-
# demux workflow ID as a default input
54+
# demux workflow ID as a default input. Skip if no demux workflows were compiled.
6255
demux_workflows_to_build="demux_plus demux_only"
56+
any_demux_compiled=false
6357
for wf_name in $(echo "${demux_workflows_to_build}"); do
64-
echo "Building applet ${wf_name}..."
65-
demux_workflow_id=$(grep "^${wf_name}\s" $COMPILE_SUCCESS | cut -f 2)
58+
if grep -q "^${wf_name}\s" $COMPILE_SUCCESS; then
59+
any_demux_compiled=true
60+
fi
61+
done
62+
63+
if [ "$any_demux_compiled" = true ]; then
64+
# build consolidate_run_tarballs (native DNAnexus applet) applet
6665
pushd pipes/dnax/dx-launcher
67-
sed "s/DEFAULT_DEMUX_WORKFLOW_ID/$demux_workflow_id/" demux_launcher.yml \
68-
| sed "s/DEFAULT_DEMUX_WORKFLOW_NAME/${wf_name}_launcher/" \
69-
| sed "s/DEFAULT_CONSOLIDATE_RUN_TARBALLS_APPLET_ID/$consolidate_tarballs_dx_id/" > "${wf_name}_dxapp.yml"
70-
dx_id=$(./dx-yml-build ${wf_name}_dxapp.yml -a --destination /build/$VERSION/ | jq -r ".id")
66+
cp consolidate_run_tarballs.yml consolidate_run_tarballs_dxapp.yml
67+
consolidate_tarballs_dx_id=$(./dx-yml-build consolidate_run_tarballs_dxapp.yml -a --destination /build/$VERSION/ | jq -r ".id")
7168
popd
72-
echo -e "${wf_name}_launcher\t$dx_id" >> $COMPILE_SUCCESS
73-
done
69+
echo -e "consolidate_run_tarballs\t$consolidate_tarballs_dx_id" >> $COMPILE_SUCCESS
70+
71+
for wf_name in $(echo "${demux_workflows_to_build}"); do
72+
demux_workflow_id=$(grep "^${wf_name}\s" $COMPILE_SUCCESS | cut -f 2)
73+
if [ -z "$demux_workflow_id" ]; then
74+
echo "Skipping applet ${wf_name}_launcher (${wf_name} was not compiled)"
75+
continue
76+
fi
77+
echo "Building applet ${wf_name}..."
78+
pushd pipes/dnax/dx-launcher
79+
sed "s/DEFAULT_DEMUX_WORKFLOW_ID/$demux_workflow_id/" demux_launcher.yml \
80+
| sed "s/DEFAULT_DEMUX_WORKFLOW_NAME/${wf_name}_launcher/" \
81+
| sed "s/DEFAULT_CONSOLIDATE_RUN_TARBALLS_APPLET_ID/$consolidate_tarballs_dx_id/" > "${wf_name}_dxapp.yml"
82+
dx_id=$(./dx-yml-build ${wf_name}_dxapp.yml -a --destination /build/$VERSION/ | jq -r ".id")
83+
popd
84+
echo -e "${wf_name}_launcher\t$dx_id" >> $COMPILE_SUCCESS
85+
done
86+
else
87+
echo "Skipping consolidate_run_tarballs and demux launchers (no demux workflows were compiled)"
88+
fi
7489

7590
# the presence of this file in the project denotes successful build
7691
dx upload --brief --no-progress --destination /build/$VERSION/ $COMPILE_SUCCESS

github_actions_ci/install-wdl.sh

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,34 @@ fetch_jar_from_github () {
1212
ln -s $_jar_fname $_tool_name.jar
1313
}
1414

15-
fetch_jar_from_github broadinstitute cromwell womtool 88
16-
fetch_jar_from_github broadinstitute cromwell cromwell 88
17-
fetch_jar_from_github dnanexus dxWDL dxWDL v1.50
18-
fetch_jar_from_github dnanexus dxCompiler dxCompiler 2.11.6
15+
# Cromwell & womtool: pull the latest daily "develop" build from Docker Hub and copy the
16+
# jars out of the image. This is the same artifact Terra runs, so CI tests against what
17+
# Terra actually uses rather than a stale pinned GitHub release (Cromwell no longer cuts
18+
# GitHub releases -- they only publish daily builds to Docker Hub). The daily build
19+
# publishes only Docker images -- no standalone jars are hosted anywhere -- so we
20+
# exfiltrate the jars here rather than running cromwell/womtool inside docker (which would
21+
# break docker-in-docker task execution).
22+
extract_jar_from_docker () {
23+
_image=$1 # e.g. broadinstitute/cromwell:develop
24+
_src=$2 # path inside image, e.g. /app/cromwell.jar
25+
_dest=$3 # output filename in cwd, e.g. cromwell.jar
26+
echo "Pulling $_image to extract $_dest"
27+
docker pull --quiet "$_image"
28+
# --user keeps host file ownership as the runner (not root); cp -L dereferences the
29+
# versioned symlink (docker cp would copy a broken symlink since the jar filename
30+
# embeds a daily-changing git hash); readlink logs the exact build to CI output.
31+
docker run --rm \
32+
--user "$(id -u):$(id -g)" \
33+
-v "$PWD:/out" \
34+
--entrypoint /bin/bash \
35+
"$_image" \
36+
-c "echo -n 'extracted '; readlink -f '$_src'; cp -L '$_src' '/out/$_dest'"
37+
}
38+
39+
extract_jar_from_docker broadinstitute/cromwell:develop /app/cromwell.jar cromwell.jar
40+
extract_jar_from_docker broadinstitute/womtool:develop /app/womtool.jar womtool.jar
41+
42+
fetch_jar_from_github dnanexus dxCompiler dxCompiler 2.15.0
1943

2044
TGZ=dx-toolkit-v0.311.0-ubuntu-20.04-amd64.tar.gz
2145
echo "Fetching $TGZ"

github_actions_ci/tests-dx.sh

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if [ -n "$DX_API_TOKEN" ]; then
1111
dx select $DX_PROJECT
1212
fi
1313

14-
COMPILE_SUCCESS="dxWDL-compile_all-success.txt"
14+
COMPILE_SUCCESS="dxCompiler-compile_all-success.txt"
1515
if [ ! -f $COMPILE_SUCCESS ]; then
1616
dx download --no-progress /build/$VERSION/$COMPILE_SUCCESS
1717
fi
@@ -79,22 +79,25 @@ else
7979
fi
8080

8181
# Special case: run test for the demux_(plus|only)_launcher native applet (which invokes
82-
# the demux_(plus|only) WDL workflow)
83-
demux_launcher_id=$(grep "^${demux_name}_launcher\s" $COMPILE_SUCCESS | cut -f 2)
82+
# the demux_(plus|only) WDL workflow). Skip if the launcher was not built.
83+
demux_launcher_id=$(grep "^${demux_name}_launcher\s" $COMPILE_SUCCESS | cut -f 2 || true)
84+
demux_workflow_id=$(grep "^${demux_name}\s" $COMPILE_SUCCESS | cut -f 2 || true)
8485

85-
demux_workflow_id=$(grep "^${demux_name}\s" $COMPILE_SUCCESS | cut -f 2)
86-
87-
timeout_args=$(dx_run_timeout_args $demux_workflow_id $demux_launcher_id)
88-
dx_job_id=$(dx run "${demux_launcher_id}" \
89-
-y --brief \
90-
-i upload_sentinel_record=record-Bv8qkgQ0jy198GK0QVz2PV8Y \
91-
-i demux_workflow_id=${demux_workflow_id} \
92-
--name "$VERSION ${demux_name}_launcher" \
93-
-i folder=/tests/$VERSION/${demux_name}_launcher \
94-
--extra-args $timeout_args \
95-
)
96-
echo "Launched ${demux_name}_launcher as $dx_job_id"
97-
echo -e "${demux_name}_launcher\t$demux_launcher_id\t$dx_job_id" >> $TEST_LAUNCH_ALL
86+
if [ -n "$demux_launcher_id" -a -n "$demux_workflow_id" ]; then
87+
timeout_args=$(dx_run_timeout_args $demux_workflow_id $demux_launcher_id)
88+
dx_job_id=$(dx run "${demux_launcher_id}" \
89+
-y --brief \
90+
-i upload_sentinel_record=record-Bv8qkgQ0jy198GK0QVz2PV8Y \
91+
-i demux_workflow_id=${demux_workflow_id} \
92+
--name "$VERSION ${demux_name}_launcher" \
93+
-i folder=/tests/$VERSION/${demux_name}_launcher \
94+
--extra-args $timeout_args \
95+
)
96+
echo "Launched ${demux_name}_launcher as $dx_job_id"
97+
echo -e "${demux_name}_launcher\t$demux_launcher_id\t$dx_job_id" >> $TEST_LAUNCH_ALL
98+
else
99+
echo "Skipping ${demux_name}_launcher test (launcher was not built)"
100+
fi
98101

99102
# the presence of this file in the project denotes all tests launched
100103
dx upload --brief --no-progress --destination /build/$VERSION/ $TEST_LAUNCH_ALL

pipes/WDL/tasks/tasks_16S_amplicon.wdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version 1.0
1+
version 1.1
22

33
task qiime_import_from_bam {
44
meta {

pipes/WDL/tasks/tasks_assembly.wdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version 1.0
1+
version 1.1
22

33
task assemble {
44
input {

pipes/WDL/tasks/tasks_demux.wdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version 1.0
1+
version 1.1
22

33
task merge_tarballs {
44
input {

pipes/WDL/tasks/tasks_interhost.wdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version 1.0
1+
version 1.1
22

33
task subsample_by_cases {
44
meta {

pipes/WDL/tasks/tasks_intrahost.wdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version 1.0
1+
version 1.1
22

33
task polyphonia_detect_cross_contamination {
44
input {

pipes/WDL/tasks/tasks_megablast.wdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version 1.0
1+
version 1.1
22

33
task trim_rmdup_subsamp {
44
meta {

pipes/WDL/tasks/tasks_metagenomics.wdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version 1.0
1+
version 1.1
22

33
task krakenuniq {
44
meta {

0 commit comments

Comments
 (0)