Skip to content

VOIP-1283-Add-bin-scheduler-manager - #1153

Closed
pchero wants to merge 12 commits into
mainfrom
VOIP-1283-Add-bin-scheduler-manager
Closed

VOIP-1283-Add-bin-scheduler-manager#1153
pchero wants to merge 12 commits into
mainfrom
VOIP-1283-Add-bin-scheduler-manager

Conversation

@pchero

@pchero pchero commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Add bin-scheduler-manager, a platform-internal scheduler service that absorbs external cron jobs into VoIPBin: schedules live in the DB, dispatch is RabbitMQ RPC with a Redis-lock + DB-CAS at-most-once claim, and every run is recorded in an audit trail with per-job Prometheus metrics. The number-renew K8s CronJob is removed; its job is now a seeded schedule that fires on every deployment surface. Design and implementation plan are included under docs/plans/ (design approved over a 4-round review loop, plan over 3 rounds, code over 8 rounds). No RST docs changes: Phase 1 has no user-visible API surface (all schedules are platform-owned; customer-facing scheduling is Phase 3).

  • bin-scheduler-manager: New service — schedule/execution models, cron validation (robfig/cron parser), schedule CRUD RPC API with allowlist/bounds validation, tick/claim/dispatch engine (redsync try-once lock, DB CAS + unique execution key in one transaction, Forbid overlap, abandoned-run reaper, single-fire catch-up), manual execute that never consumes the cron slot, in-stack mysqldump backup with credential hygiene (0600 defaults file and dump, HTTPS+fingerprint-pinned MySQL APT key), execution retention pruning, scheduler-control admin CLI, Prometheus metrics, K8s manifests (replicas 2), CLAUDE.md/README/docs suite, 260 unit tests incl. double-fire and kill-9 failover proofs
  • bin-common-handler: Scheduler queue/service constants, QueueNameRequestAll enumeration helper with parity test, SchedulerV1 typed client methods with wire-shape tests
  • bin-dbscheme-manager: scheduler_schedules and scheduler_executions tables plus seed migration (number-renew enabled, database-backup disabled, execution-retention enabled)
  • bin-number-manager: Remove the number-renew CronJob manifest and its commented kustomization entry (absorbed by the scheduler)
  • monorepo: CircleCI registration for the new service, queue reference/dependency graph/taxonomy/prefix-table doc sync, service counts 37 to 38, scheduler replace directives propagated to all bin-common-handler consumer modules

pchero added 12 commits August 1, 2026 07:47
- bin-scheduler-manager: Add service skeleton (go.mod, models/schedule, models/execution, internal/config, design/plan docs)
- bin-common-handler: Add scheduler queue/service constants, QueueNameRequestAll helper, SchedulerV1 client methods with wire-shape tests
- bin-scheduler-manager: Add cachehandler (redsync lock), dbhandler (claim CAS, reaper, prune) with double-fire and kill-9 tests
- bin-dbscheme-manager: Add scheduler_schedules/scheduler_executions tables and platform job seed migrations
- bin-scheduler-manager: Add schedulehandler (CRUD validation), dispatchhandler (tick/claim/dispatch/manual, Forbid overlap, metrics), backuphandler (mysqldump, credential hygiene, retention)
- bin-scheduler-manager: Add listenhandler (RPC API), subscribehandler (customer_deleted), scheduler-manager daemon and scheduler-control CLI
- bin-scheduler-manager: Add Dockerfile (mysql-community-client runtime), k8s manifests (replicas 2), CLAUDE.md/README/docs suite
- bin-number-manager: Remove number-renew CronJob manifest (absorbed by scheduler)
- monorepo: Register scheduler-manager in CircleCI, queue reference, dependency graph, taxonomy, service counts
- monorepo: Propagate bin-scheduler-manager require/replace directives to all bin-common-handler consumer modules
- bin-scheduler-manager: Add timeout_ms/retry_max validation on create/update; document abandon-not-drain shutdown semantics
- bin-scheduler-manager: Quote and escape the DB password in the mysqldump defaults file (INI special characters) with tests
- bin-scheduler-manager: Create backup dumps 0600; verify MySQL APT key fingerprint over HTTPS and use HTTPS repo; add column-width and target_data JSON validation
- bin-scheduler-manager: Use RPM-GPG-KEY-mysql-2025 (2023 key export expired; same fingerprint); add bounds/JSON validation test coverage for create and update
- bin-scheduler-manager: scheduler-control get resolves name-or-id; reset lag gauge on claim; guard non-positive retention days; document Redis hard dependency; doc fixes
- bin-scheduler-manager: Add test coverage for the non-positive retention guard
@gitguardian

gitguardian Bot commented Aug 1, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
35626146 Triggered Generic Password aec712f bin-scheduler-manager/pkg/backuphandler/backup_test.go View secret
35626147 Triggered Generic Password aec712f bin-scheduler-manager/pkg/backuphandler/backup_test.go View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@pchero

pchero commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by the renamed branch/PR (bin-scheduler-manager -> bin-schedule-manager per naming decision).

@pchero pchero closed this Aug 1, 2026
@pchero
pchero deleted the VOIP-1283-Add-bin-scheduler-manager branch August 1, 2026 06:11
pchero added a commit that referenced this pull request Aug 1, 2026
Add bin-schedule-manager, a platform-internal scheduler service that absorbs external cron jobs into VoIPBin: schedules live in the DB, dispatch is RabbitMQ RPC with a Redis-lock + DB-CAS at-most-once claim, and every run is recorded in an audit trail with per-job Prometheus metrics. The number-renew K8s CronJob is removed; its job is now a seeded schedule that fires on every deployment surface. Replaces PR #1153 after a rename from bin-scheduler-manager to bin-schedule-manager (resource-based naming, incl. DB tables schedule_schedules/schedule_executions). Design and implementation plan are under docs/plans/ (design approved over a 4-round review loop, plan over 3 rounds, code over 8 rounds, rename over 2 rounds). No RST docs changes: Phase 1 has no user-visible API surface (all schedules are platform-owned; customer-facing scheduling is Phase 3).

- bin-schedule-manager: New service — schedule/execution models, cron validation (robfig/cron parser), schedule CRUD RPC API with allowlist/bounds validation, tick/claim/dispatch engine (redsync try-once lock, DB CAS + unique execution key in one transaction, Forbid overlap, abandoned-run reaper, single-fire catch-up), manual execute that never consumes the cron slot, in-stack mysqldump backup with credential hygiene (0600 defaults file and dump, HTTPS+fingerprint-pinned MySQL APT key), execution retention pruning, schedule-control admin CLI, Prometheus metrics, K8s manifests (replicas 2), CLAUDE.md/README/docs suite, 260 unit tests incl. double-fire and kill-9 failover proofs
- bin-common-handler: Schedule queue/service constants, QueueNameRequestAll enumeration helper with parity test, ScheduleV1 typed client methods with wire-shape tests
- bin-dbscheme-manager: schedule_schedules and schedule_executions tables plus seed migration (number-renew enabled, database-backup disabled, execution-retention enabled)
- bin-number-manager: Remove the number-renew CronJob manifest and its commented kustomization entry (absorbed by the scheduler)
- monorepo: CircleCI registration for the new service, queue reference/dependency graph/taxonomy/prefix-table doc sync, service counts 37 to 38, schedule-manager replace directives propagated to all bin-common-handler consumer modules
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.

1 participant