-
Notifications
You must be signed in to change notification settings - Fork 299
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
[Flytekit] Support extra copy commands in ImageSpec #2715
Conversation
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
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.
don't you need to update the compute_digest
call the new tag
property to take into account changes in these newly copied files?
Signed-off-by: mao3267 <[email protected]>
97d4192
to
9a9707d
Compare
Signed-off-by: mao3267 <[email protected]>
…-copy-command Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
…-copy-command Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2715 +/- ##
===========================================
+ Coverage 80.20% 90.95% +10.75%
===========================================
Files 237 73 -164
Lines 21682 3306 -18376
Branches 4130 0 -4130
===========================================
- Hits 17389 3007 -14382
+ Misses 3576 299 -3277
+ Partials 717 0 -717
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Is raising an error the expected behavior for files or directories with absolute paths or ../ in their paths? |
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Yup, I think it makes sense since docker also doesn't support it. |
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: mao3267 <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
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.
LGTM, thank you @mao3267. Mind also updating the envd
image builder to support copy in the follow-up PR
Will work on it. Really appreciate your help! |
Signed-off-by: mao3267 <[email protected]> Signed-off-by: Kevin Su <[email protected]> Co-authored-by: Kevin Su <[email protected]>
Signed-off-by: mao3267 <[email protected]> Signed-off-by: Kevin Su <[email protected]> Co-authored-by: Kevin Su <[email protected]>
Tracking issue
Initially, we aimed to support adding custom Docker commands when creating images with ImageSpec. However, after discussions with @thomasjpfan and @pingsutw in #2676 , we prioritized supporting additional COPY commands first, as they were deemed more important.
Why are the changes needed?
When creating images with ImageSpec on a remote cluster, we may need to copy additional files or directories required during the container build process. To address this, we aim to support extra copy commands in ImageSpec for copying files and directories into the container’s
/root
directory.What changes were proposed in this pull request?
ImageSpec.with_copy(src)
function to the ImageSpec class, allowing the inclusion of additional copy commands. The src parameter can be a single path string or a list of path-like strings, specifying files or directories to be copied.input.json
build_image.py
/root
in the container by settingImageSpec.copy
, a list of path strings.build_image.py
compute_digest
function infast_registration.py
.How was this patch tested?
test_image_spec.py
, testImageSpec.copy
argument andImageSpec.with_copy()
function with multiple files/directories to copy.test_default_builder.py
, test building docker context and image with extra copy commands./root
.Setup process
Screenshots
The results of running
pyflyte run --remote build_image.py my_wf
are shown below.Check all the applicable boxes
Related PRs
#2676
Docs link
TODO