-
Notifications
You must be signed in to change notification settings - Fork 712
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
Rework UI build to improve caching and fix packaging issue #3353
Conversation
4681736
to
55709f4
Compare
Can you outline what you intended to do, so I don't have to reverse the intent out of the code? |
55709f4
to
594094b
Compare
Sorry @bboreham! You're right, it was missing any explanation. Hopefully it makes sense now! One improvement I'll make in a few minutes:
|
7c5eb81
to
47d8164
Compare
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.
Changes look good from the bits I was able to understand :)
In the CI build the cache is basically empty - do you think it will work better if we merge it, or still more work required? |
I think I need to update the tag for the UI build image in the CI config, to pull in the The cache dirs work in the local build; I dont think I've messed anything up, so it should work in CI too 🤞 |
Stop baking the toolchain and dependencies into the build image. Instead, run the install step each time, but use volume mounts or CircleCI caching to keep the happy path fast. Previously, some parts of the client (UI) directory were baked into the build image, and some parts were mounted or copied into the build environment. As a result, files baked into the build image require a two-step update for changes to take effect in CI. Now, for dockerised builds, we pre-install very little into the build image and mount the whole directory into the build environment. However, we do overlay a volume on the node_modules folder to allow the standard build toolchain to be separate from the host build toolchain. Non-dockerised builds (e.g. CI) are now more similar to the dockerised versions.
91a7186
to
a98da63
Compare
I think it would be great if we could merge the changes that fix the packaging issue, which is a blocker for having latest Scope in Weave Cloud (and https://github.com/weaveworks/service-ui/pull/3202 in particular) and then try to further improve the caching in a separate PR :) Does that make sense @leth? |
I'm just doing some tests to check that the caching stuff works; It should be ready to go after lunch! |
9349b9c
to
b420e22
Compare
b420e22
to
3f37ec0
Compare
Stop baking the toolchain and dependencies into the build image. Instead, run the install step each time, but use volume mounts or CircleCI caching to keep the happy path fast.
Previously, some parts of the client (UI) directory were baked into the build image, and some parts were mounted or copied into the build environment. As a result, files baked into the build image require a two-step update for changes to take effect in CI.
Now, for dockerised builds, we pre-install very little into the build image and mount the whole directory into the build environment. However, we do overlay a volume on the node_modules folder to allow the standard build toolchain to be separate from the host build toolchain.
Non-dockerised builds (e.g. CI) are now more similar to the dockerised versions.
Fixes #3351