Skip to content

Commit

Permalink
feat(base-job-template): Add base job template name (#275)
Browse files Browse the repository at this point in the history
* feat(base-job-template): Add base job template name

* docs(README): add value to worker readme

---------

Co-authored-by: Jamie Zieziula <[email protected]>
  • Loading branch information
lucas-koontz and jamiezieziula authored Dec 12, 2023
1 parent 11047d7 commit e02e2c7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions charts/prefect-worker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ helm install prefect-worker prefect/prefect-worker -f values.yaml --set-file wor
| worker.cloudApiConfig.cloudUrl | string | `"https://api.prefect.cloud/api"` | prefect cloud API url; the full URL is constructed as https://cloudUrl/accounts/accountId/workspaces/workspaceId |
| worker.cloudApiConfig.workspaceId | string | `""` | prefect workspace ID |
| worker.clusterUid | string | `""` | unique cluster identifier, if none is provided this value will be infered at time of helm install |
| worker.config.baseJobTemplateName | string | `nil` | Name for the base job template. If unspecified, Prefect will use the default base job template name for the given worker type. |
| worker.config.baseJobTemplate | string | `nil` | JSON formatted base job template. If unspecified, Prefect will use the default base job template for the given worker type. If the work pool already exists, this will be ignored. |
| worker.config.http2 | bool | `true` | connect using HTTP/2 if the server supports it (experimental) |
| worker.config.installPolicy | string | `"prompt"` | install policy to use workers from Prefect integration packages. |
Expand Down
3 changes: 2 additions & 1 deletion charts/prefect-worker/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: prefect-worker-base-job-template
name: {{ default "prefect-worker-base-job-template" .Values.worker.config.baseJobTemplateName . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: worker
Expand All @@ -12,3 +12,4 @@ metadata:
data:
baseJobTemplate.json: {{ .Values.worker.config.baseJobTemplate | toJson }}
{{- end }}

2 changes: 1 addition & 1 deletion charts/prefect-worker/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,5 @@ spec:
{{- if .Values.worker.config.baseJobTemplate }}
- name: base-job-template-file
configMap:
name: prefect-worker-base-job-template
name: {{ default "prefect-worker-base-job-template" .Values.worker.config.baseJobTemplateName . }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/prefect-worker/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@
"description": "the type of worker to start i.e kubernetes",
"form": true
},
"baseJobTemplateName": {
"type": ["string", "null"],
"title": "Base Job Template Name",
"description": "Template name of the base job template. If unspecified, Prefect will use the default base job template name for the given worker type.",
"form": true
},
"baseJobTemplate": {
"type": ["string", "null"],
"title": "Base Job Template",
Expand Down

0 comments on commit e02e2c7

Please sign in to comment.