-
-
Notifications
You must be signed in to change notification settings - Fork 381
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
Minified, multi-architectural container images #1644
Comments
Hi, A few thoughts: ANTsPy has moved to using a conda cmake install for cross-platform compatibility, and it probably would be good to have ANTs do the same. I'm not sure about the use case for the mini ANTs images. What does having a separate image for each program do? Would it make sense to just have one static build per platform, so people could copy the program(s) they want in their Dockerfile? Cross-platform builds would be awesome. QEMU takes too long for Github Actions, so this would be a good alternative. But I don't have an arm64 machine to work on. Regarding conda forge, you'd have to reach out to the developers of that package, we don't maintain that directly - though we've collaborated on updating ANTs to help facilitate conda builds and are happy to discuss further here. |
Yeah, I was the one who sent the ANTsPy PR those years ago. We're interested in using |
Right, the |
@cookpa sure! I actually have a branch for that already: https://github.com/FNNDSC/ANTs/blob/multiarch-dockerfile/Dockerfile Do you want a PR? |
Comparing the Dockerfile I wrote to #1646, I am using docker pull docker.io/fnndsc/ants:2.5.0-micromamba |
This looks interesting, but I'm inclined to keep things simple for ANTs, I like your Dockerfile here https://github.com/FNNDSC/ANTs/blob/04c2938830f6c1233bde9c4784ad2f58d6a8f058/Dockerfile Using Debian and shorter than the existing one. Could you make a PR for that? I was also thinking of making the shared libs option a build arg - then one could build statically, and then copy a program like |
I did a force-push to amend the commit message to follow the convention. |
Also, static builds would be very helpful! (I lack the cmake expertise to do it myself) |
Hi @jennydaman , I made a few changes in #1665, among them adding a build arg for BUILD_SHARED_LIBS, set this to OFF and it will build static libraries and executables. After building a static image with all the tools, I was then able to copy individual executables (no need to bring the libraries) into a Thanks again for your help with the Dockerfile |
I tried out BUILD_SHARED_LIBS=OFF and it works, many thanks! |
Is your feature request related to a problem?
We are interested in using
N4BiasFieldCorrection
as part of our pipelines and run it in containers on PowerPC.Proposed new features
A) In
Dockerfile
, by installingcmake
usingapt
instead of directly from Kitware's website, we can build multi-architectural images usingdocker buildx
. See here:https://github.com/FNNDSC/ANTs/blob/04c2938830f6c1233bde9c4784ad2f58d6a8f058/Dockerfile
I intend to make a PR after figuring out a good solution to #1069
B) Small (<60MB) images can be produced by creating individual images for each ANTs program. See
https://github.com/FNNDSC/microANTs
Using this script, I created a multi-architectural image for
N4BiasFieldCorrection
on DockerHub: https://hub.docker.com/layers/fnndsc/n4biasfieldcorrection/2.5.0/images/sha256-7e4da5a9f606aa170ae8d1187a6de915f5a1d03ca2dd7e773fc24c411c2227ab?context=explore (the ppc64le one doesn't work yet, as aforementioned)If there is more interest in the community, I can use a GitHub Actions matrix to automatically build these minified images for all ANTs programs. I would also like to know whether the ANTsX team is interested in hosting these images and CI infrastructure in their own official namespace.
Alternatives you've considered
docker buildx
is a very inefficient solution because it uses QEMU emulation. Cross-compilation would be a much more efficient solution, however it would require in-depth knowledge of the Cmake configurations of ANTs which I lack.Alternatively, it would also be even better if the
ants
package inconda-forge
was cross-compiled for linux-aarch64 and linux-ppc64le.Additional context
The text was updated successfully, but these errors were encountered: