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

allow docker image pinning to be skipped with #skip-global-version-pin annotation #493

Merged
merged 1 commit into from
Oct 17, 2023
Merged
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
2 changes: 1 addition & 1 deletion github_actions_ci/check-wdl-runtimes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ for task_file in $(ls -1 pipes/WDL/tasks/*.wdl); do
OLD_TAG=$module
NEW_TAG="$module:$version"

offending_lines="$(grep -nE "^[^#]*$OLD_TAG" "${task_file}" | grep -v $NEW_TAG)"
offending_lines="$(grep -nE "^[^#]*$OLD_TAG" "${task_file}" | grep -v '#skip-global-version-pin' | grep -v $NEW_TAG)"

# if the expected tag is not seen, let us know the file and exit
if [ $? -eq 0 ]; then
Expand Down
16 changes: 12 additions & 4 deletions github_actions_ci/version-wdl-runtimes.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
#!/bin/bash

# use sed to replace version strings of docker images based on versions defined in txt file

#
# skip this replacement for any version string line with the comment "#skip-global-version-pin"
#
# requires $MODULE_VERSIONS to be set to point to a text file with equal-sign-separated values
# export MODULE_VERSIONS="./requirements-modules.txt" && ./github_actions_ci/check-wdl-runtimes.sh

printf "Updating docker image tags in WDL files with those in ${MODULE_VERSIONS}\n\n"

while IFS='=' read module version; do
OLD_TAG=$module
NEW_TAG="$module:$version"
echo Replacing $OLD_TAG with $NEW_TAG in all task WDL files
sed -i '' "s|$OLD_TAG[^\"\']*|$NEW_TAG|g" pipes/WDL/tasks/*.wdl
done < $MODULE_VERSIONS
NEW_TAG_BOLD="$module:$(tput bold)$version$(tput sgr0)"
printf "Replacing: %-14s \n with tag: %-14s \n\n" "$OLD_TAG" "$NEW_TAG_BOLD"

sed -i '' "/^\(.*\)[[:space:]]*#skip-global-version-pin[[:space:]]*$/!s|$OLD_TAG[^\"\']*|$NEW_TAG|g" pipes/WDL/tasks/*.wdl
done < $MODULE_VERSIONS

printf "Replacements skipped for lines marked with '#skip-global-version-pin' \n\n"
4 changes: 2 additions & 2 deletions pipes/WDL/tasks/tasks_metagenomics.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ task krakenuniq {
File krona_taxonomy_db_tgz # taxonomy.tab

Int? machine_mem_gb
String docker = "quay.io/broadinstitute/viral-classify:2.1.33.0"
String docker = "quay.io/broadinstitute/viral-classify:2.1.33.0" #skip-global-version-pin
}

Int disk_size = 750
Expand Down Expand Up @@ -143,7 +143,7 @@ task build_krakenuniq_db {
Int? zstd_compression_level

Int? machine_mem_gb
String docker = "quay.io/broadinstitute/viral-classify:2.1.33.0"
String docker = "quay.io/broadinstitute/viral-classify:2.1.33.0" #skip-global-version-pin
}

Int disk_size = 750
Expand Down
3 changes: 2 additions & 1 deletion pipes/WDL/tasks/tasks_nextstrain.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,8 @@ task filter_sequences_to_list {
Array[File]? keep_list

String out_fname = sub(sub(basename(sequences, ".zst"), ".vcf", ".filtered.vcf"), ".fasta$", ".filtered.fasta")
String docker = "quay.io/broadinstitute/viral-core:2.1.33" # "nextstrain/base:build-20211012T204409Z"
# Prior docker image: "nextstrain/base:build-20211012T204409Z"
String docker = "quay.io/broadinstitute/viral-core:2.1.33"
Int disk_size = 750
}
parameter_meta {
Expand Down
Loading