从GCP Vertex AI Workbench中的托管笔记本电池构建运行!docker
我正在尝试在Google Cloud Platform容器注册表上推出Docker Image,以直接在笔记本中定义自定义培训工作。
在准备了正确的Dockerfile和URI之后,在哪里推动包含我的火车的图像。Py脚本后,我尝试将图像直接推在笔记本单元中。
我尝试执行的确切命令是:!docker build ./ -t $ image_uri ,其中image_uri是先前定义的环境变量。但是,我尝试运行此命令,我会收到错误:
/bin/bash:docker:找不到命令
。我还尝试使用魔术单元%% bash执行它,导入子过程库,并执行存储在.sh文件中的命令。
不幸的是,上述解决方案都没有用,它们都返回与Code 127一起返回相同的命令错误。
相反,如果我从Jupyterlab中的bash运行命令,则可以按预期运行正常。
是否有任何解决方法可以在Jupyter笔记本中执行推动?我试图将整个自定义培训过程保留在同一笔记本中。
I am trying to push a docker image on Google Cloud Platform container registry to define a custom training job directly inside a notebook.
After having prepared the correct Dockerfile and the URI where to push the image that contains my train.py script, I try to push the image directly in a notebook cell.
The exact command I try to execute is: !docker build ./ -t $IMAGE_URI
, where IMAGE_URI is the environmental variable previously defined. However I try to run this command I get the error: /bin/bash: docker: command not found
. I also tried to execute it with the magic cell %%bash, importing the subprocess library and also execute the command stored in a .sh file.
Unfortunately none of the above solutions work, they all return the same command not found error with code 127.
If instead I run the command from a bash present in the Jupyterlab it works fine as expected.
Is there any workaround to make the push execute inside the jupyter notebook? I was trying to keep the whole custom training process inside the same notebook.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您关注此指南从Vertex AI Workbench创建一个用户管理的笔记本,然后选择Python 3,然后随附Docker。
因此,您将能够使用docker命令,例如
! docker build。
在用户管理的笔记本中。例子:

If you follow this guide to create a user-managed notebook from Vertex AI workbench and select Python 3, then it comes with Docker available.
So you will be able to use Docker commands such as
! docker build .
inside the user-managed notebook.Example:
