Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add task for terra backend env exploration #495

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ workflows:
primaryDescriptorPath: /pipes/WDL/workflows/downsample.wdl
testParameterFiles:
- empty.json
- name: dump_gcloud_env_info
subclass: WDL
primaryDescriptorPath: /pipes/WDL/workflows/dump_gcloud_env_info.wdl
testParameterFiles:
- empty.json
- name: fastq_to_ubam
subclass: WDL
primaryDescriptorPath: /pipes/WDL/workflows/fastq_to_ubam.wdl
Expand Down
40 changes: 40 additions & 0 deletions pipes/WDL/tasks/tasks_terra.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,46 @@ task gcs_copy {
}
}

task get_gcloud_env_info {
input {
String? additional_command_to_run
}
meta {
description: "task for inspection of backend env, and optionally running a command"
}
parameter_meta {
additional_command_to_run: {
description: "Command that can optionally be included and executed as part of this task"
}
}
command {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
command {
command <<<

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably need to switch syntax?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we standardizing toward <<< to discourage WDL interpolation of${}?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes there's definitely a number of bashisms that simply won't work with the older WDL syntax

set -ex

touch additional_command_stdout.log

if [ -n "~{default='' additional_command_to_run}" ]; then
~{default='echo ""' additional_command_to_run} | tee -a additional_command_stdout.log
fi

env | tee -a env_info.log

gcloud config list | tee -a gcloud_config_info.log

gcloud info | tee -a gcloud_env_info.log

}
output {
Array[String] env_info_files = glob("./*_info.log")
File additional_command_stdout = "additional_command_stdout.log"
}
runtime {
docker: "quay.io/broadinstitute/viral-baseimage:0.1.20"
memory: "1 GB"
cpu: 1
maxRetries: 1
}
}

task upload_reads_assemblies_entities_tsv {
input {
String workspace_name
Expand Down
20 changes: 20 additions & 0 deletions pipes/WDL/workflows/dump_gcloud_env_info.wdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version 1.0

#DX_SKIP_WORKFLOW

import "../tasks/tasks_terra.wdl" as terra

workflow dump_gcloud_env_info {
meta {
description: "Write system and gcloud environment info to output files."
author: "Broad Viral Genomics"
email: "[email protected]"
}

call terra.get_gcloud_env_info

output {
Array[String] gcloud_env_info_files = get_gcloud_env_info.env_info_files
File additional_command_stdout = get_gcloud_env_info.additional_command_stdout
}
}
Loading