Read/Write Files to Cloud Storage.

Write and read files in GCS through /workspace/shared.

In Burla, /workspace/shared is like a shared folder that is connected to your Google Cloud Storage bucket.

  • Save a file to /workspace/shared/... and it shows up in your bucket.

  • Read a file from /workspace/shared/... and it is read from your bucket.

Before you run this

  1. Install Burla: pip install burla

  2. Log in: burla login

  3. Start your cluster in the Burla dashboard

Step 1: Write files (saves to GCS)

from pathlib import Path

from burla import remote_parallel_map


def write_text_file(path_and_text):
    file_path, text = path_and_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)

In the Burla dashboard → Filesystem, you should see:

  • /workspace/shared/hello.txt

  • /workspace/shared/goodbye.txt

Put your screenshot here:

Step 2: Read files back (comes from GCS)

You should see a list with the file paths and their text (the words hello and goodbye).

Put your screenshot of the printed output here: