-
Notifications
You must be signed in to change notification settings - Fork 295
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
Add ImageSpec.from_env #2895
base: master
Are you sure you want to change the base?
Add ImageSpec.from_env #2895
Conversation
Signed-off-by: Thomas J. Fan <[email protected]>
if "packages" in kwargs: | ||
packages = kwargs.pop("packages") | ||
else: | ||
packages = [] | ||
|
||
pinned_packages = pinned_packages or [] | ||
|
||
for package_to_pin in pinned_packages: | ||
package_version = version(package_to_pin) | ||
packages.append(f"{package_to_pin}=={package_version}") |
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.
should there be any special handling for when there are overlapping packages in pinned_packages
and packages
?
e.g. replace the unpinned package with the pinned package and logging via logger.info
?
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.
There is no issue with overlapping unless there is a conflict. For example, this installs flytekit==1.13.8
:
uv pip install flytekit flytekit==1.13.8
If there is a conflict, then the builder will error:
uv pip install flytekit==1.13.11 flytekit==1.13.12
× No solution found when resolving dependencies:
╰─▶ Because you require flytekit==1.13.11 and flytekit==1.13.12, we can conclude that your requirements are
unsatisfiable.
Given that we also have requirements.txt
, there can be conflicts there too. I rather have the not do the error checking here.
As an alternative, I considered disallowing packages
& requirements
here, but it seemed to restrictive.
Signed-off-by: Thomas J. Fan <[email protected]>
Tracking issue
Closes flyteorg/flyte#5889
Why are the changes needed?
Resolve notebook environment mismatch described in flyteorg/flyte#5889
What changes were proposed in this pull request?
This PR adds a
ImageSpec.from_env
intoImageSpec
.How was this patch tested?
I added unit test to this PR and ran this workflow: