jiewpeng
07/25/2024, 5:11 AMservices:
bento:
build:
context: iris-clf
dockerfile: env/docker/Dockerfile
ports:
- "3000:3000"
read_only: true
volumes:
- ./tempdir/bentos:/home/bentoml/bentos
- ./tempdir/models:/home/bentoml/models
- ./tempdir/envs:/home/bentoml/envs
- ./tempdir/tmp:/home/bentoml/tmp
- ./tempdir/.cache:/home/bentoml/.cache
- ./tempdir/tmp:/tmp
The above volume mounts are the ones that are required in bentoml 1.2. However, for bentos built with bentoml 1.3, the above volume mount is not sufficient. The bento starts normally if I set read_only to false.Jian Shen Yap
07/25/2024, 5:28 AMFrost Ming
07/25/2024, 6:50 AM/home/bentoml/task_result.db is a fileFrost Ming
07/25/2024, 6:50 AMjiewpeng
07/25/2024, 7:22 AM/home/bentoml/models and /home/bentoml/src , so if i mount emptydir into /home/bentoml, my models that are saved inside the bento will not be there. Not sure if i can specify a different directory to save the models to.jiewpeng
07/25/2024, 7:35 AMBENTOML_RESULT_STORE there, the problem is slightly different - the bento server will not repeatedly restart, but <http://localhost:3000> returns Internal Server Error, but the bento's logs do not show any error.
services:
bento:
build:
context: iris-clf
dockerfile: env/docker/Dockerfile
ports:
- "3000:3000"
read_only: true
environment:
- BENTOML_RESULT_STORE=/home/bentoml/result-store/task_result.db
volumes:
- ./tempdir/bentos:/home/bentoml/bentos
- ./tempdir/models:/home/bentoml/models
- ./tempdir/envs:/home/bentoml/envs
- ./tempdir/tmp:/home/bentoml/tmp
- ./tempdir/.cache:/home/bentoml/.cache
- ./tempdir/tmp:/tmp
- ./tempdir/result-store:/home/bentoml/result-storeFrost Ming
07/25/2024, 9:01 AMFrost Ming
07/25/2024, 9:02 AMjiewpeng
07/25/2024, 9:10 AMrw
services:
bento:
build:
context: iris-clf
dockerfile: env/docker/Dockerfile
ports:
- "3000:3000"
read_only: true
environment:
- BENTOML_RESULT_STORE=/home/bentoml/bentoml-result-store/task_result.db
volumes:
- ./tempdir/bentos:/home/bentoml/bentos
- ./tempdir/models:/home/bentoml/models
- ./tempdir/envs:/home/bentoml/envs
- ./tempdir/tmp:/home/bentoml/tmp
- ./tempdir/.cache:/home/bentoml/.cache
- ./tempdir/prometheus_multiproc_dir:/home/bentoml/prometheus_multiproc_dir
- ./tempdir/tmp:/tmp
- ./tempdir/result-store:/home/bentoml/bentoml-result-store:rwjiewpeng
07/26/2024, 1:24 AMBENTOML_RESULT_STORE to be inside that directory works in my production environment (k8s cluster)
Thanks for the help!