Skip to content

Feat/benchmark job lifecycle - #22

Merged
amh1k merged 3 commits into
mainfrom
feat/benchmark-job-lifecycle
Sep 24, 2026
Merged

amh1k merged 3 commits into
mainfrom
feat/benchmark-job-lifecycle

Conversation

@amh1k

@amh1k amh1k commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implement the benchmark Job lifecycle through Coordinator.Run: create temporary credentials and a runner Job, wait for execution, collect output, and clean up Kubernetes resources.

Closes #17

Changes

  • Integrate Job and Secret creation into Coordinator.Run.
  • Poll Job completion and failure conditions.
  • Discover the runner Pod and verify its Job ownership.
  • Collect up to 1 MiB of runner output and report truncation.
  • Preserve available logs on failure, with a separate diagnostic timeout.
  • Enforce the configured execution timeout and propagate caller cancellation.
  • Delete Jobs using UID preconditions and foreground propagation, then wait for deletion confirmation.
  • Reserve time for credential Secret deletion even when Job cleanup times out.
  • Preserve execution, log retrieval, and cleanup errors together.

Testing

  • Added tests for Job polling, Pod ownership, log collection, and output truncation.
  • Added lifecycle tests for failed Jobs, cancellation, execution timeouts, caller deadlines, and missing Pods.
  • Added cleanup tests for deletion order, delayed deletion, and timeout handling.
  • Passed backend tests, go vet, and git diff --check.

Scope and limitations

This PR provides the internal coordinator execution flow. Benchmark creation and status API endpoints are covered by #12.

Output is returned as raw text; metric parsing and persistence are separate work. Credential sanitization remains outstanding. A coordinator crash can leave temporary resources behind; automatic recovery is not implemented.

Signed-off-by: amh1k <abdulmoizx97@gmail.com>
Signed-off-by: amh1k <abdulmoizx97@gmail.com>
@amh1k
amh1k merged commit b5a59f6 into main Sep 24, 2026
5 checks passed
@spron-in
spron-in deleted the feat/benchmark-job-lifecycle branch October 6, 2026 07:38
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.

Implement benchmark Job monitoring, output collection, and resource cleanup

1 participant