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

Propagate additional annotations to pods #3379

Merged
merged 2 commits into from
Feb 7, 2024
Merged

Conversation

zuqq
Copy link
Collaborator

@zuqq zuqq commented Feb 7, 2024

The main change here is that LeaseJobRuns now adds the additional annotations to JobRunLease (via PodRequirementsOverlay, which already has a column in the scheduler database); these are already consumed by CreatePodFromExecutorApiJob, so I'm hopeful that this PR is already enough to get this working end to end:

annotation := util.MergeMaps(job.Job.ObjectMeta.Annotations, map[string]string{
domain.JobSetId: job.Jobset,
domain.Owner: job.User,
})

Comment on lines -545 to -548
additionalAnnotations, found := additionalAnnotationsByJobId[job.Id()]
if !found {
additionalAnnotations = make(map[string]string)
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's fine for additionalAnnotations to be nil (we only read from it here), so I've removed this check.

Comment on lines -305 to -306
// Additional annotations to be added to the PodSpec.
map<string, string> additional_annotations = 8;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We haven't started consuming this field yet, so removing it won't break anything; I'm storing additional annotations in pod_requirements_overlay instead, which already has a column in the scheduler database.

@zuqq zuqq merged commit 9b85c5b into master Feb 7, 2024
27 of 28 checks passed
@zuqq zuqq deleted the add-additional-annotations branch February 7, 2024 12:36
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.

2 participants