Skip to content
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

Cache results of hooks #82

Open
JonathonReinhart opened this issue Sep 30, 2016 · 0 comments
Open

Cache results of hooks #82

JonathonReinhart opened this issue Sep 30, 2016 · 0 comments

Comments

@JonathonReinhart
Copy link
Owner

When using Scuba to emulate a CI runner, the hooks may perform expensive operations. For example, a .gitlab-ci.yml before_script may run commands to install packages via apt. Running these hooks every time the user runs scuba would be unacceptable to the user.

One alternative would be to manually perform the installation, and push the resulting image to your image repository.

Instead, Scuba could run the hooks just once, and commit the resulting container to an image, which Scuba will use for all subsequent invocations.

This is no small task; caching is difficult. However, it would behave similar to the way docker build caches intermediate layers. We could hash the hook scripts, and use that as a key to refer to the cached image.

Additional difficulties might include things that are done by the hooks that don't affect the filesystem. I'm not sure what this might be, but these hooks would still need executed, even if we're running a cached image. This might require adding an additional flag to the hooks, or adding a separate top-level key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant