-
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
feat: add copying files to/from container #676
base: main
Are you sure you want to change the base?
feat: add copying files to/from container #676
Conversation
i usually prefer using |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #676 +/- ##
=======================================
Coverage ? 76.44%
=======================================
Files ? 12
Lines ? 624
Branches ? 96
=======================================
Hits ? 477
Misses ? 120
Partials ? 27 ☔ View full report in Codecov by Sentry. |
one other thing to consider is that there is this great interface "Transferable" in other language implementations-- does this PR make it harder or easier to add this to this implementation as well. the interface (found here) is basically: class Transferable(abc.ABC):
@abstractmethod
def transfer_to(content_stream, destination: typing.Union[str, os.PathLike]):
... where content_stream is some bytesio or something pythonic for a place where you can write bytes to. |
when i tried to do it, i accidentally interpreted the interface a bit too widely and instead of passing just the content output stream, i passed the whole container as that first argument. 4b7db74 - misc functions, next commit doesnt make sense without reading first bbc44ec - the commit where i add the transferable stuff |
so im tiny bit hesitant to merge without a plan for adding transferable on top of this |
do we need it to be 1:1 with java implementation though? any binary object now can be passed here using tempfile.NamedTemporaryObject:
|
we dont need to be 1-1 but what if instead of a file you had a string? i think it is beneficial to not force people to create temporary files. |
refactored for Transferable although creating temp files cannot be avoided, now instead of asking users for 3 extra lines we add some complexity to codebase here. working example input:
output
|
@mgorsk1 I have opened #677 to solve the same issue (I did not see you already had opened one 😓).
Are our two approaches complementary ? |
I think copying before can already be solved by with_volume_mapping 😅 |
Signed-off-by: mgorsk1 <[email protected]>
Signed-off-by: mgorsk1 <[email protected]>
Signed-off-by: mgorsk1 <[email protected]>
Signed-off-by: mgorsk1 <[email protected]>
Signed-off-by: mgorsk1 <[email protected]>
Signed-off-by: mgorsk1 <[email protected]>
Signed-off-by: mgorsk1 <[email protected]>
e5a2325
to
a2f6094
Compare
Signed-off-by: mgorsk1 <[email protected]>
Signed-off-by: mgorsk1 <[email protected]>
committed some code here - main...feat/665-with-copy-file-to-container |
since this is not a high priority feature this can probably wait for 1) more api refinement - feedback welcomed on my suggestions above 2) more of my free time, as I'm not sure ill be able to spend too much more time on this this week (just spent my entire week's time budget on this today). |
solves #665