Read/Write Files to Cloud Storage.
Write and read files in GCS through /workspace/shared.
Before you run this
Step 1: Write files (saves to GCS)
from pathlib import Path
from burla import remote_parallel_map
def write_text_file(file_path, text):
Path(file_path).write_text(text)
return file_path
files_to_write = [
("/workspace/shared/hello.txt", "hello\n"),
("/workspace/shared/goodbye.txt", "goodbye\n"),
]
remote_parallel_map(write_text_file, files_to_write)