Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Coordinator concept #702

Merged
merged 4 commits into from
Nov 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions site/content/en/docs/concepts/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,51 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
pytorch-workers ClusterIP None <none> <none> 25m
```

### Coordinator

A specific pod can be assigned as coordinator using `spec.coordinator`. If defined, a `jobset.sigs.k8s.io/coordinator`
annotation and label with the the stable network endpoint of the coordinator pod will be added to all Jobs and pods in the JobSet.
This label can be useful by other pods. For example:

```yaml
apiVersion: jobset.x-k8s.io/v1alpha2
kind: JobSet
metadata:
name: pytorch
spec:
coordinator:
replicatedJob: leader
jobIndex: 0
podIndex: 0
replicatedJobs:
- name: leader
replicas: 1
template:
spec:
parallelism: 1
completions: 1
...
- name: workers
replicas: 1
template:
spec:
parallelism: 8
completions: 8
template:
spec:
containers:
- name: worker
env:
- name: LEADER_ADDRESS
valueFrom:
fieldRef:
fieldPath: "metadata.labels['jobset.sigs.k8s.io/coordinator']"
...
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For completeness, can we include an example of the resulting label/annotation that would be applied to jobs/pods, for the example spec above? So the user can verify correctness and understand what they should expect the stable network endpoint to look like.

i.e., jobset.sigs.k8s.io/coordinator=pytorch-leader-0-0.pytorch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added!

WARNING: if using Kueue with JobSet, ensure Kueue version v0.9.0+ is installed. Prior versions are built using a JobSet api definition that does
not have the coordinator field: https://github.com/kubernetes-sigs/jobset/issues/701.

### Exclusive Job to topology placement

The JobSet annotation `alpha.jobset.sigs.k8s.io/exclusive-topology` defines 1:1 job to topology placement.
Expand Down