Make Kubernetes task Jobs execution-scoped#78
Conversation
Co-Authored-By: Oz <oz-agent@warp.dev>
captainsafia
left a comment
There was a problem hiding this comment.
Seems sensible overall! Had one question inline about how we want to handle the transition to this new label format if executions are still inflight when the user upgrades.
| } | ||
|
|
||
| func (b *KubernetesBackend) watchTaskPods(ctx context.Context, taskID string) (watch.Interface, error) { | ||
| func (b *KubernetesBackend) watchTaskPods(ctx context.Context, executionID string) (watch.Interface, error) { |
There was a problem hiding this comment.
In here and in listTaskPods below, do we need to be concerned about the handling existing tasks if the upgrade happens in flight?
There was a problem hiding this comment.
Right now, if the worker's restarted it'll detach from existing tasks and won't try to re-watch them, so we should be fine. Ideally it would rediscover existing tasks though
| fmt.Sprintf("OZ_WORKSPACE_ROOT=%s", defaultWorkspaceMountPath), | ||
| "OZ_WORKER_BACKEND="+kubernetesBackendTypeName, | ||
| fmt.Sprintf("OZ_RUN_ID=%s", params.TaskID), | ||
| fmt.Sprintf("OZ_EXECUTION_ID=%s", executionID), |
There was a problem hiding this comment.
We probably don't need this in the container environment
There was a problem hiding this comment.
Addressed in 953104c by omitting OZ_EXECUTION_ID from the Kubernetes task/setup container env and updating the tests to assert it stays out of the container environment.
| } | ||
|
|
||
| func (b *KubernetesBackend) watchTaskPods(ctx context.Context, taskID string) (watch.Interface, error) { | ||
| func (b *KubernetesBackend) watchTaskPods(ctx context.Context, executionID string) (watch.Interface, error) { |
There was a problem hiding this comment.
Right now, if the worker's restarted it'll detach from existing tasks and won't try to re-watch them, so we should be fine. Ideally it would rediscover existing tasks though
Co-Authored-By: Oz <oz-agent@warp.dev>
Summary
execution_idto task assignments and backend task params.--task-id,OZ_RUN_ID, and task completed/failed messages, with task ID fallback when older servers do not sendexecution_id.Validation
go test ./internal/workergo test ./...Notes
execution_idin task assignment messages.Co-Authored-By: Oz oz-agent@warp.dev
Conversation: https://staging.warp.dev/conversation/919550f0-b403-4e10-bf5d-8896304796bd
Run: https://oz.staging.warp.dev/runs/019e739f-ab1c-75a6-a800-619fc2c6bef6
This PR was generated with Oz.