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

Caching build of Docker actions #81

Open
ad-m opened this issue Oct 31, 2019 · 11 comments
Open

Caching build of Docker actions #81

ad-m opened this issue Oct 31, 2019 · 11 comments
Assignees

Comments

@ad-m
Copy link
Contributor

ad-m commented Oct 31, 2019

Describe the enhancement

In my opinion, in the case of Docker actions, in many cases it is worthwhile to provide the cache for actions build. At least for published in the marketplace, it is possible to pre-build them by GitHub Actions and store as cache.

Currently, Docker actions are built multiple times as the first step of all builds, which is extremely inefficient for complex Docker actions.

Code Snippet
This is due to the way the GitHub Actions worker works.

Additional information

The issue actions/toolkit#47 has been closed indicating a reference to @actions/cache, which however is limited to user data cache only. In this case, we do not have user data, but public actions, and the process is not controlled by the user at this stage (yet).

@ad-m
Copy link
Contributor Author

ad-m commented Oct 31, 2019

See ad-m/github-push-action#19 too.

@ad-m
Copy link
Contributor Author

ad-m commented Oct 31, 2019

@joshmgross commented 5 minutes ago:

@ad-m I think it's fine to leave that in @actions/toolkit, as it's a general improvement to Docker actions. If the recommended step is to just cache before using every docker action, then that might be better if done by default.

@ad-m
Copy link
Contributor Author

ad-m commented Nov 1, 2019

Azure has recently released Teleport for images from Azure Container Registry ( https://stevelasker.blog/2019/10/29/azure-container-registry-teleportation/ ). The concept based on the use of SMB, which allows you to read only the necessary parts of layers without full transfer is very interesting, because it can give a very quick start in this use case. However, I suppose the Azure permissions model may still be too limited to direct integration, despite recent development of Azure in that area.

@bryanmacfarlane bryanmacfarlane transferred this issue from actions/toolkit Nov 11, 2019
@peaceiris
Copy link

peaceiris commented Nov 12, 2019

Now, we can pull a docker image from the Docker Hub or the GitHub Package Registry to skip a build step. But it is better the actions runner can cache a docker image with a built-in cache feature, not this cache action.

We are discussing at #37 that is focusing the Docker CLI, not a Docker action. We want to run a docker action with uses: key and cache it like the actions beta v1.

We can skip a docker action build step like the following as a current workaround:

- uses: peaceiris/actions-gh-pages@v2
+ uses: docker://peaceiris/gh-pages:v2

(Edit: Now, this action migrated to a TypeScript Action) GitHub Actions for GitHub Pages

Although, we cannot verify those images are trusted. I hope that we can build a docker action and cache it on the GitHub Actions runner.

@bhack
Copy link

bhack commented Apr 13, 2020

Any news?

@dungahk
Copy link

dungahk commented Apr 18, 2020

I've tried using the docker save/load strategy but it does not work when the Dockerfile has a COPY/ADD command because the SHA produced is always different, I'm not sure why that happens, I've tried both with Github managed runners and self-hosted. Self-hosted works if I don't run docker system prune which makes sense I think.

@jimgreer
Copy link

jimgreer commented May 3, 2020

+1

@github-actions
Copy link

This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.

@github-actions github-actions bot added the stale label Jul 24, 2023
@markbaird
Copy link

I see this issue is stale and in danger of being closed. I think this is a much needed feature that needs to be added.

Copy link

This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.

@github-actions github-actions bot added the stale label Feb 11, 2024
@gshpychka
Copy link

Still relevant.

@github-actions github-actions bot removed the stale label Feb 13, 2024
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