Yatai icon indicating copy to clipboard operation
Yatai copied to clipboard

feature request: Allow user to set env vars or build arguments for building bentos

Open yubozhao opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

BentoML builds supports extra_index_urls as an option, and will automatically discover username/password credentials by using pip-tools

This will break when Yatai starts build image after user pushed the bento to it.

Current workaround

User have to build a custom docker image with the credential as base_image for the bento build

# CUSTOM_DOCKER_BASE
FROM bentoml/bento-server:1.0.0a5-python3.9-debian-cudnn
ARG USERNAME
ARG PASSWORD
ENV PIP_EXTRA_INDEX_URL="https://$USERNAME:$PASSWORD@my_pypi_index.com"

And then build & push the image, and use it in the bento file

# bentofile.yaml
service: "service.py:svc"
docker:
  - base_image: MY_CUSTOM_DOCKER_BASE

This workaround expose the credentials

Additional context

Slack conversation: https://bentoml.slack.com/archives/CKRANBHPH/p1646170324854479

yubozhao avatar Mar 02 '22 23:03 yubozhao

Set this as part of org level config

yubozhao avatar Mar 03 '22 04:03 yubozhao

Set this as part of org level config

why not bento repo level?

parano avatar Mar 03 '22 09:03 parano

what is the status of this?

I do see the option to define environment variables in the building part of Yatai, but I see no ways of adding a build arg.

giacomov avatar Oct 11 '22 18:10 giacomov