Skip to content

Commit

Permalink
Flyte Add Enable/Disable Options for Agent Services (#4041)
Browse files Browse the repository at this point in the history
* enable agent

Signed-off-by: Future Outlier <[email protected]>

* update flyteagent kustomization

Signed-off-by: Future Outlier <[email protected]>

* add agent-servie key in enabled plugins

Signed-off-by: Future Outlier <[email protected]>

* add flyte agent patch

Signed-off-by: Future Outlier <[email protected]>

* Update helm chart and remove patch

Signed-off-by: Future Outlier <[email protected]>

* add agentService

Signed-off-by: Future Outlier <[email protected]>

* add task timeout

Signed-off-by: Future Outlier <[email protected]>

* make helm

Signed-off-by: Future Outlier <[email protected]>

* update helm README.md

Signed-off-by: Future Outlier <[email protected]>

* checksum

Signed-off-by: Future Outlier <[email protected]>

* update supported task type

Signed-off-by: Future Outlier <[email protected]>

* update key value

Signed-off-by: Future Outlier <[email protected]>

---------

Signed-off-by: Future Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
Co-authored-by: Future Outlier <[email protected]>
  • Loading branch information
Future-Outlier and Future Outlier authored Oct 10, 2023
1 parent 4a780c3 commit 0b4186d
Show file tree
Hide file tree
Showing 9 changed files with 1,983 additions and 20 deletions.
12 changes: 8 additions & 4 deletions charts/flyte-binary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ Chart for basic single Flyte executable deployment
| clusterResourceTemplates.labels | object | `{}` | |
| commonAnnotations | object | `{}` | |
| commonLabels | object | `{}` | |
| configuration.agentService | object | `{}` | |
| configuration.agentService.defaultAgent.defaultTimeout | string | `"10s"` | |
| configuration.agentService.defaultAgent.endpoint | string | `"dns:///flyteagent.flyte.svc.cluster.local:8000"` | |
| configuration.agentService.defaultAgent.insecure | bool | `true` | |
| configuration.agentService.defaultAgent.timeouts.GetTask | string | `"10s"` | |
| configuration.agentService.supportedTaskTypes[0] | string | `"default_task"` | |
| configuration.annotations | object | `{}` | |
| configuration.auth.authorizedUris | list | `[]` | |
| configuration.auth.clientSecretsExternalSecretRef | string | `""` | |
Expand Down Expand Up @@ -103,9 +107,9 @@ 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":{"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) |
| 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) |
| 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 |
| enabled_plugins.tasks | object | `{"task-plugins":{"default-for-task-types":{"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":{"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` | |
Expand Down
16 changes: 10 additions & 6 deletions charts/flyte-binary/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,16 @@ configuration:
# tag CoPilot sidecar image tag
tag: v1.9.4 # FLYTECOPILOT_TAG
# agentService Flyte Agent configuration
agentService: {}
agentService:
defaultAgent:
endpoint: "dns:///flyteagent.flyte.svc.cluster.local:8000"
insecure: true
timeouts:
GetTask: 10s
defaultTimeout: 10s
# Uncomment and modify to include configuration for Flyte Agent
# defaultGrpcEndpoint: agent-service.agent-namespace:8000
# supportedTaskTypes:
# - custom_task_type
supportedTaskTypes:
- default_task
# externalConfigMap Specify an existing, external ConfigMap to use as configuration for Flyte
# If set, no Flyte configuration will be generated by this chart
externalConfigMap: ""
Expand Down Expand Up @@ -382,8 +387,7 @@ enabled_plugins:
- container
- sidecar
- k8s-array
# -- Uncomment to enable agent service
# - agent-service
- agent-service
default-for-task-types:
container: container
sidecar: sidecar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ data:
- container
- sidecar
- k8s-array
- agent-service
plugins:
logs:
kubernetes-enabled: false
Expand All @@ -122,6 +123,15 @@ data:
kubernetes-enabled: false
cloudwatch-enabled: false
stackdriver-enabled: false
agent-service:
defaultAgent:
defaultTimeout: 10s
endpoint: dns:///flyteagent.flyte.svc.cluster.local:8000
insecure: true
timeouts:
GetTask: 10s
supportedTaskTypes:
- default_task
002-database.yaml: |
database:
postgres:
Expand Down Expand Up @@ -357,7 +367,7 @@ spec:
app.kubernetes.io/instance: flyte
app.kubernetes.io/component: flyte-binary
annotations:
checksum/configuration: 528ce4a42638a7810c99802dfd49525967db2a99dbc1019544b7799de2490b61
checksum/configuration: d220769393e7acbe0372fdccbf3d588797864ec934661f08912e88ec084cdfde
checksum/configuration-secret: d5d93f4e67780b21593dc3799f0f6682aab0765e708e4020939975d14d44f929
checksum/cluster-resource-templates: 7dfa59f3d447e9c099b8f8ffad3af466fecbc9cf9f8c97295d9634254a55d4ae
spec:
Expand Down
5 changes: 5 additions & 0 deletions docker/sandbox-bundled/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ flyte:
manifests:
mkdir -p manifests
helm dependency update ../../charts/flyte-sandbox
helm dependency update ../../charts/flyteagent
kustomize build \
--enable-helm \
--load-restrictor=LoadRestrictionsNone \
Expand All @@ -27,6 +28,10 @@ manifests:
--enable-helm \
--load-restrictor=LoadRestrictionsNone \
kustomize/dev > manifests/dev.yaml
kustomize build \
--enable-helm \
--load-restrictor=LoadRestrictionsNone \
kustomize/complete-agent > manifests/complete-agent.yaml

