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
Ability to cache !Sh build commands #8
Comments
Well, I'm not sure I understand you. But let me explain how cache works in vagga. Unlike in docker which caches each step, we have two things:
The (1) is probably not relevant for discussion. The hash for container version is constructed from the !Sh section itself. I.e. if you don't change text of shell command, vagga will think that container doesn't change, and will not rebuild. In case you use some external scripts or files in !Sh script and want container to depend on it, use |
As a concrete example, alpine doesn't have a package to install openresty. I have this recipe to install it: https://github.com/cablehead/vagga-alpine-openresty/blob/master/vagga.yaml It takes a couple of minutes to compile. I'd like to be able to freeze this down, and then build additional things on top. If that makes sense? So I guess yeah, getting close to docker's idea of caching after each step. |
The problem is being like a docker is that we can do that fast only on btrfs. Is it ok for you? Well, snapshots are fast, but still for each snapshot we need to keep temporary files around. There are couple of alternatives I'm thinking of:
What do you think? |
I really like the idea of number 3.. but, I'll definitely defer to you on this one. Particularly I don't have experience building alpine packages, but would like to learn! Haha. I'm in the middle of reworking that repo I linked above to have recipes for other things I'm working with: https://github.com/cablehead/vagga-alpine Thinking out loud, if someone wanted to reuse these recipes, what would be the easiest thing? Would say turning these recipes into something that creates an alpine package for reuse be better, or to use them as is to create a container, and then reference that container with !Container xxx |
How would these recipes look reworked to be usable with a BuildPackage directive? |
I would say for BuildPackage they need just to be alpine packages, like this: http://wiki.alpinelinux.org/wiki/APKBUILD_examples:Simple The advantage is: they are usable not only in vagga but generally for alpine users. (In fact I want to implement all three things :) , but not snapshotting so far) |
The combination of those 3 features would be really powerful. Yeah, snapshotting could lead to things potentially turning into a mess and would be unnecessary with these features (or even 1 or 2 of them) |
Another thought about reusing recipes, is that when they are done as containers they are not composable (you can't apply two). Still "!Container" command is probably the easiest thing to do, so I'm going to start with it :) |
That's true, while 1 and 2 would be composable. Is there anything I can do that would be of help? I still owe you some patches for the installation docs too :) |
You can try "subcontainers" branch. It doesn't build dependent container automatically, you need to "vagga _build name" first (or run any command in it). It lacks docs and versioning is quite glitchy so far. Also it's has refactoring of internals, so I need to test it much more. |
Ok, the |
Just checking - is the best way to discuss new ideas? Would a mailing list be better?
So this is very much a feature request...
I find myself wanting to be able to cache !Sh sections.
I.e., something like you have a !Sh section that takes a while to build, but is stable. You then want to build on top of that with additional !Sh sections. If you add multiple !Sh sections, could a cache be taken after each one, and only rebuilt if that !Sh section changes?
The text was updated successfully, but these errors were encountered: