dongjoon-hyun commented on code in PR #60216: URL: https://github.com/apache/spark/pull/60216#discussion_r4516203508
########## .github/workflows/build_maven.yml: ########## @@ -21,7 +21,7 @@ name: "Build / Maven (Scala 2.13, JDK 21)" on: schedule: - - cron: '0 13 */2 * *' + - cron: '17 18 1-31/3 * *' Review Comment: Since `1-31/3` includes the 31st, phase-1 workloads run on the 31st and again on the 1st of the next month (also Feb 28 -> Mar 1 in non-leap years). That's about 8 one-day gaps per year for each of the 17 phase-1 workloads, so phase 1 runs ~127 times a year while phases 2 and 3 run ~119 times. This applies to every `1-31/3` cron in this PR. How about `1-28/3` for phase 1? It keeps the same dates except the 31st. In addition, phase 1 has the most workloads (17 vs. 16 and 16, and only 05 UTC is idle), so moving one of them to an idle slot of phase 2 (16 or 20 UTC) or phase 3 (02 or 23 UTC) would balance the phases. ########## .github/workflows/pages.yml: ########## @@ -21,9 +21,9 @@ name: GitHub Pages deployment on: # Deploy once a day instead of on every push to master, to save CI resources. - # This runs after the daily docs image refresh in build_infra_images_cache.yml (04:00 UTC). + # The docs image cache is refreshed by build_infra_images_cache.yml. schedule: - - cron: '30 12 * * *' + - cron: '30 1 * * *' Review Comment: Previously, Pages ran 8.5 hours after the 04:00 refresh. Now the gap is 73 minutes (00:17 -> 01:30). In recent history, `0 0` scheduled runs in this repo started 23-41 minutes late, and the `Build and push (Documentation)` step took up to ~14 minutes. If the 00:17 run is delayed similarly, the margin is only about 15 minutes, and Pages can be built with the previous day's docs image on a slower day. Also, this comment no longer says that Pages should run after the docs image refresh, so a future change of either cron could silently reverse the order. Could we keep the ordering note with the new time (e.g. `This runs after the daily docs image refresh in build_infra_images_cache.yml (00:17 UTC).`) and leave a larger gap? For reference, SPARK-60867 picked 12:30 UTC because the refresh had finished by 05:32 UTC at the latest and it was one of the quietest CI periods. ########## .github/workflows/build_infra_images_cache.yml: ########## @@ -26,7 +26,7 @@ on: # scheduled rebuild, the cache goes stale between Dockerfile changes # and every commit on every PR spends ~50 minutes building base images! schedule: - - cron: '0 4 * * *' + - cron: '17 0 * * *' Review Comment: This is the most important daily scheduled job. As the comment above says, a stale cache makes every PR spend ~50 minutes building base images. However, 00 UTC is the busiest hour for GitHub scheduled runs. In this repo's recent runs, `0 0` scheduled runs started 23-41 minutes late, vs. 8-22 minutes for the `0 4 * * *` cache runs and 3-5 minutes for the `30 12 * * *` Pages runs. Minute 17 may help, but it hasn't been measured, and GitHub may drop scheduled runs under high load. So I'd prefer to keep the cache refresh (and Pages after it) out of 00 UTC, and not to make `Reserve 00 and 01 UTC for daily workflows` a README rule that future daily workflows will follow. BTW, that rule also doesn't account for `update_build_status.yml`, which runs every 15 minutes. ########## .github/workflows/branch4x_scheduler.yml: ########## @@ -21,14 +21,14 @@ name: "Branch-4.x CI Scheduler" on: schedule: - - cron: '0 4 */2 * *' - - cron: '0 7 */2 * *' - - cron: '0 11 */2 * *' - - cron: '0 16 */2 * *' - - cron: '0 18 */2 * *' - - cron: '0 19 */2 * *' - - cron: '0 21 */2 * *' - - cron: '0 22 */2 * *' + - cron: '17 4 3-31/3 * *' + - cron: '17 7 1-31/3 * *' + - cron: '17 10 2-31/3 * *' + - cron: '17 11 2-31/3 * *' Review Comment: Maven builds are the heaviest scheduled builds (1.5-4 hours in recent runs), but they are not evenly distributed across phases: phase 1 has 2 (master Maven, branch-4.3 Maven Java 21), while phases 2 and 3 have 4 each. In particular, branch-4.x Maven (10:17) and Maven Java 21 (11:17) start one hour apart on the same phase-2 days, so they run concurrently for most of their duration. Phase 3 also starts Maven builds at 06:17, 08:17, 11:17, and 14:17. Since one of the goals is to reduce concurrent job pressure, could we swap some Maven builds with lighter phase-1 workloads so that each phase has about three, and put these two branch-4.x builds in different phases? ########## .github/workflows/README.md: ########## @@ -11,6 +11,21 @@ The Apache Software Foundation (ASF) imposes [resource usage limits][limit] on G [limit]: https://infra.apache.org/github-actions-policy.html [usage]: https://github.com/apache/spark/actions/metrics/usage +### Scheduled workflow cadence + +Use daily maintenance schedules and three-day or weekly build schedules to limit +runner consumption while retaining regular coverage. Reserve 00 and 01 UTC for +daily workflows and 03, 09, 15, and 21 UTC for weekly workflows; distribute +three-day workflows across the remaining hours and three day-of-month phases. +Spread weekly workflows across weekdays and use minute 17 for rescheduled builds +to avoid GitHub Actions' busy [start-of-hour scheduling period][schedule-event]; +the specific minute is arbitrary. These assignments spread runner demand without +ranking jobs by importance, and individual intervals can be shortened when +faster feedback is needed. Day-of-month phases restart monthly, and delayed +starts or long runs can still overlap. Review Comment: nit: The other paragraphs in this README are written as a single line, while this one is wrapped at ~80 columns. Could we follow the existing style? ########## .github/workflows/branch35_scheduler.yml: ########## @@ -21,7 +21,7 @@ name: "Branch-3.5 CI Scheduler" on: schedule: - - cron: '0 11 */4 * *' + - cron: '17 3 * * SUN' Review Comment: Minor: this is now the only trigger that dispatches two heavy builds (Scala 2.13 and Python 3.9) at the same time, while this PR splits branch-4.0's previously shared triggers and the README talks about spreading runner demand. Adding one more cron in a free weekly slot (e.g. `17 9 * * SUN`) for one of them would make it consistent. Not a blocker. ########## .github/workflows/branch41_scheduler.yml: ########## @@ -21,14 +21,14 @@ name: "Branch-4.1 CI Scheduler" on: schedule: - - cron: '0 2 */2 * *' - - cron: '0 5 */2 * *' - - cron: '0 9 */2 * *' - - cron: '0 10 */2 * *' - - cron: '0 12 */2 * *' - - cron: '0 13 */2 * *' - - cron: '0 15 */2 * *' - - cron: '0 17 */2 * *' + - cron: '17 2 2-31/3 * *' + - cron: '17 4 1-31/3 * *' + - cron: '17 7 3-31/3 * *' + - cron: '17 8 3-31/3 * *' + - cron: '17 14 1-31/3 * *' + - cron: '17 17 2-31/3 * *' + - cron: '17 17 3-31/3 * *' + - cron: '17 22 3-31/3 * *' Review Comment: +1 for @nchammas's earlier suggestion to deduplicate these. With this PR, 41 cron literals across six schedulers have to be kept in sync between `on.schedule` and the `if:` conditions, and the latest revision also removed the README note asking to update both. If only one side changes, the build is skipped forever without any error, and actionlint doesn't catch it. Since each `if:` is a single expression string, a YAML alias cannot be embedded in it directly. One option is to alias each cron into a job-level `env` entry and compare with `env.*`. A small consistency check script would also work. This can be a follow-up. ########## .github/workflows/stale.yml: ########## @@ -21,7 +21,7 @@ name: Close stale PRs on: schedule: - - cron: "0 0 * * *" + - cron: '30 0 * * *' Review Comment: nit: This also changes the existing double quotes to single quotes. Could we keep the double quotes (`"30 0 * * *"`) to minimize the diff? ########## .github/workflows/branch40_scheduler.yml: ########## @@ -21,11 +21,13 @@ name: "Branch-4.0 CI Scheduler" on: schedule: - - cron: '0 2 */4 * *' - - cron: '0 5 */4 * *' - - cron: '0 12 */4 * *' - - cron: '0 14 */4 * *' - - cron: '0 16 */4 * *' + - cron: '17 3 * * THU' + - cron: '17 9 * * WED' + - cron: '17 9 * * SAT' + - cron: '17 15 * * SAT' + - cron: '17 21 * * TUE' + - cron: '17 21 * * THU' + - cron: '17 21 * * SAT' Review Comment: This is the first time named weekdays (`SUN`-`SAT`) are used together with `github.event.schedule == '...'` comparisons in this repo, and the GitHub docs example uses numeric weekdays (`'30 5 * * 1,3'`). I believe `github.event.schedule` carries the cron string as written, but if GitHub normalized it (e.g. to `17 3 * * 4`), all these conditions would be false, and the 7 branch-4.0 builds (and the 2 branch-3.5 builds) would be skipped silently while the scheduler run succeeds. Did you verify this? If not, we can check the first scheduled run after merge, or use numeric weekdays to avoid the question. ########## .github/workflows/publish_snapshot.yml: ########## @@ -21,7 +21,7 @@ name: Publish snapshot on: schedule: - - cron: '0 0 */2 * *' + - cron: '17 12 3-31/3 * *' Review Comment: This changes SNAPSHOT publishing for all 7 branches from every 2 days to every 3 days, with gaps up to 4 days at month boundaries (5 days from Feb 27 to Mar 3 in leap years). Downstream users of the ASF snapshot repository will get new artifacts less frequently, so it would be good to mention this in the PR description (`Does this PR introduce any user-facing change?`) instead of `No`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
