-
Has anyone managed to use a custom image when using the K8s code executor? I do not want to waste tokens and round trips between agents having them install python packages - and instead want to use an image with the python packages I want the agents to use pre-installed. I built an image locally and can run it in Docker but am not sure how I reference it in the code via the image parameter. I tried referring to it using the tag name etc. but nothing seems to work - everything just hangs indefinitely. I am not sure where to go next. Do I need to push the image somehow to the K8s cluster first? I am using minikube locally at the moment. For reference here is the documentation I am looking at : https://microsoft.github.io/autogen/0.2/docs/topics/code-execution/kubernetes-pod-commandline-code-executor/ At the moment my dockerfile is super simple:
I can build this and it spins up a container just fine with no errors using In my agent setup I tried to attach the code executor like this:
As soon as I add the image parameter the code just hangs when I initiate a conversation. No errors show - it just hangs. If I do not specify an image and it uses the default image all is good - the code executes spinning up K8s pods on the cluster. What am I missing? Thanks in advance for ideas! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Quick update - I now get this error after 60seconds:
It's like the pod is not getting spun up when I provide a different image - like it is searching for it and cannot find it. Do I need to register the image with a Kubernetes Registry? If I run
Matt |
Beta Was this translation helpful? Give feedback.
-
OK - I got it working! Was less an autogen and more a Kubernete's question! We need to ensure that the image gets stored in minikube's registry (not the local registry). After that, when creating pods, Kubernetes will find the image in minikube's local registry because we set
After building the local docker image, another key insight (thank you Claude!) was to include For future reference I used the Kubernetes pod configuration that worked for me was this:
|
Beta Was this translation helpful? Give feedback.
OK - I got it working! Was less an autogen and more a Kubernete's question!
We need to ensure that the image gets stored in minikube's registry (not the local registry). After that, when creating pods, Kubernetes will find the image in minikube's local registry because we set
image_pull_policy="Never"
in the pod spec.After building the local docker image, another key insight (thank you Claude!) was to include
image_pull_policy="Never"
in the pod spec so that the image was not pulled fr…