-
Notifications
You must be signed in to change notification settings - Fork 170
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
Speed up docker builds #1697
Comments
Good idea |
## Description closes: #1697 --- ### Author Checklist _All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues._ I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] added appropriate labels to the PR - [ ] targeted the correct branch (see [PR Targeting](https://github.com/umee-network/umee/blob/main/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist _All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items._ I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
@robert-zaremba This need to be done for the go.mod from the price feeder as well. Or we can wait until Ojo is ready and the pull out the price feeder anyways. |
I've updated the |
The docker build will still install a bunch of go packages after making non-package related changes. I'll try to diagnose it sometime soon. The goal is to reduce the time it takes to rerun the tests locally after making changes. |
What kind of changes? We are copying the whole directory. So if you change any file in that directory it will force rebuild and every step after |
I don't think there is a clear way to optimize that. You would need to manually list all go files we want to copy. And that will be in multiple steps to preserve the the directory structure. |
My assumption is that there is still stuff we can move before the COPY . . command. I'll play around with it when I get some free time soon. |
Summary
Both of the Umee docker file re-download all the go libraries every time any files are updated because all the files are copied over first before go mod download is ran. We should copy just the go.mod and go.sum files over first, run go mod download, and then copy over the rest of the application so when the image is rebuilt after some of the application files are changed it skips the very long process of downloading all the go libraries again unless the go.mod file has changed.
For Admin Use
The text was updated successfully, but these errors were encountered: