David Im
06/21/2024, 12:08 AMbentoml build --containerize is a combination of bentoml build and bentoml containerize
So I was expecting to use all the options for bentoml containerize commands like (--platform, -t) following bentoml build --containerize, but apparently that's not supported?
Please let me know if there is a way to do this!Michael Aydinbas
06/21/2024, 6:09 AMMichael Aydinbas
06/21/2024, 6:10 AMbentoml build --version $(TAG) && \
bentoml containerize --opt platform=linux/amd64 ${MODEL_NAME}:${TAG}David Im
06/21/2024, 4:59 PMDavid Im
06/21/2024, 7:20 PMDavid Im
06/21/2024, 7:42 PMdocker build command after bentoml build instead of using bentoml containerize?
I'm asking this because in my gitlab ci.yml script, I need to build bentoml first under a python image, and I need to perform containerization + docker push under a docker image. They are two different stages.
If I can only perform containerization (docker build) using bentoml containerize command, I can't separate these into two stages which use independent images. Instead I need to download python under the docker image, which is not ideal.Jian Shen Yap
06/24/2024, 4:16 AMJian Shen Yap
06/24/2024, 6:13 AMDavid Im
06/25/2024, 1:25 AMbentoml containerize , which doesn't change the fact that this command is still require both "Python" and "Docker" image to run in a cloud build.
So my pain point is that, my gcp cloud build script can have one image at a time, but this bentoml containerize requires docker image in the background when bentoml itself requires a python image. So it needs two images at the same time. Please let me know if there is a way to dissect the bentoml containerize command so that I can run docker build command separately.
Or is there a different way that I can resolve this issue? Please let me know!Jian Shen Yap
06/25/2024, 1:30 AMDavid Im
06/25/2024, 3:36 AMsteps:
- name: "gcr.io/cloud-builders/docker"
args:
[
"run",
"--rm",
"-v",
"/workspace:/workspace",
"python:3.11",
"bash",
"-c",
"cd /workspace && pip install -r requirements.txt && pip install -e . && bentoml build && bentoml containerize $SERVICE_NAME:latest --platform linux/amd64 -t gcr.io/$PROJECT_ID/$REGISTRY_NAME:$TAG_NAME",
]
And I'm facing issues when I'm running bentoml containerize I'm getting the following error.
Step #0: WARNING: Docker not found. Make sure it is installed and in your PATH. See <https://docs.docker.com/get-docker/>
Step #0: WARNING: Docker not found. Make sure it is installed and in your PATH. See <https://docs.docker.com/get-docker/>
Step #0: Error: [bentoml-cli] `containerize` failed: Backend docker is not healthy.David Im
06/25/2024, 3:41 AM"<http://gcr.io/cloud-builders/docker|gcr.io/cloud-builders/docker>". Do you see the challenges here? I'm not sure if there are some params that I could use with bentoml containerize to fix this issue.Jian Shen Yap
06/25/2024, 5:57 AMStep #0: Error: [bentoml-cli] `containerize` failed: Backend docker is not healthy.
there is no docker daemon inside a container already. For cases like this, you can either use a dind (docker in docker) image,
OR
using the dockerfile that is generated by bentoml build in your Cloud Build.
I would suggest the latter.
You can access the Bento built by bentoml build by doing bentoml get <bentoml tag> -o path . inside you should be able to find a generated Dockerfile that is being used by the bentoml containerize command!David Im
06/25/2024, 4:40 PM