-
Notifications
You must be signed in to change notification settings - Fork 18
Add support for pushing and pulling private images in the remote builder #252
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: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
src/flyte/_image.py
Outdated
registry: Optional[str] = None, | ||
name: Optional[str] = None, | ||
platform: Optional[Tuple[Architecture, ...]] = None, | ||
secret: Optional[SecretRequest] = None, |
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.
call it pull_secret
? or something more clear that this is for pulling? or is this for pushing? Is it possible to use one secret to pull and another secret to push?
Also this new field(s) should be in every from_
function right?
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.
or something more clear that this is for pulling? or is this for pushing?
for both
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
src/flyte/remote/_secret.py
Outdated
domain = cfg.domain | ||
else: | ||
secret_type = definition_pb2.SecretType.SECRET_TYPE_IMAGE_PULL_SECRET | ||
project = None |
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.
raise an error if project/domain are set
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.
done
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Use the same registry secret in the task environment to ensure the container | ||
can pull the private image during task execution. | ||
""" | ||
env = flyte.TaskEnvironment(name="private-image", image=image, secrets="pingsutw") |
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.
wait so you have to declare it twice?
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.
one is for task, another one is for remote builder
""" | ||
from flyte.remote import Secret | ||
|
||
project = "" if project is None else project |
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.
this seems weird... why?
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.
We don't want to use project/domain in the config by default. If it's none, we should create a global secret
This pull request adds support for using private base images when building and running Flyte tasks, allowing users to specify registry secrets for authentication. The main changes introduce a new workflow for handling private registries, update the
Image
class to accept and propagate registry secrets, and ensure secrets are used during image build and runtime. The example demonstrates how to use these features.Support for private image registries:
examples/image/private_base_image.py
) showing how to build and run a Flyte task using a private base image, including instructions for creating and using a registry secret.Image
class (src/flyte/_image.py
) to accept aregistry_secret
parameter in relevant methods (from_debian_base
,from_uv_script
,clone
) and propagate it internally for use during image build/pull. [1] [2] [3] [4] [5] [6]src/flyte/_internal/imagebuild/remote_builder.py
) to use the registry secret when building images and to properly construct the target image reference for private registries. [1] [2]Secret handling improvements:
src/flyte/remote/_secret.py
) to set project/domain only for regular secrets, allowing image pull secrets to be global. [1] [2]Internal code improvements:
_image_registry_secret
attribute to theImage
class for tracking registry secrets and updated method signatures and docstrings to document the new parameter. [1] [2] [3]