.PHONY: build
build: flyte manifests
Expand Down
14 changes: 10 additions & 4 deletions docker/sandbox-bundled/bootstrap/cmd/bootstrap/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ const (
clusterResourceTemplatesConfigMapName = "flyte-sandbox-extra-cluster-resource-templates"
deploymentName = "flyte-sandbox"
devModeEnvVar = "FLYTE_DEV"
disableAgentModeEnvVar = "DISABLE_AGENT"
dockerHost = "host.docker.internal"
namespace = "flyte"

// Template paths
devTemplatePath = "/var/lib/rancher/k3s/server/manifests-staging/dev.yaml"
fullTemplatePath = "/var/lib/rancher/k3s/server/manifests-staging/complete.yaml"
renderedManifestPath = "/var/lib/rancher/k3s/server/manifests/flyte.yaml"
devTemplatePath = "/var/lib/rancher/k3s/server/manifests-staging/dev.yaml"
fullTemplatePath = "/var/lib/rancher/k3s/server/manifests-staging/complete.yaml"
fullAgentTemplatePath = "/var/lib/rancher/k3s/server/manifests-staging/complete-agent.yaml"
renderedManifestPath = "/var/lib/rancher/k3s/server/manifests/flyte.yaml"
)

func main() {
Expand All @@ -35,7 +37,11 @@ func main() {
} else {
// If we are not running in dev mode, look for user-specified configuration
// to load into the sandbox deployment
tmplPath = fullTemplatePath
tmplPath = fullAgentTemplatePath
if os.Getenv(disableAgentModeEnvVar) == "True" {
tmplPath = fullTemplatePath
}

cOpts := config.LoaderOpts{
ConfigurationConfigMapName: configurationConfigMapName,
ClusterResourceTemplatesConfigMapName: clusterResourceTemplatesConfigMapName,
Expand Down
12 changes: 12 additions & 0 deletions docker/sandbox-bundled/kustomize/complete-agent/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
helmGlobals:
chartHome: ../../../../charts
helmCharts:
- name: flyte-sandbox
releaseName: flyte-sandbox
namespace: flyte
- name: flyteagent
releaseName: flyteagent
namespace: flyte
namespace: flyte
resources:
- ../namespace.yaml
Loading

0 comments on commit 0b4186d

Please sign in to comment.