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 agent to helm chart and single binary #3454

Merged
merged 35 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
35 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
10 changes: 10 additions & 0 deletions charts/flyte-binary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Chart for basic single Flyte executable deployment
| clusterResourceTemplates.labels | object | `{}` | |
| commonAnnotations | object | `{}` | |
| commonLabels | object | `{}` | |
| configuration.agentService.defaultGrpcEndpoint | string | `"flyte-sandbox-http.flyte.svc.cluster.local:8000"` | |
| configuration.agentService.supportedTaskTypes[0] | string | `"bigquery_query_job_task"` | |
| configuration.annotations | object | `{}` | |
| configuration.auth.authorizedUris | list | `[]` | |
| configuration.auth.enableAuthServer | bool | `true` | |
Expand Down Expand Up @@ -93,13 +95,21 @@ Chart for basic single Flyte executable deployment
| deployment.waitForDB.image.pullPolicy | string | `"IfNotPresent"` | |
| deployment.waitForDB.image.repository | string | `"postgres"` | |
| deployment.waitForDB.image.tag | string | `"15-alpine"` | |
| enabled_plugins.tasks | object | `{"task-plugins":{"default-for-task-types":{"bigquery_query_job_task":"agent-service","container":"container","container_array":"k8s-array","sidecar":"sidecar"},"enabled-plugins":["container","sidecar","k8s-array","agent-service"]}}` | Tasks specific configuration [structure](https://pkg.go.dev/github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/config#GetConfig) |
| enabled_plugins.tasks.task-plugins | object | `{"default-for-task-types":{"bigquery_query_job_task":"agent-service","container":"container","container_array":"k8s-array","sidecar":"sidecar"},"enabled-plugins":["container","sidecar","k8s-array","agent-service"]}` | Plugins configuration, [structure](https://pkg.go.dev/github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/config#TaskPluginConfig) |
| enabled_plugins.tasks.task-plugins.enabled-plugins | list | `["container","sidecar","k8s-array","agent-service"]` | [Enabled Plugins](https://pkg.go.dev/github.com/lyft/flyteplugins/go/tasks/config#Config). Enable sagemaker*, athena if you install the backend plugins |
| flyte-core-components.admin.disableClusterResourceManager | bool | `false` | |
| flyte-core-components.admin.disableScheduler | bool | `false` | |
| flyte-core-components.admin.disabled | bool | `false` | |
| flyte-core-components.admin.seedProjects[0] | string | `"flytesnacks"` | |
| flyte-core-components.dataCatalog.disabled | bool | `false` | |
| flyte-core-components.propeller.disableWebhook | bool | `false` | |
| flyte-core-components.propeller.disabled | bool | `false` | |
| flyteagent.image.pullPolicy | string | `"IfNotPresent"` | |
| flyteagent.image.repository | string | `"ghcr.io/flyteorg/flyteagent"` | |
| flyteagent.image.tag | string | `"1.6.2b1"` | |
| flyteagent.ports.containerPort | int | `8000` | |
| flyteagent.ports.name | string | `"agent-grpc"` | |
| fullnameOverride | string | `""` | |
| ingress.commonAnnotations | object | `{}` | |
| ingress.create | bool | `false` | |
Expand Down
8 changes: 8 additions & 0 deletions charts/flyte-binary/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,14 @@ Get the Flyte service GRPC port.
{{- default 8089 .Values.service.ports.grpc -}}
{{- end -}}

{{/*
Get the Flyte agent service GRPC port.
*/}}
{{- define "flyte-binary.flyteagent.grpc.port" -}}
{{- default 8000 .Values.service.ports.grpc -}}
{{- end -}}


{{/*
Get the Flyte webhook service name.
*/}}
Expand Down
13 changes: 4 additions & 9 deletions charts/flyte-binary/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,10 @@ data:
serviceName: {{ include "flyte-binary.webhook.serviceName" . }}
servicePort: 443
flyte: {{ tpl ( index .Values "flyte-core-components" | toYaml ) . | nindent 6 }}
{{- with .Values.enabled_plugins }}
enabled_plugins.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
{{- end }}
001-plugins.yaml: |
tasks:
task-plugins:
enabled-plugins:
- container
- sidecar
- K8S-ARRAY
default-for-task-types:
- container: container
- container_array: K8S-ARRAY
plugins:
logs: {{- include "flyte-binary.configuration.logging.plugins" . | nindent 8 }}
k8s:
Expand All @@ -68,6 +62,7 @@ data:
k8s-array:
logs:
config: {{- include "flyte-binary.configuration.logging.plugins" . | nindent 12 }}
agent-service: {{ .Values.configuration.agentService | toYaml | nindent 12 }}
002-database.yaml: |
{{- with .Values.configuration.database }}
database:
Expand Down
10 changes: 10 additions & 0 deletions charts/flyte-binary/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,16 @@ spec:
{{- if .Values.deployment.extraVolumeMounts }}
{{- tpl ( .Values.deployment.extraVolumeMounts | toYaml ) . | nindent 12 }}
{{- end }}
- name: flyteagent
{{- with .Values.flyteagent.image }}
image: {{ printf "%s:%s" .repository .tag | quote }}
imagePullPolicy: {{ .pullPolicy | quote }}
{{- end}}
{{- with .Values.flyteagent.ports }}
ports:
- name: {{ .name }}
containerPort: {{ .containerPort }}
{{- end}}
{{- if .Values.deployment.sidecars }}
{{- tpl ( .Values.deployment.sidecars | toYaml ) . | nindent 8 }}
{{- end }}
Expand Down
11 changes: 11 additions & 0 deletions charts/flyte-binary/templates/service/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ spec:
{{- else if eq .Values.service.type "ClusterIP" }}
nodePort: null
{{- end }}
- name: grpc
port: {{ include "flyte-binary.service.grpc.port" . }}
targetPort: grpc
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.grpc)) }}
nodePort: {{ .Values.service.nodePorts.grpc }}
{{- else if eq .Values.service.type "ClusterIP" }}
nodePort: null
{{- end }}
- name: agent-grpc
port: {{ include "flyte-binary.flyteagent.grpc.port" . }}
targetPort: agent-grpc
{{- if .Values.service.extraPorts }}
{{- tpl ( .Values.service.extraPorts | toYaml ) . | nindent 4 }}
{{- end }}
Expand Down
32 changes: 32 additions & 0 deletions charts/flyte-binary/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ configuration:
repository: cr.flyte.org/flyteorg/flytecopilot # FLYTECOPILOT_IMAGE
# tag CoPilot sidecar image tag
tag: v0.0.30 # FLYTECOPILOT_TAG
# Flyteagent Configuration
agentService:
defaultGrpcEndpoint: flyte-sandbox-http.flyte.svc.cluster.local:8000
supportedTaskTypes:
- bigquery_query_job_task
# externalConfigMap Specify an existing, external ConfigMap to use as configuration for Flyte
# If set, no ConfigMap will be generated by this chart
externalConfigMap: ""
Expand Down Expand Up @@ -175,6 +180,15 @@ clusterResourceTemplates:
# annotations Add annotations to created ConfigMap
annotations: {}

