dask / dask/dask-kubernetes

Allow setting generateName in DaskJob resources

Open
#896 1 comment 1 reaction 0 assignees View on GitHub
enhancement help wanted
Dominant language
Python
Stars
324
Forks
157
PR merge metrics
No merged PRs in 30d

Description

### What?
Setting `metadata.generateName` in kubernetes jobs (`batch/v1 Job`) allows to re-run jobs after applying the resource again without the need to delete the previous job [[source](https://serverfault.com/a/868826)].
Currently trying to set this field on a DaskJob resource results in `missing metadata.name in object {kubernetes.dask.org/v1 DaskJob}`

### Why?
Having the name be randomised via `generateName` on a DaskJob resource would allow users to rerun those jobs without the need to delete the completed jobs.
In my use case I would like to deploy DaskJobs using ArgoCD as the k8s controller, generating the name on the fly would allow to rerun the job whenever a sync is triggered.

### How?
Following the `ObjectMeta` [spec](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/#ObjectMeta):
```yaml
apiVersion: kubernetes.dask.org/v1
kind: DaskJob
metadata:
generateName: dask-hello-world-
```
Imo I don't see a reason to implement this feature in the python library, but maybe someone will prove me wrong 😄

As a sidenote, I'd be happy to work on this if determined to be useful.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.