Skip to content

Commit

Permalink
Merge pull request #172 from broadinstitute/sn_fix_hard_clone_to_exte…
Browse files Browse the repository at this point in the history
…rnal_bucket

Sn fix hard clone to external bucket
  • Loading branch information
snovod authored Dec 5, 2024
2 parents 1698dc3 + 7776936 commit 0eb4497
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions python/hard_clone_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def run(self) -> None:
file_extensions_to_ignore=self.extensions_to_ignore,
file_name_only=True,
# Ignore log files for this workflow since could be updating as running
file_strings_to_ignore=["/HardCloneTerraWorkspace/"]
file_strings_to_ignore=["/HardCloneTerraWorkspace/", "/HardCloneWithExternalBucket/"]
)

files_to_copy = [
Expand Down Expand Up @@ -200,7 +200,7 @@ def make_bucket_files(src_bucket: str, dest_bucket: str) -> None:
if not external_bucket.startswith("gs://") or not external_bucket.endswith("/"):
raise ValueError("gcp_bucket must start with gs:// and end with /")
# Remove the gs:// prefix and trailing slash to match what is returned by the Terra API
external_bucket = external_bucket.lstrip("gs://").rstrip("/")
external_bucket = external_bucket.replace("gs://", "").rstrip("/")

token = Token(cloud=GCP)
request_util = RunRequest(token=token)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ workflow HardCloneWithExternalBucket {
String source_workspace_name
String dest_billing_project
String dest_workspace_name
String external_bucket
String external_bucket
Boolean allow_already_created
Boolean rsync_workspace
Boolean do_not_update_acls
Expand All @@ -21,7 +21,7 @@ workflow HardCloneWithExternalBucket {

String docker_name = select_first([docker, "us-central1-docker.pkg.dev/operations-portal-427515/ops-toolbox/ops_terra_utils_slim:latest"])
# Ignore HardCloneTerraWorkspace submisisons files so do not write to src as copying to dest
String rysnc_regex_exclude = ".*/HardCloneTerraWorkspace/.*"
String rysnc_regex_exclude = ".*/HardCloneWithExternalBucket/.*"
Int memory = select_first([memory_gb, 8])

call HardCloneWithExternalBucketTask {
Expand All @@ -31,7 +31,7 @@ workflow HardCloneWithExternalBucket {
dest_billing_project=dest_billing_project,
dest_workspace_name=dest_workspace_name,
allow_already_created=allow_already_created,
external_bucket=external_bucket,
external_bucket=external_bucket,
workers=workers,
extensions_to_ignore=extensions_to_ignore,
docker_name=docker_name,
Expand All @@ -58,7 +58,7 @@ task HardCloneWithExternalBucketTask {
String dest_billing_project
String dest_workspace_name
Boolean allow_already_created
String external_bucket
String external_bucket
Int? workers
String? extensions_to_ignore
String docker_name
Expand Down

0 comments on commit 0eb4497

Please sign in to comment.