-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
jumpstart / git-caching #15900
jumpstart / git-caching #15900
Conversation
10125db
to
5b0a27d
Compare
5b0a27d
to
e8a1e24
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.
Thanks! Aside from the naming question (hardest of all!) my biggest worry is about the split. The rest is small local issues which should hopefully be easy to fix.
e8a1e24
to
748602e
Compare
d637e2b
to
557af25
Compare
the pixel tests commit was a disaster, so I've dropped it. |
packit fails with
I'm ack'ing github-changes here, mostly want to see it being removed by the next force-push again 😁 |
557af25
to
355e2e2
Compare
Uh. Oops? The deconstruction of the |
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.
The fine-grained stuff is fine now, thanks for the fixes! Now we just need to talk about the outstanding issue above (not having two scripts which do almost the same thing, and defining its purpose). "script that does something" is not good enough, sorry 😁
355e2e2
to
7b987cf
Compare
So there are two separate scripts here, that actually don't have a lot to do with each other, in my opinion. One script takes a fresh repository and pre-seeds it with some nice stuff to get you up and running as fast as possible. It's very logically called "jumpstart", because that's what it does. The other script builds a tarball from a repository, using the best means available (possibly including #1, but not always) and tells you the path to the tarball. It's very logically called "make dist", because that's what it does. Let's chat tomorrow :) |
How about tools/webpack-jumpstart? That aligns with tools/webpack-{make,watch} and at least says what it jumpstarts. Maybe that's the sort of good compromise that makes us about equally (but hopefully not too much) grumpy 😁 |
I'm fine with the name, if it needs to be that way (although it pushes against my plans to also add a bots checkout). The only real issue remaining here is what to do with Thoughts? |
7b987cf
to
ad7425b
Compare
As discussed, the latest changes:
|
ad7425b
to
ed18334
Compare
Adding blocked, as @allisonkarlitskaya told me on IRC to hold off on this. Also, this needs integration test runs. |
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.
Thanks! Found a few more little issues, but nothing important -- ok for me to land as-is once you are happy. I'll trigger a few tests over night to get some results.
@@ -0,0 +1,50 @@ | |||
#!/bin/sh | |||
|
|||
# Download pre-built webpack for current git SHA from GitHub |
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 think this should say dist/. As you noticed today, there's dist/guide which isn't a webpack, and the corresponding workflow is also called build-dist, not build-webpack. I wouldn't mind to rename the script accordingly as well (dist-jumpstart, or download-dist), but I feel for this PR I've already used up my quota of name bikeshedding; I can certainly live with the current one 😁
The other test failures are known flakes, but this one looks relevant:
|
I have absolutely no idea why that would be the case, particularly considering the build, running in the exact same tasks container, is working for all of the other images. Maybe some weird race? Ugh. |
`make dist` has been flooded with warnings about binary files (mostly fonts) matching some unspecified grep pattern. Turns out that was coming from our copyright scanning attempts. Just ignore those files.
Create a new file called git-utils.sh which can be used as a basis for our growing number of utilities which download various subdirectories from git. This is mostly a port of functionality from tools/node-modules, with changes and some minor additions.
Port tools/make-bots to git-utils.sh. The main benefit of this change is that we handle the caching in the same way as the other repositories now. Previously, we'd only use a cache directory if it already existed, and we'd never try to keep it up to date. The improved caching also presents an interesting opportunity: if the OFFLINE environment variable is set to a non-zero value and the local cache is available, it becomes possible to checkout bots/ without network access.
Make use of the new git-utils.sh functions to write a small "jumpstart" helper script which can be used to get a node_modules/ and dist/ of a freshly-checked-out cockpit tree. Most of this functionality comes from test/make_dist.py, which is now rewritten to use the new script. The main difference is that we only unpack dist/. Before unpacking, we add an additional check that package-lock.json from the dist tree is equal to the one we have locally. This has two benefits: - to ensure that we don't have a mismatched cache for the local tree - forcing the fetch of package-lock.json (and node_modules/ generally) to occur before unpacking dist/ is a way of ensuring the the timestamps will be correct: dist/ will be newer.
ed18334
to
6314fc4
Compare
Pretty sure I figured it out, and it was cool: an interrupted (or concurrently running) Performing a simple lookup with I'm pretty sure one of our runners ended up with its cache corrupted in exactly this way, which is why this test kept failing, but only for some attempts. I moved the check over to a full connectivity-checking fsck call instead. That should catch this issue. In that case we'll redo the fetch. |
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.
Thanks! Green, and the misleading comment above is not that important. I'm sure that we'll touch this stuff more 😁
The summary:
git-utils.sh
which contains a common implementation of the logic for maintaining and using a cache of a git repository of a given name relative toGITHUB_BASE
, with utilities for checking it out to various different places in the cockpit treetools/node-modules
tools/make-bots
use that fromtest/common/pixel-tests
tools/jumpstart
test/make_dist.py
dist/
andpackage-lock,json
tocockpit-dist