-
Notifications
You must be signed in to change notification settings - Fork 223
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
OBS-504: Optimize Socorro builds for better FE dev speed #6908
Conversation
|
||
# Install frontend JS deps | ||
COPY --chown=app:app ./webapp/package*.json /webapp-frontend-deps/ | ||
RUN cd /webapp-frontend-deps/ && npm install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that this will speed up installing new web dependencies, while it slows down updating Python dependencies, right? I don't have an opinion on this, just asking for clarification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's possible: if changes are made to the python dependencies it will rebuild the JS deps on the subsequent layer. However, my experience suggests the JS deps are minimal and build much faster than the python deps (seconds vs minutes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggested making this change locally on your machine because it would speed up the loop you were doing often. I didn't intend to suggest we make this change globally.
Typically, we want to order steps in the Dockerfile to improve cache hits when doing typical work. We typically don't make changes to the JS environment, but we do land Python environment PRs from Dependabot and elsewhere, so we'll now be rebuilding the JS environment over and over. It doesn't add a lot on my machine (4s), so I'm game for making this change globally for everyone, but I would suggest we revert it it leads to longer build times for typical work.
Going back to the bigger problem of it taking a long time to build Socorro, it takes my machine 1m40s to do a full no-cache rebuild. It's curious it takes 4+ minutes for you. There might be other things you could look into to speed it up locally.
Co-authored-by: Sven Marnach <sven@marnach.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a minor suggestion, but this is largely fine.
If it turns out to slow our typical work down, we can revert the Dockerfile
change.
|
||
# Install frontend JS deps | ||
COPY --chown=app:app ./webapp/package*.json /webapp-frontend-deps/ | ||
RUN cd /webapp-frontend-deps/ && npm install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggested making this change locally on your machine because it would speed up the loop you were doing often. I didn't intend to suggest we make this change globally.
Typically, we want to order steps in the Dockerfile to improve cache hits when doing typical work. We typically don't make changes to the JS environment, but we do land Python environment PRs from Dependabot and elsewhere, so we'll now be rebuilding the JS environment over and over. It doesn't add a lot on my machine (4s), so I'm game for making this change globally for everyone, but I would suggest we revert it it leads to longer build times for typical work.
Going back to the bigger problem of it taking a long time to build Socorro, it takes my machine 1m40s to do a full no-cache rebuild. It's curious it takes 4+ minutes for you. There might be other things you could look into to speed it up locally.
Co-authored-by: Will Kahn-Greene <willkg@users.noreply.github.com>
Currently when making changes to the FE build process (package.json, etc), most of the app image rebuilds unnecessarily. These FE changes also trigger a rebuild of the “devcontainer” image. Consequently, every change takes ~5 minutes on my machine.
With this PR build times are reduced to under 30 seconds (as tested on my machine)