Skip to content

Commit c6fe97b

Browse files
authored
feat(jobs): add controller diagnostics and per-module E2E config pooling (#440)
Add a `diagnostics` module to the jobs controller that collects a structured snapshot of job/step/task state for debugging stuck or failing jobs. Log snapshots at DEBUG level in the scheduler and reconciler, with a `include_job_logs_in_diagnostics` config flag (default off) to gate raw log inclusion since logs may contain secrets or PII. Refactor the E2E harness to support per-module config selection via an `e2e_config()` pytest mark. Config layers (YAML files + inline overlays) are resolved to a canonical hash and pooled, so modules sharing the same effective config reuse one running services instance and it is torn down as soon as the last consumer finishes. Extract all service lifecycle logic from conftest.py into a new `services_pool.py` module. Add `e2e/configs/local-subprocess.yaml` and a new `test_jobs_auth.py` suite that enables auth and exercises job principal propagation end-to-end using unsigned JWTs. Add unit tests for diagnostics, scheduler priority ordering, subprocess backend, and timestamp contracts. Signed-off-by: Ryan S <267728323+ironcommit@users.noreply.github.com>
1 parent d9e1851 commit c6fe97b

27 files changed

Lines changed: 1981 additions & 326 deletions

docs/set-up/config-reference.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,8 @@ jobs:
422422
schedule_interval_seconds: 5
423423
# Register the subprocess/default execution profile. When unset, defaults to true for docker/none runtimes and false for kubernetes.
424424
enable_subprocess_executor:
425+
# Include raw job log lines in controller diagnostics snapshots. Disabled by default because job logs may contain secrets or PII. Enable only for local debugging or test environments. | default: False
426+
include_job_logs_in_diagnostics: false
425427
```
426428

427429
### `models`

e2e/configs/local-subprocess.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Local E2E config for hosts without Docker.
2+
#
3+
# This keeps the explicit subprocess/default jobs profile required by
4+
# translate_cpu_container_steps_to_subprocess(), while avoiding the default
5+
# docker job backends that are derived from platform.runtime: "docker".
6+
7+
platform:
8+
runtime: "none"
9+
base_url: "http://0.0.0.0:8080"
10+
11+
service: {}
12+
13+
auth:
14+
enabled: false
15+
allow_unsigned_jwt: true
16+
policy_decision_point_provider: embedded
17+
policy_decision_point_base_url: "http://localhost:8080"
18+
policy_data_refresh_interval: 2
19+
bundle_cache_seconds: 15
20+
admin_email: "admin@example.com"
21+
22+
entities: {}
23+
24+
jobs:
25+
# Local E2E-only debugging aid. This may leak secrets or PII from job output,
26+
# so it must remain disabled in non-test configs.
27+
include_job_logs_in_diagnostics: true
28+
executors:
29+
- provider: subprocess
30+
profile: default
31+
backend: subprocess
32+
config:
33+
working_directory: .tmp/e2e/subprocess-jobs
34+
cleanup_completed_jobs_immediately: false
35+
ttl_seconds_before_active: 60
36+
ttl_seconds_active: 3600
37+
ttl_seconds_after_finished: 300
38+
executor_defaults:
39+
subprocess:
40+
working_directory: .tmp/e2e/subprocess-jobs
41+
cleanup_completed_jobs_immediately: false
42+
ttl_seconds_before_active: 60
43+
ttl_seconds_active: 3600
44+
ttl_seconds_after_finished: 300
45+
46+
evaluator:
47+
recreate_existing_system_entities: true
48+
49+
safe_synthesizer: {}
50+
51+
models:
52+
controller:
53+
interval_seconds: 5
54+
model_deployment_garbage_collection_ttl_seconds: 30
55+
56+
inference_gateway: {}
57+
58+
secrets:
59+
allow_key_creation: true
60+
61+
files:
62+
default_storage_config:
63+
type: local
64+
path: .tmp/e2e/files
65+
66+
studio:
67+
static_files_path: web/packages/studio/dist
68+
sandbox_enabled: true

0 commit comments

Comments
 (0)