从GCP Vertex AI Workbench中的托管笔记本电池构建运行!docker

发布于 2025-01-24 16:59:48 字数 515 浏览 3 评论 0原文

我正在尝试在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执妄 2025-01-31 16:59:48

如果您关注此指南从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:
Vertex AI Managed Notebook

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文