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

Speed up docker builds #1697

Closed
4 tasks
zarazan opened this issue Jan 7, 2023 · 7 comments · Fixed by #1708
Closed
4 tasks

Speed up docker builds #1697

zarazan opened this issue Jan 7, 2023 · 7 comments · Fixed by #1708
Assignees

Comments

@zarazan
Copy link
Contributor

zarazan commented Jan 7, 2023

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

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@robert-zaremba
Copy link
Member

Good idea
Related to: #1675

@robert-zaremba robert-zaremba self-assigned this Jan 10, 2023
@mergify mergify bot closed this as completed in #1708 Jan 11, 2023
mergify bot pushed a commit that referenced this issue Jan 11, 2023
## 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)
@zarazan
Copy link
Contributor Author

zarazan commented Jan 17, 2023

@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.

@zarazan zarazan reopened this Jan 17, 2023
@robert-zaremba
Copy link
Member

I've updated the contrib/images/price-feeder.dockerfile. Is tthere anything else missing @zarazan ?

@zarazan
Copy link
Contributor Author

zarazan commented Jan 20, 2023

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.

@robert-zaremba
Copy link
Member

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 COPY . .

@robert-zaremba
Copy link
Member

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.

@zarazan
Copy link
Contributor Author

zarazan commented Jan 20, 2023

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.

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 a pull request may close this issue.

2 participants