简体   繁体   中英

How to serve previously created Jupyter Notebook on Google Cloud Platform

I have a previously created jupyter notebook that I'd like to run on the Google Cloud Platform.

I currently have a notebook instance running on a GCP VM and it works fine. I was also able to create a storage bucket and upload all dataset and notebook files to the bucket. However, these files don't show up in the Jupyter Notebook directory tree. I know I can access the dataset files using something like...

client = storage.Client()
bucket = client.getbucket('name-of-bucket')
blob = storage.Blob( 'diretory/to/files', bucket )
fid = BytesIO(blob.downloadas_string())

But I'm not sure how to actually serve up a notebook file to use, and I really don't feel like copying and pasting all my previous work.

All help appreciated!

Very simple. You can upload directly from within the Jupyter Notebook and bypass the bucket if desired (the icon with the up arrow).

Jupyter Notebook upload icon image

The only issue with this is you can't upload folders, so zip the folder first then upload it.

You can use Jupyter Lab's git extension to host your Notebooks in GitHub and pull them from there.

Fyi, if you use GCP's AI Platform Notebooks you'll get a pre-configured Jupyter environment with many ML/DL libraries pre-installed. That git extension will be pre-installed as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM