Slackbot
11/04/2022, 1:20 PMSusana Bouchardet
11/04/2022, 1:23 PMbentoml@rec-model-sknn-b6b9fdf9b-hkq9p:~/bento$ cat $BENTOML_CONFIG
api_server:
workers: 1
timeout: 3
logging:
access:
enabled: False
runners:
logging:
access:
enabled: FalseSusana Bouchardet
11/04/2022, 2:55 PMTim Liu
11/04/2022, 2:58 PMTim Liu
11/04/2022, 2:58 PMSusana Bouchardet
11/04/2022, 2:59 PMTim Liu
11/04/2022, 3:00 PMSusana Bouchardet
11/04/2022, 3:00 PMTim Liu
11/04/2022, 3:00 PMTim Liu
11/04/2022, 3:01 PMdocker run -v /local/path/configuration.yml:/home/bentoml/configuration.yml -e BENTOML_CONFIG=/home/bentoml/configuration.ymlSusana Bouchardet
11/04/2022, 3:01 PMTim Liu
11/04/2022, 3:02 PMTim Liu
11/04/2022, 3:02 PMSusana Bouchardet
11/04/2022, 3:05 PM12:02 $ kubectlr get configmap bento-server-config -o yaml
apiVersion: v1
data:
configuration.yaml: |
api_server:
workers: 1
timeout: 1
logging:
access:
enabled: False
runners:
logging:
access:
enabled: False
And using it in the pod like this (here some parts of the pod yaml).
The env var definition:
spec:
containers:
- name: rec-model-sknn
image: $IMAGE_TAG
env:
- name: BENTOML_CONFIG
value: /var/config/configuration.yaml
The config map usage:
volumeMounts:
- name: bento-config
mountPath: /var/config
readOnly: true
volumes:
- name: bento-config
configMap:
name: bento-server-configSusana Bouchardet
11/04/2022, 3:06 PMSusana Bouchardet
11/04/2022, 3:06 PMbentoml = "1.0.3"Susana Bouchardet
11/04/2022, 3:33 PM✔ ~/Workspace/rec-sknn-pipeline [main|…4]
12:31 $ cat $PWD/config.yaml
api_server:
workers: 1
timeout: 3
logging:
access:
enabled: False
runners:
logging:
access:
enabled: False
✔ ~/Workspace/rec-sknn-pipeline [main|…4]
12:32 $ docker run -v $PWD/config.yaml:/home/bentoml/configuration.yml -e BENTOML_CONFIG=/home/bentoml/configuration.yml -p 3000:3000 local-test
2022-11-04T15:32:13+0000 [INFO] [cli] Service loaded from Bento directory: bentoml.Service(tag="sknn_svc:hzrexns4ko44ykkb", path="/home/bentoml/bento/")
2022-11-04T15:32:13+0000 [INFO] [cli] Starting production BentoServer from "/home/bentoml/bento" running on <http://0.0.0.0:3000> (Press CTRL+C to quit)
2022-11-04T15:32:15+0000 [INFO] [runner:sknn:1] Service loaded from Bento directory: bentoml.Service(tag="sknn_svc:hzrexns4ko44ykkb", path="/home/bentoml/bento/")
2022-11-04T15:32:15+0000 [INFO] [api_server:4] Service loaded from Bento directory: bentoml.Service(tag="sknn_svc:hzrexns4ko44ykkb", path="/home/bentoml/bento/")
2022-11-04T15:32:15+0000 [INFO] [api_server:1] Service loaded from Bento directory: bentoml.Service(tag="sknn_svc:hzrexns4ko44ykkb", path="/home/bentoml/bento/")
2022-11-04T15:32:15+0000 [INFO] [runner:sknn:1] Setting up worker: set CPU thread count to 8
2022-11-04T15:32:15+0000 [INFO] [api_server:3] Service loaded from Bento directory: bentoml.Service(tag="sknn_svc:hzrexns4ko44ykkb", path="/home/bentoml/bento/")
2022-11-04T15:32:15+0000 [INFO] [api_server:8] Service loaded from Bento directory: bentoml.Service(tag="sknn_svc:hzrexns4ko44ykkb", path="/home/bentoml/bento/")
2022-11-04T15:32:15+0000 [INFO] [api_server:6] Service loaded from Bento directory: bentoml.Service(tag="sknn_svc:hzrexns4ko44ykkb", path="/home/bentoml/bento/")
2022-11-04T15:32:15+0000 [INFO] [api_server:5] Service loaded from Bento directory: bentoml.Service(tag="sknn_svc:hzrexns4ko44ykkb", path="/home/bentoml/bento/")
2022-11-04T15:32:15+0000 [INFO] [api_server:2] Service loaded from Bento directory: bentoml.Service(tag="sknn_svc:hzrexns4ko44ykkb", path="/home/bentoml/bento/")
2022-11-04T15:32:15+0000 [INFO] [api_server:7] Service loaded from Bento directory: bentoml.Service(tag="sknn_svc:hzrexns4ko44ykkb", path="/home/bentoml/bento/")Tim Liu
11/04/2022, 3:41 PMTim Liu
11/04/2022, 3:43 PMexport BENTOML_CONFIG=config.yaml
bentoml serve --production --verboseSusana Bouchardet
11/04/2022, 3:48 PMTim Liu
11/04/2022, 3:50 PMSusana Bouchardet
11/04/2022, 4:07 PMSusana Bouchardet
11/04/2022, 4:45 PM✔ ~/Workspace/rec-sknn-pipeline [main|✚ 2…5]
13:43 $ docker run -v $PWD/config.yaml:/home/bentoml/configuration.yml -e BENTOML_CONFIG=/home/bentoml/configuration.yml -p 3000:3000 local-test
2022-11-04T16:43:41+0000 [INFO] [cli] Service loaded from Bento directory: bentoml.Service(tag="sknn_svc:266p73s4l244ykkb", path="/home/bentoml/bento/")
2022-11-04T16:43:41+0000 [INFO] [cli] Environ for worker 0: set CPU thread count to 8
2022-11-04T16:43:41+0000 [INFO] [cli] Prometheus metrics for HTTP BentoServer from "/home/bentoml/bento" can be accessed at <http://localhost:3000/metrics>.
2022-11-04T16:43:42+0000 [INFO] [cli] Starting production HTTP BentoServer from "/home/bentoml/bento" listening on <http://0.0.0.0:3000> (Press CTRL+C to quit)
2022-11-04T16:43:43+0000 [INFO] [runner:sknn:1] Service loaded from Bento directory: bentoml.Service(tag="sknn_svc:266p73s4l244ykkb", path="/home/bentoml/bento/")
2022-11-04T16:43:43+0000 [INFO] [api_server:1] Service loaded from Bento directory: bentoml.Service(tag="sknn_svc:266p73s4l244ykkb", path="/home/bentoml/bento/")
It isn't spawning other workers. only the api_server:1Susana Bouchardet
11/04/2022, 4:46 PMSusana Bouchardet
11/04/2022, 4:48 PMSusana Bouchardet
11/04/2022, 5:09 PM