Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

fix: use user-template to generate dockerfile #40

Merged
merged 10 commits into from
Jun 10, 2022

Conversation

jjmachan
Copy link
Contributor

No description provided.

@jjmachan jjmachan requested a review from aarnphm May 31, 2022 22:07
)
)
# Make docker file with user template
docker_options_for_lambda = DockerOptions(dockerfile_template=BENTOML_USER_TEMPLATE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to use amazonlinux here, and also set a python version for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazonlinux is not a requirement actually but we should pin the python version. we can use the same one from the bento

@@ -3,7 +3,10 @@
{% block SETUP_BENTO_ENTRYPOINT %}
EXPOSE 3000

RUN --mount=type=cache,mode=0777,target=/root/.cache/pip pip install awslambdaric==2.0.0 mangum==0.12.3
RUN --mount=type=cache,mode=0777,target=/root/.cache/pip \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how would we start a bento again? since you are overwritting ENTRYPOINT

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the CMD command is configured my the terraform template but I'll put it back here since that is less confusing

# Make docker file with user template
docker_options_for_lambda = DockerOptions(dockerfile_template=BENTOML_USER_TEMPLATE)
dockerfile_generated = generate_dockerfile(
docker_options_for_lambda.with_defaults(), use_conda=False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this going to use the python version on the bentoctl build machine instead of the bento's python version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep that is a bug. Thanks for pointing it out!
since we have the python version in bento.yaml we will use that python version when generating the dockerfile

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will take over from here

Signed-off-by: Aaron Pham <[email protected]>
Signed-off-by: Aaron Pham <[email protected]>
Signed-off-by: Aaron Pham <[email protected]>
Signed-off-by: Aaron Pham <[email protected]>
@yubozhao yubozhao merged commit c418776 into bentoml:main Jun 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants