Skip to content

feat(roadmap): pause new Service work for a maintenance window #7454

Description

@dan-petty

Problem

The maintenance window of dan-petty/homelab (README.md, "Maintenance Window", step 1) starts a node step only when no work runs: no active Job, no running Workflow, no Argo CD sync or rollout, no runner pod. The roadmap Service starts its stage, implement and fix Jobs in namespace devops without a pause, so that check rarely passes.

On 2026-11-27 an agent waited from 16:07 to 18:38 UTC to run dan-petty/homelab#558 (a cordon and a k3s-agent restart of three agent nodes, then a k3s restart of the server). In that time the check never passed: stage Jobs of dan-petty/homelab#522, #4566, dan-petty/homelab#292 and #7318 followed each other (deadline 3 h each), and a rag-ingest Workflow ran. No command of devops-cli stops the Service from starting new Jobs: devops ai quiesce sets a flag and stops nothing.

Proposed remedy

A Service setting or command that stops the start of new Jobs and Workflows, lets the running ones end, and starts them again after the window, with the state visible in the Service status. The window then runs: pause, wait for quiet, step, resume. A pause that is still on after a set time ends by itself, so a failed window does not stop the roadmap.

Acceptance

  • One command (or setting) pauses the start of new Service Jobs and Workflows; a running Job ends normally; a second command resumes.
  • devops roadmap status (or the Service status) shows the pause and its end time.
  • A test fails on the base for each of: no new Job starts while paused; work starts again after the resume or after the end time.
  • The homelab README "Maintenance Window" names the pause and the resume as steps.

