-
Notifications
You must be signed in to change notification settings - Fork 2
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
Julia build in container #45
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #45 +/- ##
=======================================
Coverage 77.92% 77.92%
=======================================
Files 8 8
Lines 299 299
=======================================
Hits 233 233
Misses 66 66
☔ View full report in Codecov by Sentry. |
Conflicts: src/h5.jl
… feat-docker-build Conflicts: src/h5.jl
Project.toml
Outdated
LoggingExtras = "1.0.1" | ||
PyCall = "1.96.1" | ||
Pkg = "1.9.0" | ||
TOML = "1.0.3" |
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.
TOML = "1.0.3" | |
TOML = "1.0.3" | |
resources/README.md
Outdated
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.
Why delete this file?
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.
Good catch, I think it just got inadvertently deleted when I was testing (wiping the downloaded resources).
workflow/scripts/ice-floe-tracker.jl
Outdated
# logger = setuplogger(logoption, command) | ||
|
||
with_logger(logger) do | ||
@time command_func(; command_args...) | ||
end | ||
# with_logger(logger) do | ||
@time command_func(; command_args...) | ||
# end |
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.
Why comment out the logger? If it's not needed, some deps (LoggingExtras) could also be dropped.
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.
I think it was the issue with the logger trying to write in the read-only container. I can retest it and see if it will work now that we've updated some other code. It's possible that we have the right bindings now and it might work.
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.
I was able to add a binding so that it will write the logs to workflow/report
!
[[pulljuliaimage]] | ||
script = """ | ||
apptainer build --force $project_dir/icefloetracker-julia.simg docker://brownccv/icefloetracker-julia:pr-45 | ||
""" |
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.
After merging, I'll have to start a new PR and change the image tag to main
rather than pr-45
.
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.
👍
Added a few things to consider.
RUN chmod a+x /opt/ice-floe-tracker-pipeline/workflow/scripts/ice-floe-tracker.jl | ||
COPY workflow/scripts/ice-floe-tracker.jl /usr/local/bin/ice-floe-tracker.jl | ||
|
||
RUN chmod a+x /usr/local/bin/ice-floe-tracker.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.
Is this really required? I see that the command used to run the ice-floe-tracker.jl
script includes 'julia' which is probably required to pass the -t auto
flag to enable multithreading.
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.
I think it has to do with the permissions in a singularity container. Things work for container permissions when we copy to/usr/local/bin
. I was running into issues with running it directly from the repo.
[compat] | ||
ArgParse = "1.1.4" | ||
Folds = "0.2.8" | ||
HDF5 = "0.16.15" | ||
IceFloeTracker = "0.2.1" | ||
LoggingExtras = "1.0.1" | ||
PyCall = "1.96.1" | ||
Pkg = "1.9.0" | ||
TOML = "1.0.3" | ||
|
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.
👍
5. Export SOIT username/password to environment variable | ||
- [ ] From your home directory `nano .bash_profile` | ||
- [ ] add `export HISTCONTROL=ignoreboth` to the bottom of your .bash_profile | ||
* this will ensure that your username/password are not stored in history | ||
* when exporting the following environment variables, there __must__ be a space in front of each command | ||
- [ ] ` export SPACEUSER=<firstname>_<lastname>@brown.edu` | ||
- [ ] ` export SPACEPSWD=<password>` |
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.
From Josh's talk yesterday, I was thinking maybe secrets could be used for this. Not sure if it's possible.
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.
I'll make an issue for looking into this. That might be a good way to do it. Talking with @broarr, it seemed like this use case was best to not store anything in a file.
singularity exec --bind $landmask_dir:/tmp,$report_dir:/usr/local/bin/../report $project_dir/icefloetracker-julia.simg $julia_exec -t auto /usr/local/bin/ice-floe-tracker.jl landmask $fetchdata_dir /tmp | ||
""" | ||
[[preprocess]] | ||
script = """ | ||
julia -t auto $project_dir/workflow/scripts/ice-floe-tracker.jl preprocess -t $fetchdata_dir/truecolor -r $fetchdata_dir/reflectance -l $landmask_dir -p $soit_dir -o $preprocess_dir | ||
singularity exec --bind $preprocess_dir:/tmp,$report_dir:/usr/local/bin/../report $project_dir/icefloetracker-julia.simg $julia_exec -t auto /usr/local/bin/ice-floe-tracker.jl preprocess -t $fetchdata_dir/truecolor -r $fetchdata_dir/reflectance -l $landmask_dir -p $soit_dir -o /tmp | ||
""" | ||
[[extractfeatures]] | ||
script = """ | ||
julia -t auto $project_dir/workflow/scripts/ice-floe-tracker.jl extractfeatures -i $preprocess_dir -o $preprocess_dir --minarea $minfloearea --maxarea $maxfloearea | ||
singularity exec --bind $preprocess_dir:/tmp,$report_dir:/usr/local/bin/../report $project_dir/icefloetracker-julia.simg $julia_exec -t auto /usr/local/bin/ice-floe-tracker.jl extractfeatures -i $preprocess_dir -o /tmp --minarea $minfloearea --maxarea $maxfloearea | ||
""" | ||
[[tracking]] | ||
script = """ | ||
julia -t auto $project_dir/workflow/scripts/ice-floe-tracker.jl track --imgs $preprocess_dir --props $preprocess_dir --deltat $preprocess_dir --output $tracker_dir | ||
singularity exec --bind $tracker_dir:/tmp,$report_dir:/usr/local/bin/../report $project_dir/icefloetracker-julia.simg $julia_exec -t auto /usr/local/bin/ice-floe-tracker.jl track --imgs $preprocess_dir --props $preprocess_dir --deltat $preprocess_dir --output /tmp | ||
""" | ||
[[exportH5]] | ||
script = """ |
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.
Great work figuring out the bindings!
Add line ending Co-authored-by: Carlos Paniagua <[email protected]>
This PR works out the precompiling and building of IFTPipeline in the container.