-
Notifications
You must be signed in to change notification settings - Fork 454
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
[build] Update makefiles and CI config to enable W3C autopublishing #1730
Conversation
7568764
to
311cea0
Compare
311cea0
to
9d2d273
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.
Excellent, thanks, this looks good. My only concern is that the new publish-to-w3c action redoes everything from scratch. Installing the prerequisite software and doing the Sphinx build already takes significant time on CI. To reduce turnaround time and save resources, wouldn't it be better to move the new build steps to the existing build targets, so that it reuses their work? That would also avoid failing twice in case the build has errors.
Short answer:
Longer answer
So the problem there is: Bikeshed needs to be run twice on each of the specs anyway — at least if we want the https://webassembly.github.io/spec/ Bikeshed versions to retain the “Editor’s Draft” formatting they have now, rather than instead having the formatting of those change to being the same “Working Draft” formatting that the https://www.w3.org/TR versions have. If the editors and the groups chairs are were OK with instead changing the https://webassembly.github.io/spec/ versions to have the same “Working Draft” formatting that the https://www.w3.org/TR/ versions have, then we’d need to run Bikeshed only once on each spec. I’d personally be fine with the https://webassembly.github.io/spec/ versions having the “Working Draft” formatting — and as far as I’m aware, W3C policy doesn’t explicitly prohibit us from doing so. That said, I think that in general, W3C management would prefer that the “Working Draft” formatting only be used for the versions published at https://www.w3.org/TR/ URLs. But I think we could still try it if we wanted to, and see if anybody notices and asks us to stop doing it (in which case, we’d just flip it back). But otherwise, to retain the “Editor’s Draft” formatting of the https://webassembly.github.io/spec/ versions means that we have to first run
As far as the time requirements, one thing to note is: the In other words, the existing CI takes about 6.5 minutes to complete, and the patch in this PR doesn’t increase that. All that said, as far as resource usage, it’s true that the current patch in this PR as currently written does basically doubles the resource usage — and I guess there are few changes that could be made to decrease that. As far as exactly what changes could be made: The opportunities to make changes to the makefiles to reduce the resource usage of the build itself are very few — because:
However, I guess we could factor the Sphinx part of that That’d probably cut 30 seconds out of the 6 minutes and 30 seconds the But the bigger savings would probably come from making changes to the So I’ll try that first — both because it’s quicker and easier to try then refactoring the |
9d2d273
to
9b4e7b7
Compare
4673795
to
ddb1751
Compare
OK, I tried that in ddb1751 but quickly discovered it doesn’t work — and won’t work. And for the record here, the reason is: each job runs on a different, new machine/runner. So there’s no way to preserve shared state/environment among jobs. Apparently this is a fundamental characteristic of GitHub Actions that people generally know or are expected to know… |
2316c2a
to
f1f57b6
Compare
So, given that for CI we can’t share any environment among jobs, that makefile change wouldn’t actually buy us anything useful for reducing CI resource usage. It’d instead just help someone locally running the W3C-echidna target. And in practice I’m the only person who’d ever being doing that. And so, seems to be no real value to doing that refactoring. |
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, the biggest time & resource sink in CI is setting up the prerequisite software. But you can't share that across actions, you can only share artefacts via "upload". That's why I suggested just moving the new build steps into the existing build jobs and upload the results for the publication job, like with publish-spec.
But don't worry about it, I can have a stab at refactoring that later.
FWIW, I'd actually be fine just having the WD version on the github.io page. In fact, that's probably less confusing to users than seeing two differently looking documents on both sites and having to wonder how they relate to each other.
(Btw, please never force-push to a branch under review, as that breaks GH's review process, e.g., reviewers won't be be able to see relative diffs, code comments become orphaned, etc.)
Yeah, I’d vaguely recalled that being the case, but it didn’t sink back in until today when I tried the ci-spec.yml refactoring.
OK. When you try it, at https://github.com/w3c/echidna/wiki/How-to-use-Echidna#tar-file you can find the current documentation on how the W3C publishing HTTP API works. But essentially it’s just going to be this:
…where:
So, I assume what the refactoring you have in mind would need to amount to is: the CI config would be changed to construct the necessary tar files (
OK — I guess the first step for that would just be changing the existing
Yeah, that’s how it seems to me as well.
OK |
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.
Feels like a lot of duplicated code in the makefiles, but let's get this to work first and refactor later if needed
@sideshowbarker, is there anything missing for merging this? |
Nope, nothing missing — it’s ready to be merged |
@sideshowbarker, today CI failed on the publish-to-w3c target for an unrelated PR: https://github.com/WebAssembly/spec/actions/runs/8133065435/job/22233472624?pr=1737 Do you have an idea what the problem could be? |
https://github.com/WebAssembly/spec/actions/runs/8133065435/job/22233472624?pr=1737#step:7:3005 says:
…but at https://github.com/WebAssembly/spec/blob/main/.github/workflows/ci-spec.yml#L124 , the CI build sets Line 12 in 89f7ced
… And this was working on the PR branch previously, so it still should be. But I’ll investigate it further, and see what could be causing it to not find what it needs. |
OK, first clue: Looking at https://pipelinesghubeus4.actions.githubusercontent.com/k4KMVVeRi9EEw2vuQiOaD2iDjWSjf8j5KDSnrjfdb62mXBfQf1/_apis/pipelines/1/runs/1014/signedlogcontent/2?urlExpires=2024-03-04T12%3A23%3A05.0263402Z&urlSigningMethod=HMACV1&urlSignature=UGaJewwi8Aq1yCtlo9EA1LTL5QbS246pUMl61Bjn2RI%3D raw log for the #1730 PR branch before we merged, I see:
…that is, But looking at the https://productionresultssa7.blob.core.windows.net/actions-results/30af3ce5-e11e-4563-9de1-5e3353d34795/workflow-job-run-fc640d00-b954-5c7a-fd14-93d46735bd61/logs/job/job-logs.txt?rsct=text%2Fplain&se=2024-03-04T12%3A35%3A20Z&sig=ukrXt2zBkNU6erLQB9OnzbzDiyLKl9l1APnloNKODeo%3D&sp=r&spr=https&sr=b&st=2024-03-04T12%3A25%3A15Z&sv=2021-12-02 raw log for the #1737 PR branch, I instead see:
…that is, no asterisks. So, apparently GH Actions isn’t retrieving the |
OK, looking at https://github.com/WebAssembly/spec/settings/secrets/actions, I see these statements:
So, because the #1737 PR is from a fork, I guess it’s expected behavior that GH Actions for that PR won’t have access to the repository secrets. If so, I think there’s no way to expose repo secrets to GH Actions for PRs from forks — it seems to be prevented by design. Given that, I guess it means that we could only auto-publish to W3C TR for PRs from branches in the repo itself — which requires the authors to have commit/push perms for this repo — and for merges to the main branch. |
Thanks for looking into it! Now that you mention it, in fact PRs should probably never cause a push to the w3c repo, only actual pushes to the main branch should. That probably means that we'll have to split the publish-to-w3c job into a separate workflow file without the |
OK
Yeah, it seems like it would |
OK, opened #1738 for that |
No description provided.