Skip to content

Move worker downtime configuration to workers.py#701

Open
encukou wants to merge 4 commits intopython:mainfrom
encukou:config-cleanup-downtime
Open

Move worker downtime configuration to workers.py#701
encukou wants to merge 4 commits intopython:mainfrom
encukou:config-cleanup-downtime

Conversation

@encukou
Copy link
Copy Markdown
Member

@encukou encukou commented Apr 10, 2026

We use builder.canStartBuild for scheduled downtime, which is per-worker configuration.
Move it out of master.cfg to the appropriate places:

  • config in workers.py
  • implementation details in a new module, worker_downtime.py

This applies ambv-bb-win11's maintenance window to the PR builds, for which it was left out in GH-589.

encukou added 4 commits April 10, 2026 15:35
The `canStartBuild=no_builds_between(...)` configuration is used
for regular maintenance windows (restarts/reprovisions) and
quiet periods for benchmark runs.

- Rename to `downtime`; canStartBuild & quarantining are implementation details.
- Move configuration to workers.py.
- Move implementation to new module, worker_downtime.py
Copy link
Copy Markdown
Member

@zware zware left a comment

Choose a reason for hiding this comment

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

LGTM (barring one comment).

STABLE,
ONLY_MAIN_BRANCH,
)
from custom.worker_downtime import no_builds_between
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like a phantom import?

Suggested change
from custom.worker_downtime import no_builds_between

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The ZoneInfo import can also be removed.

# Builds scheduled between 8am - 10am PT on Wednesdays will be delayed to
# 10am PT.
itamaro_downtime = no_builds_between(
"8:00", "10:00", day_of_week=2, tz=ZoneInfo("America/Los_Angeles")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You might add WEDNESDAY = 2 to worker_downtime.py for extra clarity.

STABLE,
ONLY_MAIN_BRANCH,
)
from custom.worker_downtime import no_builds_between
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The ZoneInfo import can also be removed.

Copy link
Copy Markdown
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

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