Hi prefect community, I installed prefect agent f...
# prefect-kubernetes
s
Hi prefect community, I installed prefect agent from helm charts provided in the prefect GitHub repo. Now I wanted various python packages to be installed at the startup of the agent. So as per the documentation related to the docker image, I added EXTRA_PIP_PACKAGES environment variable in values.yaml of the helm chart. But when I check the agent pod,the dependencies are not installed. I verified that the environment variable is correctly set inside the pod. So the EXTRA_PIP_PACKAGES settings is not working for me. From my understanding, It is because agent might be starting with commands in the helm chart and not via the entrypoint(I am not sure). Does anyone faces the same issue? How are you installing extra packages? I tried custom images with dependency and it works. But I would like to use the environment variable approach.
c
Do you have an example? What extra packages do you need as part of the agent?
For an agent specifically, generally you would build your own image with the required packages. If this is the pods that are spawned from the agent, in-cluster, they would be set in prefect.yaml
That’s for runtime of flows though, not the agent/worker
s
Hi @Christopher Boyd It seems like a bug in the helm chart.I had the same issue as mentioned in following thread. https://prefect-community.slack.com/archives/CL09KU1K7/p1687411929237089 I see a bug issue has been created in github repo.
Basically if I start agent via docker in my local system with the environment variable set, the mentioned packages are installed. But if I chose the helm approach to start the agent and variable is set, it is ignored and packages are not installed.
c
I’m not exactly sure I understand or agree that this is a bug ? Packages are installed either into the Dockerfile before it is released , or by the prefect engine before a flow is run which is a prefect construct at execution time . The other alternative is to run this in an init container before the execution of the main container . I can see the scenario where maybe this could be a request for enhancement to add an init container , but if you need extra packages installed into your agent / worker , is including your packages in an updated image that you pull from not feasible ?
Maybe I’m mistaken though and it is a setting / with the prefect agent start
I’ll check on that bug that was opened and review with the team