fetch_ml/internal/worker
Jeremie Fraeys a5c1a9fc0b
refactor: Phase 4 - split worker package into focused files
Split 551-line worker/core.go into single-concern files:

- worker/config.go (+44 lines)
  - Added config parsing: envInt(), parseCPUFromConfig(), parseGPUCountFromConfig()
  - parseGPUSlotsPerGPUFromConfig()
  - Now has all config logic in one place (440 lines total)

- worker/metrics.go (new file, 172 lines)
  - Extracted setupMetricsExporter() with ~30 Prometheus metric registrations
  - Isolated metrics logic for easy modification

- worker/factory.go (new file, 183 lines)
  - Extracted NewWorker() factory function
  - Moved prePullImages(), pullImage() from core.go
  - Centralized worker instantiation

- worker/worker.go (renamed from core.go, ~100 lines)
  - Now just defines Worker struct, MLServer, JupyterManager
  - Clean, focused file without mixed concerns

Lines redistributed: ~350 lines moved from monolithic core.go
Build status: Compiles successfully
2026-02-17 12:57:02 -05:00
..
artifacts.go perf: add profiling benchmarks and parallel Go baseline for C++ optimization 2026-02-12 12:04:02 -05:00
config.go refactor: Phase 4 - split worker package into focused files 2026-02-17 12:57:02 -05:00
data_integrity.go ci: push all workflow updates 2026-02-12 13:28:15 -05:00
execution.go refactor: Phase 3 - fix config/storage boundaries 2026-02-17 12:49:53 -05:00
factory.go refactor: Phase 4 - split worker package into focused files 2026-02-17 12:57:02 -05:00
gpu_detector.go feat(worker): add integrity checks, snapshot staging, and prewarm support 2026-01-05 12:31:13 -05:00
hash_selector.go feat: add native library bridge and queue integration 2026-02-16 20:38:30 -05:00
jupyter_task.go feat(core): API, worker, queue, and manifest improvements 2026-02-12 12:05:17 -05:00
metrics.go refactor: Phase 4 - split worker package into focused files 2026-02-17 12:57:02 -05:00
native_bridge.go feat: implement C++ native libraries for performance-critical operations 2026-02-16 20:38:04 -05:00
native_bridge_libs.go feat: add native library bridge and queue integration 2026-02-16 20:38:30 -05:00
native_bridge_nocgo.go feat: add native library bridge and queue integration 2026-02-16 20:38:30 -05:00
runloop.go feat: add native library bridge and queue integration 2026-02-16 20:38:30 -05:00
snapshot_store.go perf: add profiling benchmarks and parallel Go baseline for C++ optimization 2026-02-12 12:04:02 -05:00
worker.go refactor: Phase 4 - split worker package into focused files 2026-02-17 12:57:02 -05:00