Kevin Choi
Kevin Choi

Reputation: 765

Running a Python Script from Google Storage Bucket in terminal

Hello I am trying to run a python code in my google storage bucket through a terminal, but I have no clue what I am doing right now.

I connected ssh to my VM like below: screenshot of my terminal

To run create_pretraining_data.py code which is located under the bert folder, I've tried

python3 create_pretraining_data.py --input_file ...

python3 gs://bucket-hosrevbert-1/bert/create_pretraining_data.py --input_file ...

but those all return No such file or directory

I think I'm just missing one simple point, but I am not sure what would be.

Can you guys please give me some advice? Thanks in advance!

Upvotes: 1

Views: 962

Answers (1)

guillaume blaquiere
guillaume blaquiere

Reputation: 75705

You can use gcsfuse for that. Mount your bucket in a directory

gcsfuse bucket-hosrevbert-1 /path/to/mount/

And then run your script

python3 /path/to/mount/bert/create_pretraining_data.py --....

Upvotes: 1

Related Questions