-
Notifications
You must be signed in to change notification settings - Fork 320
Add image builder user defined #3180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
44c7cc0
baea4ee
e10a65c
8d95724
4a6394e
d6c0901
a84654b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -93,8 +93,8 @@ | |||||||||||
|
||||||||||||
DOCKER_FILE_TEMPLATE = Template("""\ | ||||||||||||
#syntax=docker/dockerfile:1.5 | ||||||||||||
FROM ghcr.io/astral-sh/uv:0.5.1 as uv | ||||||||||||
FROM mambaorg/micromamba:2.0.3-debian12-slim as micromamba | ||||||||||||
FROM $UV_IMAGE as uv | ||||||||||||
FROM $MICROMAMBA_IMAGE as micromamba | ||||||||||||
Comment on lines
+96
to
+97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider defining default values for template variables
Consider defining the default values for Code suggestionCheck the AI-generated fix before applying
Suggested change
Code Review Run #4675f8 Should Bito avoid suggestions like this for future reviews? (Manage Rules)
|
||||||||||||
|
||||||||||||
FROM $BASE_IMAGE | ||||||||||||
|
||||||||||||
|
@@ -313,6 +313,12 @@ | |||||||||||
def create_docker_context(image_spec: ImageSpec, tmp_dir: Path): | ||||||||||||
"""Populate tmp_dir with Dockerfile as specified by the `image_spec`.""" | ||||||||||||
base_image = image_spec.base_image or "debian:bookworm-slim" | ||||||||||||
from flytekit.configuration import ImageBuilderConfig | ||||||||||||
|
||||||||||||
image_builder = ImageBuilderConfig().auto() | ||||||||||||
|
||||||||||||
image_builder_uv = image_builder.default.uv_image | ||||||||||||
image_builder_micromamba_image = image_builder.default.micromamba_image | ||||||||||||
|
||||||||||||
if image_spec.cuda is not None or image_spec.cudnn is not None: | ||||||||||||
msg = ( | ||||||||||||
|
@@ -416,6 +422,8 @@ | |||||||||||
ENTRYPOINT=entrypoint, | ||||||||||||
RUN_COMMANDS=run_commands, | ||||||||||||
EXTRA_COPY_CMDS=extra_copy_cmds, | ||||||||||||
UV_IMAGE=image_builder_uv, | ||||||||||||
MICROMAMBA_IMAGE=image_builder_micromamba_image, | ||||||||||||
) | ||||||||||||
|
||||||||||||
dockerfile_path = tmp_dir / "Dockerfile" | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dataclass field
default
is using a function callDefaultConfig()
as a default value, which can lead to unexpected behavior. Consider usingfield(default_factory=DefaultConfig)
instead.Code suggestion
Code Review Run #df86ab
Should Bito avoid suggestions like this for future reviews? (Manage Rules)