Skip to content

ci/cache docker layers#543

Merged
metachris merged 9 commits into
flashbots:mainfrom
paulopontesm:ci/cache-docker-layers
Oct 19, 2023
Merged

ci/cache docker layers#543
metachris merged 9 commits into
flashbots:mainfrom
paulopontesm:ci/cache-docker-layers

Conversation

@paulopontesm
Copy link
Copy Markdown
Contributor

📝 Summary

Small update to the GitHub Actions workflow and Dockerfile. Implemented caching for docker layers to accelerate the build process and upgraded some related actions to their latest versions.

I am not opening an issue because I'm not changing any logic in the code. Let me know if you'd prefer for me to open one.

This is the result:

image

⛱ Motivation and Context

I noticed that a significant amount of time in the pipelines (>20 mins) is consumed during the Docker builds. A major part of this time is spent downloading all the Go modules anew. By caching the Docker build layers, this pull request aims to reduce that time and make the pipeline more efficient. A small "quality of life" improvement 😄

Note: I'm not adding it to this PR to keep it simple, might do it later, but bumping the bump actions/setup-go to v4 comes with the go.sum cache enabled by default.

📚 References

This might also be relevant to understand the purpose of the mode=max option:

In min cache mode (the default), only layers that are exported into the resulting images are cached, while in max cache mode, all layers are cached, even those of intermediate steps. (source)


✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy
  • I have seen and agree to CONTRIBUTING.md

Copy link
Copy Markdown
Collaborator

@metachris metachris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, that's nice!

@metachris metachris merged commit c9d96e1 into flashbots:main Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants