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

Include override configuration for Prefect Agent #813

Merged
merged 22 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion qhub/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class AuthenticationEnum(str, enum.Enum):
auth0 = "Auth0"
custom = "custom"


class Base(pydantic.BaseModel):
...

Expand Down Expand Up @@ -76,6 +75,7 @@ class ClearML(Base):
class Prefect(Base):
enabled: bool
image: typing.Optional[str]
overrides: typing.Optional[typing.Dict]


# ============= Terraform ===============
Expand Down
3 changes: 2 additions & 1 deletion qhub/template/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
},
"prefect": {
"enabled": null,
"image": null
"image": null,
"overrides": null
},
"security": null,
"default_images": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ module "prefect" {
{% if cookiecutter.prefect.image is defined -%}
image = "{{ cookiecutter.prefect.image }}"
{% endif -%}
{% if cookiecutter.prefect.overrides is defined %}
overrides = ["{{ cookiecutter.prefect.overrides }}"]
viniciusdc marked this conversation as resolved.
Show resolved Hide resolved
{% endif %}
}
{% endif -%}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,8 @@ spec:
value: {{ .Values.cloudApi }}
- name: NAMESPACE
value: {{ .Values.namespace }}
- name: IMAGE_PULL_SECRETS
value: ''
- name: PREFECT__CLOUD__AGENT__LABELS
value: '[]'
- name: JOB_MEM_REQUEST
value: ''
- name: JOB_MEM_LIMIT
value: ''
- name: JOB_CPU_REQUEST
value: ''
- name: JOB_CPU_LIMIT
value: ''
- name: IMAGE_PULL_POLICY
value: ''
- name: SERVICE_ACCOUNT_NAME
value: {{ .Values.serviceAccount }}
- name: PREFECT__BACKEND
value: cloud
- name: PREFECT__CLOUD__AGENT__AGENT_ADDRESS
value: http://:8080
image: {{ .Values.prefectImage }}
imagePullPolicy: Always
livenessProbe:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ resource "helm_release" "prefect" {
namespace = var.namespace
chart = "${path.module}/chart"
viniciusdc marked this conversation as resolved.
Show resolved Hide resolved

values = concat([
file("${path.module}/values.yaml")], var.overrides)

set_sensitive {
name = "prefectToken"
value = var.prefect_token
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
spec:
template:
spec:
containers:
- env:
- name: IMAGE_PULL_SECRETS
value: ''
- name: PREFECT__CLOUD__AGENT__LABELS
value: '[]'
- name: JOB_MEM_REQUEST
value: ''
- name: JOB_MEM_LIMIT
value: ''
- name: JOB_CPU_REQUEST
value: ''
- name: JOB_CPU_LIMIT
value: ''
- name: IMAGE_PULL_POLICY
value: ''
- name: PREFECT__BACKEND
value: cloud
- name: PREFECT__CLOUD__AGENT__AGENT_ADDRESS
value: http://:8080
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ variable "cloud_api" {
type = string
default = "https://api.prefect.io"
}

variable "overrides" {
description = "Prefect helm chart list of overrides"
type = list(string)
default = []
}