Skip to content
Merged
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion scripts/generic_https_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
help='Use filenames defined before each url',
)
@click.option('--presigned-url-file-path')
def main(presigned_url_file_path: str, filenames: bool):
@click.option('--non-preemptible-vm', is_flag=True, default=False, help='Use preemptible VMs')
def main(presigned_url_file_path: str, filenames: bool, non_preemptible_vm: bool):
"""
Given a list of presigned URLs, download the files and upload them to GCS.
If each signed url is prefixed by a filename and a space, use the --filenames flag
Expand Down Expand Up @@ -65,6 +66,7 @@ def main(presigned_url_file_path: str, filenames: bool):
for idx, url in enumerate(presigned_urls):
filename = names[idx] if names else os.path.basename(url).split('?')[0]
j = batch.new_job(f'URL {idx} ({filename})')
j.spot(is_spot=non_preemptible_vm)
Copy link
Contributor

Choose a reason for hiding this comment

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

“Spot” means the same as “preemptible”… so with the variable being true for a non-preemptible VM this would need to be is_spot=not non_preemptible_vm.

quoted_url = quote(url)
authenticate_cloud_credentials_in_job(job=j)
# catch errors during the cURL
Expand Down
Loading