-
[OPIK-2770] [Python BE] Add optimization log streaming to Redis for Studio (#4538)
发布于
2025-12-23 15:33:14 +00:00 - [OPIK-2770] [SDK] Add optimization log streaming to Redis for Studio
- Add RedisBatchLogCollector for streaming subprocess logs to Redis
- Capture stdout/stderr from optimizer subprocess with Rich formatting
- Store logs in Redis LIST with metadata in HASH (last_append_ts, status)
- Implement deduplication for Rich progress bar spinner lines
- Configure terminal width via STUDIO_LOG_TERM_WIDTH env var
- Set TTL on Redis keys for automatic cleanup
- Fix: Restore JSON parsing in BatchLogCollector._read_stream
- BatchLogCollector parses JSON logs to extract structured fields (for HTTP backend)
- RedisBatchLogCollector overrides _read_stream to emit raw lines (for Redis storage)
- This fixes test_subprocess_logging tests that expect JSON parsing
-
Addressing Ido PR review
-
Update Helm documentation
-
Update apps/opik-python-backend/src/opik_backend/jobs/optimizer_runner.py
Co-authored-by: baz-reviewer[bot] <174234987+baz-reviewer[bot]@users.noreply.github.com>
Co-authored-by: CometActions github-actions@comet.com
Co-authored-by: baz-reviewer[bot] <174234987+baz-reviewer[bot]@users.noreply.github.com>下载附件