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

Reference disks in GCP Batch [WX-1819] #7502

Merged
merged 15 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: gcpbatch_reference_disk_test_true_option
testFormat: workflowsuccess
backends: [GCPBATCH-Reference-Disk-Localization]

files {
workflow: reference_disk/gcpbatch/reference_disk_test.wdl
inputs: reference_disk/reference_disk_test.inputs
options: reference_disk/reference_disk_test_true.options.json
}

metadata {
workflowName: wf_reference_disk_test
status: Succeeded
"outputs.wf_reference_disk_test.is_broad_input_file_a_valid_symlink": true
"outputs.wf_reference_disk_test.is_nirvana_input_file_a_valid_symlink": true
"outputs.wf_reference_disk_test.is_nirvana_metachar_input_file_a_valid_symlink": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
version 1.0

task check_if_localized_with_valid_symlink {
input {
File broad_reference_file_input
File nirvana_reference_file_input
File nirvana_reference_file_metachar_input
}
String broad_input_valid_symlink = "broad_input_valid_symlink.txt"
String nirvana_input_valid_symlink = "nirvana_input_valid_symlink.txt"
String nirvana_metachar_input_valid_symlink = "nirvana_metachar_input_valid_symlink.txt"
command <<<
PS4='\D{+%F %T} \w $ '
set -o nounset -o pipefail -o xtrace

# Echo true to stdout if the argument is a symlink pointing to an extant file, otherwise echo false.
check_if_valid_symlink() {
local reference_input="$1"

if [[ -h "${reference_input}" && -f $(readlink "${reference_input}") ]]; then
echo true
else
echo false
fi
}

check_if_valid_symlink "~{broad_reference_file_input}" > ~{broad_input_valid_symlink}
check_if_valid_symlink "~{nirvana_reference_file_input}" > ~{nirvana_input_valid_symlink}
check_if_valid_symlink "~{nirvana_reference_file_metachar_input}" > ~{nirvana_metachar_input_valid_symlink}

>>>
output {
Boolean is_broad_input_valid_symlink = read_boolean("~{broad_input_valid_symlink}")
Boolean is_nirvana_input_valid_symlink = read_boolean("~{nirvana_input_valid_symlink}")
Boolean is_nirvana_metachar_input_valid_symlink = read_boolean("~{nirvana_metachar_input_valid_symlink}")
}
runtime {
docker: "ubuntu:latest"
backend: "GCPBATCH-Reference-Disk-Localization"
}
}

workflow wf_reference_disk_test {
input {
File broad_reference_file_input
File nirvana_reference_file_input
File nirvana_reference_file_metachar_input
}
call check_if_localized_with_valid_symlink {
input:
broad_reference_file_input = broad_reference_file_input,
nirvana_reference_file_input = nirvana_reference_file_input,
nirvana_reference_file_metachar_input = nirvana_reference_file_metachar_input
}
output {
Boolean is_broad_input_file_a_valid_symlink = check_if_localized_with_valid_symlink.is_broad_input_valid_symlink
Boolean is_nirvana_input_file_a_valid_symlink = check_if_localized_with_valid_symlink.is_nirvana_input_valid_symlink
Boolean is_nirvana_metachar_input_file_a_valid_symlink = check_if_localized_with_valid_symlink.is_nirvana_metachar_input_valid_symlink
}
}
6 changes: 6 additions & 0 deletions src/ci/resources/gcp_batch_application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@ backend {
include "gcp_batch_provider_config.inc.conf"
}
}
GCPBATCH-Reference-Disk-Localization {
actor-factory = "cromwell.backend.google.batch.GcpBatchBackendLifecycleActorFactory"
config {
include "gcp_batch_provider_config.inc.conf"
}
}
}
}
20 changes: 19 additions & 1 deletion src/ci/resources/gcp_batch_shared_application.inc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services {

backend {
default = "GCPBATCH"
enabled = ["GCPBATCH"]
enabled = ["GCPBATCH", "GCPBATCH-Reference-Disk-Localization"]
providers {
# Default gcp batch backend
GCPBATCH {
Expand All @@ -30,5 +30,23 @@ backend {
filesystems.http {}
}
}
GCPBATCH-Reference-Disk-Localization {
actor-factory = "cromwell.backend.google.batch.GcpBatchBackendLifecycleActorFactory"
config {
# When importing: Remember to also include an appropriate provider_config.inc.conf here.

# TODO: Should not need because already included. testing.
include "gcp_batch_provider_config.inc.conf"

include "dockerhub_provider_config_v2.inc.conf"
# This SA does not have permission to bill this project when accessing RP buckets.
# This is on purpose so that we can assert the failure (see requester_pays_localization_negative)
batch.compute-service-account = "centaur@broad-dsde-cromwell-dev.iam.gserviceaccount.com"
filesystems.http {}

# Cromwell 57+ reference disk manifest specification included here.
include "papi_v2_reference_image_manifest.conf"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we'll want to rename this manifest file once we have things working

}
}
}
}
Loading