Scope MLflow experiment names to include user ID (Task 14.2)

- Updated FastAPI /training/start endpoint to extract X-User-ID header via get_user_id() dependency
- Modified _run_training_background to accept and use user_id parameter
- Added MLflow experiment setup with user scoping: experiments are named user_{user_id}_training when user_id is provided, falling back to default experiment name otherwise
- Updated database record insertion to store scoped experiment name
- Updated training/train.py train() function to accept user_id parameter and use it for experiment naming
- Mark task 14.2 as complete in tasks.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marko Djordjevic 2026-02-20 13:46:00 +01:00
parent 9f76d7eb62
commit cbb921b4a7
3 changed files with 55 additions and 16 deletions

View file

@ -82,7 +82,7 @@
## 14. ML Service User Scoping
- [x] 14.1 `[haiku]` Update FastAPI service to read `X-User-ID` header from incoming requests
- [ ] 14.2 `[haiku]` Scope MLflow experiment names to include user ID (e.g., `user_{uuid}_training`)
- [x] 14.2 `[haiku]` Scope MLflow experiment names to include user ID (e.g., `user_{uuid}_training`)
- [ ] 14.3 `[sonnet]` Scope training run queries in FastAPI to filter by user ID
## 15. Documentation & Deployment