Skip to content

Draft pull request for issue 295#478

Open
dotsdl wants to merge 4 commits intomainfrom
claude/draft-pr-issue-295-wSw5X
Open

Draft pull request for issue 295#478
dotsdl wants to merge 4 commits intomainfrom
claude/draft-pr-issue-295-wSw5X

Conversation

@dotsdl
Copy link
Member

@dotsdl dotsdl commented Jan 9, 2026

Closes #295.

Changes:

  • Added ProtocolDAGResultLog model to store log references in the state store
  • Modified compute service to capture stdout/stderr during DAG execution
  • Updated compute client to send logs along with results
  • Updated compute API to receive and store logs in object store
  • Added state store methods to link logs to ProtocolDAGResults
  • Added object store methods to persist and retrieve logs
  • Implemented get_task_stdout/get_task_stderr client methods
  • Added API endpoint to retrieve task logs

The implementation captures logs during execution, stores them as artifacts in S3, and provides easy access through new client methods for debugging failed or completed tasks.

claude and others added 4 commits January 9, 2026 21:27
This commit implements the feature requested in issue #295 to capture and
retain stdout/stderr logs from ProtocolDAG executions and expose them via
the AlchemiscaleClient.

Changes:
- Added ProtocolDAGResultLog model to store log references in the state store
- Modified compute service to capture stdout/stderr during DAG execution
- Updated compute client to send logs along with results
- Updated compute API to receive and store logs in object store
- Added state store methods to link logs to ProtocolDAGResults
- Added object store methods to persist and retrieve logs
- Implemented get_task_stdout/get_task_stderr client methods
- Added API endpoint to retrieve task logs

The implementation captures logs during execution, stores them as artifacts
in S3, and provides easy access through new client methods for debugging
failed or completed tasks.
- interface/api.py: Rewrite get_task_logs endpoint; the original called
  n4js.get_scoped_key() with wrong argument types and constructed
  ScopedKey with invalid positional args. Now retrieves S3 locations
  directly from statestore and passes them to objectstore.
  Use http_status constant instead of bare 400.

- compute/api.py: Use `is not None` checks instead of truthiness for
  stdout/stderr to preserve empty string logs.

- statestore.py: Replace f-string interpolation in Cypher query with
  parameterized $stream to prevent injection. Return S3 locations
  directly instead of ScopedKeys to avoid unnecessary round-trips.

- objectstore.py: Simplify pull_protocoldagresult_log to accept only
  location (always available from statestore). Move ProtocolDAGResultLog
  import to module level.

- compute/service.py: Use _TeeStream for stderr capture so that logging
  output from the StreamHandler is both captured and still emitted to
  the original stderr, preventing log suppression during DAG execution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retain stdout, stderr logs from ProtocolDAGResults; expose access via AlchemiscaleClient

2 participants