Alternatives check of 2026-11-27: partly.
Tool: kubernetes-sigs/kueue (https://github.com/kubernetes-sigs/kueue), Apache-2.0, last activity 2026-11-27, maintained.
Reason: Kueue's ClusterQueue stopPolicy Hold stops new Jobs while running Jobs finish and None resumes, but it does not pause Workflows, expire automatically, or show in the Service status.

Covers:

  • Stops admission of new Jobs with ClusterQueue stopPolicy Hold
  • Lets running Jobs finish instead of evicting them
  • Resumes admission when stopPolicy returns to None
  • ClusterQueue status marks inactive admission

Lacks:

  • No pause for Argo Workflows
  • No automatic expiry or end time
  • No devops roadmap or Service pause status
  • Service Jobs must be submitted through Kueue queues

Proposed design

Problem statement

The maintenance window of dan-petty/homelab runs a node step only when no roadmap work runs. The roadmap Service starts new runner Jobs at any time, so the window waits for hours. A pause command stops new runner Jobs, lets running Jobs end, resumes, and ends by itself at a set time. The Service status shows the pause.

Acceptance criteria

Requirement: Pause records the end time

devops roadmap pause --until <time> SHALL write the pause key in the shared Valkey state with the end time and a TTL that ends at that time.

Scenario: Pause writes the key with a TTL

  • WHEN devops roadmap pause --until 2026-11-27T18:00:00Z runs against a fake Valkey client
  • THEN the key roadmap:pause holds 2026-11-27T18:00:00Z and its TTL is the number of seconds from now to that time

Requirement: Pause requires an end time

devops roadmap pause SHALL refuse a call with no --until time and exit with a usage error.

Scenario: Pause without end time is refused

  • WHEN devops roadmap pause runs with no --until option
  • THEN the command exits with code 2 and prints a usage error that names --until

Requirement: Service poll creates no Job while paused

The Service poll MUST create no new runner Job while a pause is in force.

Scenario: Paused poll creates no Job

  • WHEN the Service _poll method runs with a pause in force and a due roadmap job
  • THEN the poll calls no job_launcher.launch and logs the pause end time

Requirement: Running Job ends normally

The pause command and the Service poll MUST NOT delete or evict a runner Job that already runs.

Scenario: Running Job keeps its result

  • WHEN a pause is set while a runner Job runs
  • THEN the pause command and the Service poll make no Kubernetes delete or evict call for that Job

Requirement: Resume clears the pause

devops roadmap resume SHALL delete the pause key, so that the next Service poll creates a runner Job.

Scenario: Resume clears the key

  • WHEN a pause is in force and devops roadmap resume runs against a fake Valkey client
  • THEN the pause key is gone and the next Service poll calls job_launcher.launch

Requirement: Pause ends by itself

A pause MUST end at its end time when no command runs.

Scenario: Expired pause starts work

  • WHEN the end time of the pause has passed and the Service poll runs
  • THEN the pause key has expired and the poll calls job_launcher.launch

Requirement: Service status shows the pause

The Service status route GET /api/v1/status SHALL include the pause and its end time when a pause is in force.

Scenario: Status response includes the pause

  • WHEN GET /api/v1/status runs while a pause is in force
  • THEN the JSON response holds pause.until with the end time in UTC

Existing Tool Considered

kubernetes-sigs/kueue (https://github.com/kubernetes-sigs/kueue), verdict partly. The alternatives check in the issue body lists what the tool covers and lacks. The proposal does not adopt Kueue. Each Service Job would need a Kueue queue. Kueue does not pause Workflows, expire automatically, or show in the Service status. The pause does what Kueue lacks. It uses a Valkey key with a TTL for expiry. It gates the Service poll before job_launcher.launch. It adds the pause to the Service status route. The Workflow pause is deferred to a new issue that waits on #4566. Cost to build the pause instead: about 70k tokens to build, keep and fix the code, and about 2 days elapsed.

Key questions

  • Which component starts the work of the Service while the sweep does not exist?: The Service poll in src/devops_cli/server/service.py starts the work. Its _tick_loop and _poll methods call job_launcher.launch to create a runner Job. The pause gate belongs in that poll, before the launch. The future sweep from feat(roadmap): run the reconcile sweep on a cluster schedule #4574 must call the same gate. [sources: src/devops_cli/server/service.py:997-1035, src/devops_cli/roadmap/job_launcher.py:111, CONTEXT.md]
  • Where does the pause state live?: The pause state lives in the shared Valkey state as one key with the end time and a TTL that ends at that time. The Service poll reads the key and creates no runner Job while it is present. (best practice) [sources: CONTEXT.md, k8s/devops/roadmap-service/deployment.yaml]
    • Chosen: Valkey key with a TTL. The Service already reads the shared Valkey state, and the TTL ends the pause with no second writer.
    • Rejected: Kueue ClusterQueue stopPolicy Hold. It covers Jobs only, has no end time and shows nothing in the Service status.
    • Rejected: Suspend field of the Service CronJobs. It stops a schedule only, sets no end time, and the Service creates a Job for an item itself.
    • Rejected: A file in the configuration. Each replica reads its own copy, and a file has no expiry.
  • Which work does the pause stop?: The pause stops the start of new runner Jobs only. The Service poll creates no Job, and the pause deletes no running Job. A running Job ends with its own result. The pause stops the Service poll only. A person's manual command still starts a Job. The Workflow submission path does not exist yet, so this issue defers the Workflow pause to a new issue that waits on feat(k8s): let Argo Workflows run roadmap pods in devops #4566. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/job_launcher.py:11-12, src/devops_cli/server/service.py:997-1035]
    • Chosen: Stop new runner Jobs only. A maintenance window needs the running Job to end by itself, and a cancel loses the work of that Job.
    • Rejected: Stop new Jobs and cancel running Jobs. A cancel loses the work of a Job and leaves a half-written branch.
    • Rejected: Stop the poll of the Service. The poll reconciles the state of each item, so the pause holds only the creation of a Job (ADR 0017).
  • How does the pause end?: The end time is required: --until <time> sets it, and the TTL of the key ends the pause with no command. A pause with no end time is refused. (best practice) [sources: CONTEXT.md]
    • Chosen: Required end time, held by a TTL. The pause ends at the time that the person names, and a failed window cannot stop the roadmap.
    • Rejected: Default duration of 3 hours. A forgotten pause then stops the roadmap for the length of a stage deadline.
    • Rejected: A reaper sweep that deletes an expired key. It adds a second writer and code, where the TTL already ends the pause.
  • Does the pause reuse the flag of devops ai quiesce?: No. devops ai quiesce sets a flag that stops no Job. The pause is a separate key, so a change of the AI quiesce flag changes no roadmap work. (best practice) [sources: docs/CLI_REFERENCE.md, CONTEXT.md]
    • Chosen: A separate pause key. One key has one meaning, and a caller of quiesce never stops a roadmap Job.
    • Rejected: Reuse the quiesce flag. It names AI calls, and its meaning would change for each caller.
  • How does a person see the pause?: The Service status route GET /api/v1/status includes the pause and its end time in UTC. devops roadmap status does not exist, and this issue does not create it. The Service status is the status that the window step reads. (best practice) [sources: src/devops_cli/server/routes/status.py:41, docs/ROADMAP_WORKFLOW.md]
    • Chosen: Add the pause to the Service status route. The route already exists, and the issue body accepts the Service status as the place to show the pause.
    • Rejected: Create devops roadmap status. It adds a new command and its tests, where the Service status route already serves the window step.
    • Rejected: Only the log of the Service. A person must see the pause and its end time in the window step.
  • What happens to the pause of Argo Workflow submission?: This issue defers it. The Service has no queued Argo Workflow path: job_launcher.py says a WorkflowLauncher takes its place after feat(k8s): let Argo Workflows run roadmap pods in devops #4566, and submit_workflow has one caller, devops argo workflows submit. The new issue waits on feat(k8s): let Argo Workflows run roadmap pods in devops #4566. [sources: src/devops_cli/roadmap/job_launcher.py:11-12, src/devops_cli/argo/crd.py:381, src/devops_cli/commands/argo.py:730]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Moved to new items

#7575, #7820

Activity

  1. added
    type/feature
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 27, 2026
  2. dan-petty commented on Nov 27, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 27, 2026
  4. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (10)

    Tools considered:

    Searches run:

    • Argo Workflows suspend CronWorkflow pause resume workflow controller, results: 5
    • Kubernetes pause new Jobs suspend job controller resume after time tool, results: 5
    • Argo Workflows CronWorkflow suspend field documentation, results: 5
    • Kubernetes CronJob suspend field documentation, results: 5
    • KEDA ScaledJob suspend pause field, results: 5
    • argoproj argo-workflows cron workflow suspend, results: 5
    • kubernetes cronjob suspend official docs, results: 5
    • keda sh scaledjob paused annotation, results: 5
    • "suspend" "CronWorkflow", results: 5
    • Argo CD sync windows pause, results: 5

    Sources:

  5. added
    status/ready
    and removed
    status/new
    on Nov 28, 2026
  6. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  7. dan-petty commented on Nov 29, 2026

    @dan-petty
    OwnerAuthor

    Returning #7454 to New: this item cannot be built as written because multiple prerequisites named in its requirements, scenarios, and key questions do not exist on main (Dependencies says None).

    Observed evidence on main and GitHub:

    1. No cluster sweep exists yet (Requirement: No unit of work starts while paused):

      • CONTEXT.md:157-159 documents: Until #4574 merges, the poll of the Service does this work.
      • Issue #4574 (feat(roadmap): run the reconcile sweep on a cluster schedule) is still OPEN, and the related ADR 0021 Valkey shared-state items #4563, #4564, and #4565 are also OPEN. src/devops_cli/server/service.py:997-1035 still runs _tick_loop / _poll.
    2. No Service Argo Workflow submission or queue exists (Requirement: Workflow submission stops):

      • src/devops_cli/roadmap/job_launcher.py:11-12 documents: A WorkflowLauncher takes this place after the engine step (#4566).
      • Issue #4566 (feat(k8s): let Argo Workflows run roadmap pods in devops) is still OPEN.
      • submit_workflow (src/devops_cli/argo/crd.py:381) has only one caller across src/devops_cli/: src/devops_cli/commands/argo.py:730 (devops argo workflows submit). Today implement, fix-checks, infra-plan, and stage launch Kubernetes Jobs via job_launcher.launch (src/devops_cli/roadmap/job_launcher.py:111), and the Service has no queued Workflow path.
    3. No devops roadmap status command exists (Requirement: Status shows the pause):

      • src/devops_cli/commands/roadmap.py:62-82 registers no status subcommand (only src/devops_cli/server/routes/status.py:41 exists for /api/v1/status). Key Question 6 assumes devops roadmap status already exists and adds "One line in devops roadmap status."

    Per AGENTS.md Rule 2, I wrote no compensating code for the missing sweep (#4574) or Workflow queue (#4566). Either add dependencies (#4566, #4574) or update #7454 to target the current job_launcher / ServiceManager poll path and specify creating devops roadmap status.

  8. added
    status/new
    and removed
    status/ready
    on Nov 29, 2026
  9. added
    status/ready
    and removed
    status/new
    on Nov 29, 2026
  10. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  11. added
    status/in-progress
    and removed
    status/ready
    on Nov 29, 2026
  12. removed
    status/in-progress
    on Nov 30, 2026
  13. devops-cli-service commented on Nov 30, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-30 00:51 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions