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

Slow to start perhaps because this is a Docker container action? #54

Closed
jizusun opened this issue Jan 27, 2024 · 4 comments · Fixed by #71
Closed

Slow to start perhaps because this is a Docker container action? #54

jizusun opened this issue Jan 27, 2024 · 4 comments · Fixed by #71

Comments

@jizusun
Copy link

jizusun commented Jan 27, 2024

Hi community,

I love this actions, but it takes almost 1 minutes to build the image to start the actions

image

Since one of our use case is for documentation checking, and it's a little bit slow for this use case.
How can I optimize it to make it start faster?

@shogo82148
Copy link
Contributor

python:3.11.4-buster is Debian based image.

FROM python:3.11.4-buster

How about trying python:<version>-slim or python:<version>-alpine?

@jizusun
Copy link
Author

jizusun commented Jan 30, 2024

python:3.11.4-buster is Debian based image.

FROM python:3.11.4-buster

How about trying python:<version>-slim or python:<version>-alpine?

Thank you for the quick response @shogo82148

I tried to use python:<version>-slim, and it just requires extra gcc to pip install.
https://github.com/jizusun/action-detect-secrets/blob/68af1399b892278f6ba59e946bba2ea293d025e7/Dockerfile#L1-L19

alpine should also work.

But now my latest progress is that ,
by using

  image: docker://ghcr.io/xxx/action-detect-secrets:master

https://github.com/jizusun/action-detect-secrets/blob/6d92919c68b7bfdc86c1847dd8f4d6cd88f40ee8/action.yml#L37-L39

the start-up process can be optimized to ~9s.
image
https://github.com/jizusun/action-detect-secrets/actions/runs/7682270594/job/20936413098?pr=1

The approach is actually first build and publish the image to GHCR,
and when using the docker action, it pull the image directly instead of building it.

Will you agree with this approach and accept such PR?
#55

@shogo82148
Copy link
Contributor

It sounds good.
For example, https://github.com/reviewdog/action-actionlint uses GHCR.

@jizusun
Copy link
Author

jizusun commented Feb 2, 2024

It sounds good. For example, https://github.com/reviewdog/action-actionlint uses GHCR.

Thank you!
Can you help me to clarity the software supply chain problem in the PR, if you have time?
#55

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