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
Incremental / cached build of definition files #2666
Comments
TLDR - This is unlikely in definition file builds, but see the Dockerfile OCI-Mode builds in 4.1 (https://docs.sylabs.io/guides/4.1/user-guide/build_a_container.html#building-from-dockerfiles) Hi @Heng-Zhou. This feature has been requested many times during the history of Singularity. I'll write a lengthy reply here so I can direct any future questions to it. I am going to frame the reply around differences vs Dockerfiles, as that's how many people are familiar with incremental/cached container builds. However, I've also addressed the difference to code compilation that you mention. Incremental definition file builds are more complicated than it might seem because:
The second point is really the blocker. In a
If I build this def file, it will just echo a message during the build. Now I add another line...
If an incremental re-build only runs the new line then In essence, a definition file Because the At this point, it's important to note that for SingularityCE 4.1 we added the ability to build Dockerfiles in our OCI-Mode. Dockerfile builds do cache intermediate steps. We recommend using OCI-Mode Dockerfile builds if this behaviour is critical to you (https://docs.sylabs.io/guides/4.1/user-guide/build_a_container.html#building-from-dockerfiles). Introducing caching of instructions during a definition file build, at this point, would require a complete re-write of the build code to allow multiple
If a member of the community wanted to contribute incremental builds to SingularityCE, we would certainly consider any proposal as long as:
Having said all of this - we do constantly review what features are priorities of users, and what we can achieve with our development resources. What I've written above may not always be the case in future. |
I'm afraid you have some misunderstanding about incremental build in your example. When I say "take only a small period of time for a small addition" in my post, I meant building the new thing on top of the existing container that has been built and re-used; I did not mean building only the newly added thing, "apt install $MY_PROG" in your example. I assumed that is known implicitly by anyone who received any Computer Science education so I did not wrote. For the remaining, I don't think that is an argument based on technology. That is only an argument based on money. You don't wanna do it just because no one pay you enough money to do it. That's it. |
Before I reply to your technical point, I would like to ask you to reflect on the following if you are going to continue to interact with this project:
The continued development and maintenance of SingularityCE, which you are able to obtain and use for free, is largely due to myself and others being paid to develop and maintain it. To my knowledge, we haven't received any money from yourself or your employer, but we have taken the time to answer questions where possible and discuss things that you have asked. Anyone in the open source community is very welcome to contribute to SingularityCE. We have fewer contributions compared to some other software because we are a systems-level software project, while our user base is primarily developing/using scientific software. Because of this, most new features are developed by Sylabs employees. When features are suggested, we have to ask many questions:
Once we know the answer to these questions then we (Sylabs) are able to prioritise. There will always be more features requested than we can take on. We urge anyone who would like to have more impact on feature development in SingularityCE to:
We ask that people are mindful that:
With regard to your comment about the builds:
This is implicit in the discussion above - I assume that you would want to perform the A practical workaround, for cases where you can define everything without reference to any state during the original
|
I would like to see incremental build feature implemented in Singularity.
Suppose we have a big definition file which takes quite a while to build, and we are going to add a bit to it, say, installing a new small package. Currently, we have to build the whole thing from scratch for a long time, just for a small change. So, I was wondering if Singularity can implement incremental build, just like the same concept used commonly in compilers of C++, etc., that would take only a small period of time for a small addition to the definition file, instead of wasting too much time on repeated installation and settings.
The text was updated successfully, but these errors were encountered: