Jeremie Fraeys
c46be7f815
refactor: Phase 4 deferred - Extract GPU utilities and execution helpers
Extracted from execution.go to focused packages:
1. internal/worker/gpu.go (60 lines)
- gpuVisibleDevicesString() - GPU device string formatting
- filterExistingDevicePaths() - Device path filtering
- gpuVisibleEnvVarName() - GPU env var selection
- Reuses GPUType constants from gpu_detector.go
2. internal/worker/execution/setup.go (108 lines)
- SetupJobDirectories() - Job directory creation
- CopyDir() - Directory tree copying
- copyFile() - Single file copy helper
3. internal/worker/execution/snapshot.go (52 lines)
- StageSnapshot() - Snapshot staging for jobs
- StageSnapshotFromPath() - Snapshot staging from path
Updated execution.go:
- Removed 64 lines of GPU utilities (now in gpu.go)
- Reduced from 1,082 to ~1,018 lines
- Still contains main execution flow (runJob, executeJob, etc.)
Build status: Compiles successfully