flyteagent:
image:
repository: ghcr.io/flyteorg/flyteagent
tag: 1.6.2b1
pullPolicy: IfNotPresent
ports:
name: agent-grpc
containerPort: 8000

# deployment Configure Flyte deployment specification
deployment:
# image Configure image to use for Flyte
Expand Down Expand Up @@ -336,3 +350,21 @@ serviceAccount:
labels: {}
# annotations Add annotations to ServiceAccount
annotations: {}

enabled_plugins:
# -- Tasks specific configuration [structure](https://pkg.go.dev/github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/config#GetConfig)
tasks:
# -- Plugins configuration, [structure](https://pkg.go.dev/github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/config#TaskPluginConfig)
task-plugins:
# -- [Enabled Plugins](https://pkg.go.dev/github.com/lyft/flyteplugins/go/tasks/config#Config). Enable sagemaker*, athena if you install the backend
# plugins
enabled-plugins:
- container
- sidecar
- k8s-array
- agent-service
default-for-task-types:
container: container
sidecar: sidecar
container_array: k8s-array
bigquery_query_job_task: agent-service
31 changes: 27 additions & 4 deletions charts/flyte-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ helm install gateway bitnami/contour -n flyte
| configmap.core.propeller | object | `{"downstream-eval-duration":"30s","enable-admin-launcher":true,"leader-election":{"enabled":true,"lease-duration":"15s","lock-config-map":{"name":"propeller-leader","namespace":"flyte"},"renew-deadline":"10s","retry-period":"2s"},"limit-namespace":"all","max-workflow-retries":30,"metadata-prefix":"metadata/propeller","metrics-prefix":"flyte","prof-port":10254,"queue":{"batch-size":-1,"batching-interval":"2s","queue":{"base-delay":"5s","capacity":1000,"max-delay":"120s","rate":100,"type":"maxof"},"sub-queue":{"capacity":100,"rate":10,"type":"bucket"},"type":"batch"},"rawoutput-prefix":"s3://my-s3-bucket/","workers":4,"workflow-reeval-duration":"30s"}` | follows the structure specified [here](https://pkg.go.dev/github.com/flyteorg/flytepropeller/pkg/controller/config). |
| configmap.datacatalogServer | object | `{"application":{"grpcPort":8089,"grpcServerReflection":true,"httpPort":8080},"datacatalog":{"heartbeat-grace-period-multiplier":3,"max-reservation-heartbeat":"30s","metrics-scope":"datacatalog","profiler-port":10254,"storage-prefix":"metadata/datacatalog"}}` | Datacatalog server config |
| configmap.domain | object | `{"domains":[{"id":"development","name":"development"},{"id":"staging","name":"staging"},{"id":"production","name":"production"}]}` | Domains configuration for Flyte projects. This enables the specified number of domains across all projects in Flyte. |
| configmap.enabled_plugins.tasks | object | `{"task-plugins":{"default-for-task-types":{"container":"container","container_array":"k8s-array","sidecar":"sidecar"},"enabled-plugins":["container","sidecar","k8s-array"]}}` | Tasks specific configuration [structure](https://pkg.go.dev/github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/config#GetConfig) |
| configmap.enabled_plugins.tasks.task-plugins | object | `{"default-for-task-types":{"container":"container","container_array":"k8s-array","sidecar":"sidecar"},"enabled-plugins":["container","sidecar","k8s-array"]}` | Plugins configuration, [structure](https://pkg.go.dev/github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/config#TaskPluginConfig) |
| configmap.enabled_plugins.tasks.task-plugins.enabled-plugins | list | `["container","sidecar","k8s-array"]` | [Enabled Plugins](https://pkg.go.dev/github.com/lyft/flyteplugins/go/tasks/config#Config). Enable sagemaker*, athena if you install the backend plugins |
| configmap.k8s | object | `{"plugins":{"k8s":{"default-cpus":"100m","default-env-vars":[],"default-memory":"100Mi"}}}` | Kubernetes specific Flyte configuration |
| configmap.enabled_plugins.tasks | object | `{"task-plugins":{"default-for-task-types":{"bigquery_query_job_task":"agent-service","container":"container","container_array":"k8s-array","sidecar":"sidecar"},"enabled-plugins":["container","sidecar","k8s-array","agent-service"]}}` | Tasks specific configuration [structure](https://pkg.go.dev/github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/config#GetConfig) |
| configmap.enabled_plugins.tasks.task-plugins | object | `{"default-for-task-types":{"bigquery_query_job_task":"agent-service","container":"container","container_array":"k8s-array","sidecar":"sidecar"},"enabled-plugins":["container","sidecar","k8s-array","agent-service"]}` | Plugins configuration, [structure](https://pkg.go.dev/github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/config#TaskPluginConfig) |
| configmap.enabled_plugins.tasks.task-plugins.enabled-plugins | list | `["container","sidecar","k8s-array","agent-service"]` | [Enabled Plugins](https://pkg.go.dev/github.com/lyft/flyteplugins/go/tasks/config#Config). Enable sagemaker*, athena if you install the backend plugins |
| configmap.k8s | object | `{"plugins":{"agent-service":{"defaultGrpcEndpoint":"flyteagent.flyte.svc.cluster.local:8000","supportedTaskTypes":["bigquery_query_job_task"]},"k8s":{"default-cpus":"100m","default-env-vars":[],"default-memory":"100Mi"}}}` | Kubernetes specific Flyte configuration |
| configmap.k8s.plugins.k8s | object | `{"default-cpus":"100m","default-env-vars":[],"default-memory":"100Mi"}` | Configuration section for all K8s specific plugins [Configuration structure](https://pkg.go.dev/github.com/lyft/flyteplugins/go/tasks/pluginmachinery/flytek8s/config) |
| configmap.remoteData.remoteData.region | string | `"us-east-1"` | |
| configmap.remoteData.remoteData.scheme | string | `"local"` | |
Expand Down Expand Up @@ -167,6 +167,29 @@ helm install gateway bitnami/contour -n flyte
| flyteadmin.serviceAccount.createClusterRole | bool | `true` | Should a ClusterRole be created for Flyteadmin |
| flyteadmin.serviceAccount.imagePullSecrets | list | `[]` | ImagePullSecrets to automatically assign to the service account |
| flyteadmin.tolerations | list | `[]` | tolerations for Flyteadmin deployment |
| flyteagent.additionalContainers | list | `[]` | Appends additional containers to the deployment spec. May include template values. |
| flyteagent.additionalVolumeMounts | list | `[]` | Appends additional volume mounts to the main container's spec. May include template values. |
| flyteagent.additionalVolumes | list | `[]` | Appends additional volumes to the deployment spec. May include template values. |
| flyteagent.affinity | object | `{}` | affinity for flyteagent deployment |
| flyteagent.configPath | string | `"/etc/flyteagent/config/*.yaml"` | Default regex string for searching configuration files |
| flyteagent.enabled | bool | `true` | |
| flyteagent.extraArgs | object | `{}` | Appends extra command line arguments to the main command |
| flyteagent.image.pullPolicy | string | `"IfNotPresent"` | Docker image pull policy |
| flyteagent.image.repository | string | `"ghcr.io/flyteorg/flyteagent"` | Docker image for flyteagent deployment |
| flyteagent.image.tag | string | `"1.6.2b1"` | Docker image tag |
| flyteagent.nodeSelector | object | `{}` | nodeSelector for flyteagent deployment |
| flyteagent.podAnnotations | object | `{}` | Annotations for flyteagent pods |
| flyteagent.ports.containerPort | int | `8000` | |
| flyteagent.ports.name | string | `"agent-grpc"` | |
| flyteagent.priorityClassName | string | `""` | Sets priorityClassName for datacatalog pod(s). |
| flyteagent.replicaCount | int | `1` | Replicas count for flyteagent deployment |
| flyteagent.resources | object | `{"limits":{"cpu":"500m","ephemeral-storage":"100Mi","memory":"500Mi"},"requests":{"cpu":"10m","ephemeral-storage":"50Mi","memory":"50Mi"}}` | Default resources requests and limits for flyteagent deployment |
| flyteagent.service | object | `{"annotations":{"projectcontour.io/upstream-protocol.h2c":"grpc"},"type":"ClusterIP"}` | Service settings for flyteagent |
| flyteagent.serviceAccount | object | `{"annotations":{},"create":true,"imagePullSecrets":[]}` | Configuration for service accounts for flyteagent |
| flyteagent.serviceAccount.annotations | object | `{}` | Annotations for ServiceAccount attached to flyteagent pods |
| flyteagent.serviceAccount.create | bool | `true` | Should a service account be created for flyteagent |
| flyteagent.serviceAccount.imagePullSecrets | list | `[]` | ImagePullSecrets to automatically assign to the service account |
| flyteagent.tolerations | list | `[]` | tolerations for flyteagent deployment |
| flyteconsole.affinity | object | `{}` | affinity for Flyteconsole deployment |
| flyteconsole.enabled | bool | `true` | |
| flyteconsole.ga.enabled | bool | `false` | |
Expand Down
14 changes: 14 additions & 0 deletions charts/flyte-core/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@ helm.sh/chart: {{ include "flyte.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{- define "flyteagent.name" -}}
flyteagent
{{- end -}}

{{- define "flyteagent.selectorLabels" -}}
app.kubernetes.io/name: {{ template "flyteagent.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}

{{- define "flyteagent.labels" -}}
{{ include "flyteagent.selectorLabels" . }}
helm.sh/chart: {{ include "flyte.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{- define "flytepropeller.name" -}}
flytepropeller
Expand Down
53 changes: 53 additions & 0 deletions charts/flyte-core/templates/agent/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{{- if .Values.flyteagent.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "flyteagent.name" . }}
namespace: {{ template "flyte.namespace" . }}
labels: {{ include "flyteagent.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.flyteagent.replicaCount }}
selector:
matchLabels: {{ include "flyteagent.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
{{- with .Values.flyteagent.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels: {{ include "flyteagent.labels" . | nindent 8 }}
spec:
{{- if .Values.flyteagent.priorityClassName }}
priorityClassName: {{ .Values.flyteagent.priorityClassName }}
{{- end }}
containers:
- command:
- pyflyte
- serve
image: "{{ .Values.flyteagent.image.repository }}:{{ .Values.flyteagent.image.tag }}"
imagePullPolicy: "{{ .Values.flyteagent.image.pullPolicy }}"
name: flyteagent
ports:
- containerPort: {{ .Values.flyteagent.ports.containerPort }}
name: {{ .Values.flyteagent.ports.name }}
resources: {{- toYaml .Values.flyteagent.resources | nindent 10 }}
{{- with .Values.flyteagent.additionalVolumeMounts -}}
{{ tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.flyteagent.additionalContainers -}}
{{- tpl (toYaml .) $ | nindent 6}}
{{- end }}
serviceAccountName: {{ template "flyteagent.name" . }}
{{- with .Values.flyteagent.additionalVolumes -}}
{{ tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.flyteagent.nodeSelector }}
nodeSelector: {{ tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.flyteagent.affinity }}
affinity: {{ tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.flyteagent.tolerations }}
tolerations: {{ tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- end }}
21 changes: 21 additions & 0 deletions charts/flyte-core/templates/agent/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if .Values.flyteagent.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "flyteagent.name" . }}
namespace: {{ template "flyte.namespace" . }}
labels: {{ include "flyteagent.labels" . | nindent 4 }}
{{- with .Values.flyteagent.service.annotations }}
annotations: {{ tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
{{- with .Values.flyteagent.service.type}}
type: {{ . }}
{{- end }}
ports:
- name: {{ .Values.flyteagent.ports.name }}
port: {{ .Values.flyteagent.ports.containerPort }}
protocol: TCP
targetPort: {{ .Values.flyteagent.ports.name }}
selector: {{ include "flyteagent.selectorLabels" . | nindent 4 }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/flyte-core/values-controlplane.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
flytepropeller:
enabled: false

flyteagent:
enabled: false
3 changes: 3 additions & 0 deletions charts/flyte-core/values-dataplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ datacatalog:

flyteconsole:
enabled: false

flyteagent:
enabled: false
6 changes: 6 additions & 0 deletions charts/flyte-core/values-eks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ flytepropeller:
app.kubernetes.io/name: flytepropeller
topologyKey: kubernetes.io/hostname

#
# FLYTE_AGENT
#
flyteagent:
enabled: false

#
# FLYTECONSOLE
#
Expand Down
6 changes: 6 additions & 0 deletions charts/flyte-core/values-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ flytepropeller:
app.kubernetes.io/name: flytepropeller
topologyKey: kubernetes.io/hostname

#
# FLYTE_AGENT
#
flyteagent:
enabled: false

#
# FLYTECONSOLE
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ flytepropeller:
# -- Sets priorityClassName for propeller pod(s).
priorityClassName: ""

#
# FLYTE_AGENT
#
flyteagent:
enabled: false

#
# FLYTECONSOLE SETTINGS
#
Expand Down
Loading