要想在Google Cloud Console里创建和使用Jupyter,现在博主就将步骤写下来,供各位参考,如果有什么不对的,就请指出来!(Google Cloud Console上的命令和界面会有变化)
-
在Google Cloud Console,选择已有的Google Cloud Project,或者创建新的Google Cloud Project.
点击"NEW PROJECT",就可以创建新的Google Cloud Project.
-
确保Google Cloud Project有billing account. Google Cloud Console有给$300的credit来使用,前提是得有信用卡!
-
Enable the AI Platform Notebooks API. 页面如下:
-
创建新的default notebook instance.
[4.1] 前往AI Platform Notebooks 页面
[4.2] 点击“NEW INSTANCE”,选择instance type, 选择是否需要包括GPU
[4.3] 如果你选择需要GPU,你必须得选择Install NVIDIA GPU driver automatically for me. 你可以更改GPUs的数量。
[4.4] 最后点击“CREATE”
[4.5] AI Platform Notebooks 基于你的选择而创建一个新的instances.
-
创建一个自定义的AI Platform Notebooks instance
[5.1] 点击"NEW INSTANCE",之后选择Customize instance
[5.2] 在创建New notebook instance 页面,有提供了几个信息: -
Instance name: 提供一个名字给你的新的instance
-
Region: 选择一个region给你的新的instance。选择一个离你在地里位置很近的region,这样能带来很好的performance
-
Zone: 选择一个zone在你的region里
-
Environment: 选择一个你想要的environment 和操作系统
-
Machine Type: 选择一个有多少数量的CPU和多少数量的RAM给你的新的instance。AI Platform Notebooks基于你所选择Machine type来进行收费
-
GPUs: 选择GPU type和GPU的数量给你的新的instance。选择Install NVIDIA GPU driver automatically for me。你未来也可以更改GPU的类型和数量。
[5.3] 如果你想改变default boot disk,你就在Disk(s) section选择Boot disk type和Boot disk size in GB, 来设置你想要的
[5.4] 如果你想改变encryption的设置, 就可以选择Customer-managed encryption keys (CMEK).
[5.5] 如果你想改变network 的设置,就得做以下步骤:
- 进入Networking section
- 选择任何一个Networks in this project还是Networks shared with me.
- 在Network menu里,选择一个你想要的network. 你可以选择VPC network, 只要这个network有Private Google Access 被enabled或者可以使用internet.
- 在Subnetwork menu里,选择你想要的subnetwork
- 如果你想disable the external IP address, 设置External IP menu为None
- 如果你想disable proxy access, 就clear the checkbox next to Allow proxy access when it’s available.
[5.6] 如果你想让所有的users有权限使用具体的Compute Engine service account或者具体的user,那就进入Permission section和完成任何一个以下的步骤: - 为了使用具体的某一个服务账号,点击Access to JupyterLab menu, 和选择Other service account. 接着在Service account field里填写。
- 为了只给一个user的权限,点击Access to JupyterLab menu, 和选择Single user only。接着在User email field里填写就行。
[5.7] 点击Create按钮
[5.8] 基于你所选择属性, AI Platform Notebooks 创建一个新的instance。
如果想用command line来创建,也可以,下面就展示如何用command line来创建instance.
得先在GCP页面上,点击这个图标才能进入Cloud Shell
- Enable the Notebooks API
命令:gcloud services enable notebooks.googleapis.com
- 创建instance:
命令:
类似下面的截图:
3. 在AI Platform Notebooks就可以看到创建好的instance
4. 点击OPEN JUPYTERLAB,就能进入到Jupyter页面了
5. 当不使用Jupyter,必须删除instance,不然就会一直扣钱。
命令如下:
gcloud beta notebooks instances delete bq-jupyter-instance
–location LOCATION
像下面的截图一样
也可以在页面上进行删除:
如果觉得哪里写的不对,就麻烦指出来。或者如果觉得写的不错,就给个点赞或者五星好评吧或者关注博主吧~~
谢谢各位~