-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dx-launcher: run consolidate_run_tarballs as a separate top-level job (…
…#858) * wip * wip * wip * wip * wip * wip * wip * place consolidated output within "runs" subdir of main run directory to be consistent with prior demux workflow output, place consolidated tarball within "runs" subdir of main run directory
- Loading branch information
Showing
3 changed files
with
69 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# DNAnexus applet to build with dx-yml-build which can be found here: | ||
# https://gist.githubusercontent.com/mlin/3cce81f54a640c3f62a2725acbc98283/raw/e071dfe1989c31f6267334106115620770e6d21c/dx-yml-build | ||
# To build, save this file as dxapp.yml and run that script alongside. | ||
name: consolidate_run_tarballs | ||
title: consolidate_run_tarballs | ||
dxapi: 1.0.0 | ||
version: 0.0.1 | ||
description: Launches demux/demux-plus workflow on each lane of a sequencing run, given the incremental uploader sentinel record. | ||
inputSpec: | ||
- name: upload_sentinel_record | ||
class: record | ||
type: "UploadSentinel" | ||
help: Sentinel record from incremental upload tool. The RunInfo.xml and run tarballs must also reside in the current project. | ||
- name: run_id | ||
class: string | ||
help: Run ID for use in folder and file names | ||
outputSpec: | ||
- name: consolidated_run_tarball | ||
class: file | ||
access: | ||
network: ["*"] | ||
runSpec: | ||
systemRequirements: | ||
main: | ||
instanceType: mem1_ssd1_x2 | ||
distribution: Ubuntu | ||
release: "16.04" | ||
execDepends: | ||
- name: pigz | ||
interpreter: bash | ||
code: | | ||
#!/bin/bash | ||
main() { | ||
set -ex -o pipefail | ||
# sequentially unpack the run tarballs | ||
dx get_details "$upload_sentinel_record" | jq -r .tar_file_ids[] > tar_file_ids | ||
mkdir run/ | ||
while read tar_file_id; do | ||
dx cat "$tar_file_id" | pigz -dc | tar xf - -C run/ --owner root --group root --no-same-owner | ||
done < tar_file_ids | ||
du -sh run/ | ||
# tar the consolidated directory and upload | ||
# TODO: consider zstd/lz4 | ||
dx mkdir -p "$run_id/runs" | ||
tar_id=$(tar c -C run/ . | pigz -c | dx upload --brief -p --destination $(printf "%s/runs/%s.tar.gz" "$run_id" "$run_id") -) | ||
dx-jobutil-add-output consolidated_run_tarball "$tar_id" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters