-
Notifications
You must be signed in to change notification settings - Fork 27
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
Support s3 paths #103
Support s3 paths #103
Conversation
Test failures on v1.3 is because Minio only supports v1.5+. I made a PR to loosen that restriction: https://gitlab.com/ExpandingMan/Minio.jl/-/merge_requests/2 |
To be honest, I'm rather opposed to making patches to be compatible with anything as old as 1.3 on principle. Since Minio.jl is a tiny package and the changes to make it compatible with 1.3 are small, I don't plan on standing in the way of your PR if that's what it comes down to, but let me at least make a case for not doing that. For a language as young as Julia, 1.3 seems positively ancient, and the new LTS version will likely be announced very soon and I imagine it won't be all that long before explicit support for pre-1.6 becomes significantly less common. More importantly for this particular case, tests seem to pass perfectly fine for this package on 1.6, is there some specific reason it is capped at 1.3 and testing on it? I'd much prefer to resolve any lingering issues for tensorboard world on 1.6 than start making things backward compatible with a really old Julia version. |
Not testing at all on Julia v1.3 here would be fine by me, but I think that’s up to the maintainers. |
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 is basically just a plain improvement to the code quality.
@@ -65,7 +65,9 @@ function write_sprite(img_labels::AbstractArray, matrix_path::AbstractString) | |||
arranged_augment_square_CHW = zeros((3, sprite_size, sprite_size)) | |||
arranged_augment_square_CHW[:, 1:size(arranged_img_CHW, 2), :] = arranged_img_CHW | |||
sprite_path = joinpath(matrix_path, "sprite.png") | |||
save(sprite_path, colorview(RGB, arranged_augment_square_CHW)) | |||
open(sprite_path; write=true) do io |
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.
It is annoying the this is needed
Should an issue be openned in FileIO.jl?
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.
So there's two issues here; one is easy (JuliaCloud/AWSS3.jl#174), the other is that ImageMagick types paths to AbstractString
which is too strict (FilePathsBase PosixPaths for example are probably OK too), but it isn't fully generic because it eventually goes to
ccall((:MagickWriteImages, libwand), Cint, (Ptr{Cvoid}, Ptr{UInt8}, Cint), wand, filename, true)
in writeimage
and I don't think that can handle s3 paths. Possibly ImageMagick should add another method for writeimage
where unknown filename types are handled by opening a stream like we do here?
I feel you! I was testing TensorBoardLogger on v1.0 (judging from mails I get from time to time, I think a fair number of people use it in production environments where they work with older versions) and eventually gave up. @ericphanson It's fine for me to test this stuff only on more recent versions. It should be possible to do that if you edit the Does this sound feasible? --
I'm mildly against adding the dependency ( It may add a little bit compilation cost, but we could offset it by generating precompile statements later on, and has no drawbacks that I can think of. |
Because I wanted to support the 1.0 LTS. |
Ok, just gave this a try based on the stuff already in the workflow for v1.3, good idea!
That sounds fine to me, I think most users are probably not generating many different loggers but rather just 1 or at least 1 type, so I think there might not be too much compilation cost. Pushed a commit to do this. |
@ericphanson I was more thinking of keeping Minio in project (otherwise it fails for newer versions) and literally remove the line with
should take care of removing the UUID. Then to remove |
If you remove |
This reverts commit 325f50c.
Ok, I gave that a try |
Tests passing 😄. Should I bump the version? |
ops, I saw your comment only now. Thanks for your PR! |
@ericphanson for some reason CI was passing in 1.3 the PR branch but failed as soon at it was merged in master. |
Sure, let me take a look |
That test passes for me locally on Julia 1.3, as does a full |
It looks like this was happening even before this PR: https://github.com/JuliaLogging/TensorBoardLogger.jl/runs/2764508008 |
I filed #105 to track the CI failure. Since it’s unrelated to this PR, can we get a release so I can use the s3 path feature downstream? |
Widens
IOStream
types toIO
andlogdir::String
tologdir::Any
. Runs all tests with both a local path and anS3Path
(via Minio.jl which uses minio to run a local s3-like server).Closes #102
I had to change lots of
*
tojoinpath
to pass the config along correctly, and do a few other minor workarounds to get all the tests passing.