Skip to content

fix: use gsutil for anonymous GCS downloads - #184

Open
indierodo wants to merge 1 commit into
magenta:mainfrom
indierodo:patch-1
Open

indierodo wants to merge 1 commit into
magenta:mainfrom
indierodo:patch-1

Conversation

@indierodo

Copy link
Copy Markdown

Summary

Downloading from GCS failed when running without Google Cloud credentials.

Bug

The notebook was using gcloud storage cp to download the MT3 checkpoints and soundfont:

gcloud storage -q cp --recursive gs://mt3/checkpoints .
gcloud storage -q cp gs://magentadata/soundfonts/SGM-v2.01-Sal-Guit-Bass-V1.3.sf2 .

Although these assets are intended to be downloaded publicly, gcloud storage may attempt to use the active Google Cloud authentication context. This can cause downloads to fail in environments without configured credentials. By default, the notebook does not automatically configure credentials for gcloud.

Fix

Use gsutil and explicitly request anonymous access with -u "":

gsutil -q -u "" cp -r gs://mt3/checkpoints .
gsutil -q -u "" cp gs://magentadata/soundfonts/SGM-v2.01-Sal-Guit-Bass-V1.3.sf2 .

This ensures the downloads do not depend on a user's Google Cloud credentials and use the buckets' public access instead.

Note: I have signed Google's Developer Individual CLA with my email and GitHub user.

Replace gcloud storage with gsutil and explicitly disable project
authentication to allow downloading public checkpoints and soundfont without need to specify Google Cloud credentials.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant