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

Conversation

pingsutw
Copy link
Member

@pingsutw pingsutw commented Mar 13, 2023

Tracking issue

#3282

Describe your changes

  • Add a new deployment for agent service
  • Add a new container in flyte-sandbox deployment for agent service

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Screenshots

Note to reviewers

Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
@pingsutw pingsutw marked this pull request as draft March 13, 2023 18:15
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
@pingsutw pingsutw changed the title [WIP] Add flyteplugins service to helm chart and single binary Add flyteplugins service to helm chart and single binary Mar 14, 2023
@pingsutw pingsutw marked this pull request as ready for review March 14, 2023 23:41
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
@pingsutw pingsutw changed the title Add flyteplugins service to helm chart and single binary Add external plugin service to helm chart and single binary May 8, 2023
pingsutw added 7 commits May 8, 2023 14:54
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
@pingsutw pingsutw changed the title Add external plugin service to helm chart and single binary Add agent to helm chart and single binary Jun 9, 2023
Signed-off-by: Kevin Su <[email protected]>
service:
annotations:
projectcontour.io/upstream-protocol.h2c: grpc
type: NodePort
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason we want this to be Nodeport and not ClusterIP. Since the flyteAgent would be running primarily within the same cluster as propeller

Comment on lines 37 to 87
# Allow Event recording access
- apiGroups:
- ""
resources:
- events
verbs:
- create
- update
- delete
- patch
# Allow Access All plugin objects
- apiGroups:
- '*'
resources:
- '*'
verbs:
- get
- list
- watch
- create
- update
- delete
- patch
# Allow Access to CRD
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- list
- watch
- create
- delete
- update
# Allow Access to all resources under flyte.lyft.com
- apiGroups:
- flyte.lyft.com
resources:
- flyteworkflows
- flyteworkflows/finalizers
verbs:
- get
- list
- watch
- create
- update
- delete
- patch
- post
- deletecollection
Copy link
Contributor

@pmahindrakar-oss pmahindrakar-oss Jun 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need all these permissions

Comment on lines 31 to 36
resources:
- pods
verbs:
- get
- list
- watch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And similarly these. The agent would primarily be calling into external api's so not sure if we need these unless the agent is calling these for some kube api lookup and update

{{- end }}
ports:
- name: agent-grpc
port: 8000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this configurable in values chart and also use in the deployment yaml

Comment on lines 90 to 103
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ template "flyte.namespace" . -}}-{{- template "flyteagent.name" . }}
labels: {{ include "flyteagent.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "flyte.namespace" . -}}-{{- template "flyteagent.name" . }}
subjects:
- kind: ServiceAccount
name: {{ template "flyteagent.name" . }}
namespace: {{ template "flyte.namespace" . }}
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont see a need for this entirely , Please let me know where do we want to use clusterwide role for agent

Comment on lines 73 to 76
agent-service:
defaultGrpcEndpoint: flyteagent.flyte.svc.cluster.local:8000
supportedTaskTypes:
- bigquery_query_job_task
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making this configurable through values files can help testing new plugins easily and similarly L62

Signed-off-by: Kevin Su <[email protected]>
pingsutw added 7 commits June 9, 2023 13:22
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
@pingsutw
Copy link
Member Author

pingsutw commented Jun 9, 2023

@pmahindrakar-oss @eapolinario I've update the PR, and tested agent in the sandbox

Copy link
Contributor

@eapolinario eapolinario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much clearer. Left a few comments, but nothing showstopper.

Comment on lines 415 to 423
001-plugins.yaml: "plugins:\n logs:\n kubernetes-enabled: true\n kubernetes-template-uri:
http://localhost:30080/kubernetes-dashboard/#/log/{{.namespace }}/{{ .podName
}}/pod?namespace={{ .namespace }}\n cloudwatch-enabled: false\n stackdriver-enabled:
false\n k8s:\n co-pilot:\n image: \"cr.flyte.org/flyteorg/flytecopilot:v0.0.30\"\n
\ k8s-array:\n logs:\n config:\n kubernetes-enabled: true\n kubernetes-template-uri:
http://localhost:30080/kubernetes-dashboard/#/log/{{.namespace }}/{{ .podName
}}/pod?namespace={{ .namespace }}\n cloudwatch-enabled: false\n stackdriver-enabled:
false\n agent-service: \n defaultGrpcEndpoint: flyte-sandbox-http.flyte.svc.cluster.local:8000\n
\ supportedTaskTypes:\n - bigquery_query_job_task\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's auto-generated. I just fixed indentation errors.

@@ -81,16 +81,20 @@ data:
propeller:
disableWebhook: false
disabled: false
001-plugins.yaml: |
enabled_plugins.yaml: |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the numbering scheme for files is a convention used by k8s to enforce execution order. Does order matter in this case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved enabled_plugins to 001-plugins.yaml

charts/flyte-core/values-dataplane.yaml Outdated Show resolved Hide resolved
charts/flyte-core/values-controlplane.yaml Outdated Show resolved Hide resolved
pingsutw added 2 commits June 9, 2023 17:36
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Copy link
Contributor

@eapolinario eapolinario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome!

@eapolinario eapolinario merged commit 1ee95de into master Jun 12, 2023
@eapolinario eapolinario deleted the backend-plugin-system-grpc branch June 12, 2023 17:25
@pingsutw pingsutw mentioned this pull request Aug 9, 2023
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants