hey there :wave:! Trying to deploy my custom agent...
# ask-the-community
hey there 👋! Trying to deploy my custom agent, I’m not sure what the following instruction means:
Update the FlyteAgent deployment's image
. From that manifest I understand the command is
pyflyte serve <my-docker-image>
but none of the k8s Deployments I have running do run that cmd 🤔 https://docs.flyte.org/projects/cookbook/en/latest/auto_examples/extend_flyte/agent_service.html#update-flyteagent
are Agent svc and deployment supposed to spawn on-demand?
cc @Kevin Su
it’s a new feature, so it disable by default. agent is running in the deployment, so you should build a new image when adding a custom agent. https://github.com/flyteorg/flyte/blob/dfb56f4639a57d519d8fc48cae7d192a385fc160/charts/flyte-core/values.yaml#L211
image is not part of args in pyflyte serve. you will build a new image, and the entrypoint of the image is pyflyte serve, which will start a gRPC server.
hi @Kevin Su thanks for that! How’s the above different from adding the following to configmap?
Copy code
        - default_task
        - bacalhau_task
      # By default, all the request will be sent to the default agent.
        endpoint: "dns:///flyteagent.flyte.svc.cluster.local:8000"
        insecure: true
          GetTask: 200ms
        defaultTimeout: 50ms
          endpoint: "dns:///myagent-flyteagent.flyte.svc.cluster.local:8000"
          insecure: true
          defaultServiceConfig: '{"loadBalancingConfig": [{"round_robin":{}}]}'
            GetTask: 100ms
          defaultTimeout: 20ms
        # It will override the default agent for custom_task, which means propeller will send the request to this agent.
        - mytask_task: mytask_agent
reference: https://docs.flyte.org/projects/cookbook/en/stable/auto_examples/extend_flyte/agent_service.html#update-flyteagent
The above config is to enable agent chart, so
helm install flytekit-core
will create agent deployment. the configmap stuff is to enable agent service, and add your custom agent config in the flytepropeller
Also, how to add my custom agent in https://github.com/flyteorg/flyte/blob/dfb56f4639a57d519d8fc48cae7d192a385fc160/charts/flyte-core/values.yaml#L211 ?
you need to create a dockerfile, and install your custom flytekit plugin containing your agent. Then, replace the default image
with your new image. The gRPC server will automatically load your agent when it’s running