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

chore: Simplify publish_docs workflow #749

Merged
merged 3 commits into from
Aug 30, 2024
Merged

Conversation

jrconlin
Copy link
Member

(note: this is a re-submit of #747 to resolve CI issues.)

from janbrasna

The current docs build takes several minutes, the toolchain setup doesn't really do anything, and the workflow is triggered from unexpected events (probably not doing what it was believed to do) — so this is an attempt to simplify, and speed up. The main issues are:

the curl doesn't run due to -y error; OTOH neither rustup nor cargo

needs any manual setting up here…
the on:check_run doesn't imply successful build, but more
importantly triggers also outside of master/PRs basically on any branch anywhere commit checks are run, publishing docs on pretty much any push to any ref unnecessarily.
something in the build of validator_derive (either validator, grpcio
or google-cloud-rust-raw) takes ~6-7mins to build, basically 99% of the whole workflow run, so question is whether to switch to binaries or caching?
The used Node 16 actions raise deprecation warnings, need updating.

Logs:

before: runs/10327553562 (triggered from RRM181 PR check that hasn't

landed yet)
after: job/28971156482#step:6:1
after cache: job/28972053092#step:6:1

More detailed explainers are in the changeset.

(note: this is a re-submit of #747 to resolve CI issues.)

from [janbrasna](https://github.com/janbrasna)

The current docs build takes several minutes, the toolchain setup
doesn't really do anything, and the workflow is triggered from
unexpected events (probably not doing what it was believed to do) — so
this is an attempt to simplify, and speed up. The main issues are:

    the curl doesn't run due to -y error; OTOH neither rustup nor cargo
needs any manual setting up here…
    the on:check_run doesn't imply successful build, but more
importantly triggers also outside of master/PRs basically on any branch
anywhere commit checks are run, publishing docs on pretty much any push
to any ref unnecessarily.
    something in the build of validator_derive (either validator, grpcio
or google-cloud-rust-raw) takes ~6-7mins to build, basically 99% of the
whole workflow run, so question is whether to switch to binaries or
caching?
    The used Node 16 actions raise deprecation warnings, need updating.

Logs:

    before: runs/10327553562 (triggered from RRM181 PR check that hasn't
landed yet)
    after: job/28971156482#step:6:1
    after cache: job/28972053092#step:6:1

More detailed explainers are in the changeset:
@jrconlin jrconlin requested review from pjenvey and taddes August 26, 2024 17:32
- uses: actions/checkout@v3
- name: Configure rust # TODO: can we export building rust and installing mdbook as an artifact and reuse it?
run: |
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment
cargo is now a part of the distribution core and we no longer need to import it directly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we still possibly run rustup update? There may be a variance between the distro version and what's currently available.

Copy link
Contributor

@janbrasna janbrasna Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's kept uptodate in the runners #747 (comment) ~ and trying to update it manually only triggers warnings #747 (comment) because rustup isn't managing parts of the toolchain: #step:3:16

(similar to installing cargo audit elsewhere janbrasna#step:3:10 … as long as it's in the env setup, it's unnecessarily noisy in the logs then trying to install it manually, IMO better to skip and rely on the env for sanity;)…)

# or run if pushes to these files.
# paths:
# - 'docs/**.md'
check_run:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment

Copy link
Contributor

@taddes taddes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just added 2 comments/questions that aren't blocking.

group: "pages"
cancel-in-progress: true
group: github-pages
cancel-in-progress: false # Skip any intermediate builds but finish deploying
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question: do we for sure want a successful deploy should something in docs build fail? I wonder if this would result in us missing failed doc builds. However, it's not critical to the service health so I get the rationale here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is related to the concurrency lines directly, then they don't change anything about success of the builds. They only manage how many docs workflow runs can queue in succession, always skipping anything between the first and the last run for this concurrency group. It only changes one thing: don't cancel the one already running and wait for it to finish before starting the most recent.
(the rationale is: you never know if the newer build will be {more} successful, so chances are if the running job can deploy, let it deploy on success… in case the newer run won't build etc.)

This won't change any failed builds behaviour at all. These still fail loudly, and notify accordingly #747 (comment) — and won't deploy if the build fails.

- uses: actions/checkout@v3
- name: Configure rust # TODO: can we export building rust and installing mdbook as an artifact and reuse it?
run: |
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we still possibly run rustup update? There may be a variance between the distro version and what's currently available.

@jrconlin jrconlin merged commit 9fb9fb3 into master Aug 30, 2024
1 check passed
@jrconlin jrconlin deleted the docs/747-simplify_docs branch August 30, 2024 19:56
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 this pull request may close these issues.

3 participants