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

Flyte Add Enable/Disable Options for Agent Services #4041

Merged
merged 17 commits into from
Oct 10, 2023
Merged
13 changes: 8 additions & 5 deletions charts/flyte-binary/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,15 @@ configuration:
# tag CoPilot sidecar image tag
tag: v0.0.33 # 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
# 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 +386,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
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
15 changes: 11 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"
completeAgentModeEnvVar = "FLYTE_COMPLETE_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,12 @@ func main() {
} else {
// If we are not running in dev mode, look for user-specified configuration
// to load into the sandbox deployment
tmplPath = fullTemplatePath
if os.Getenv(completeAgentModeEnvVar) == "True" {
tmplPath = fullAgentTemplatePath
} else {
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
Loading