I'd like to use a container that defines its own `...
# ask-community
w
I'd like to use a container that defines its own `ENTRYPOINT`as the image that prefect/dask workers and schedulers run, but when I try it, Prefect seems to expect
/bin/sh
as an entrypoint. Is there any way to override that?
Copy code
% kubectl logs -f prefect-job-4ecc8682-d679n                                                                                                                                 
usage: addemart [-h] [-V] [-v] [-q] {register-flow,run-flow,run-stage} ...
addemart: error: argument command: invalid choice: 'prefect' (choose from 'register-flow', 'run-flow', 'run-stage')
(addemart is the entrypoint script in my container)
z
Hey @Wilson Bilkovich, is this image being used for flow execution?
w
Yeah
We've got this python module that knows how to register and run flows, as well as doing the work that the actual tasks call for
and I was going to use the image we build for that module as the container image all around, so that things are always local and don't need remote storage/auth
z
Hmm gotcha. The Kubernetes agent automatically sets the container arguments to
"prefect execute flow-run"
. Any chance you were using an agent to start this container?
w
Isn't the agent what starts containers in general?
I think from the name that this is 'after' the agent has done its work though?
Because this is a prefect-job not the agent pod
z
yep the agent is what starts containers in general, including jobs to execute flow runs (just wanted to make sure your logs were from flow execution since the container is multipurpose)
w
The Helm chart added this on initial setup:
Copy code
58         - name: IMAGE_PULL_SECRETS
 59           value: '[]'
z
part of the kubernetes agent's "work' is to create the yaml for deployment https://github.com/PrefectHQ/prefect/blob/master/src/prefect/agent/kubernetes/agent.py#L692
w
but I can't seem to find any documentation about that env var; do you happen to know what format it expects?
would it just be `["regcred"]`if my pull secret is
regcred
?
Hmm. So it just sets args but expects a shell as an entry point
I would be nice if we could end up passing
--entrypoint
to Docker as an option
z
I believe
IMAGE_PULL_SECRETS
should just be a string
'regcred'
w
Even though the default has brackets like it's a list?
z
Ah nope I take that back, I believe you're right it should be a list
w
Sorry for my confusion, but does the
prefect execute flow-run
take place on the worker pod? I feel like it runs on the scheduler container that the agent launches.. in other words, the thing that launches the actual worker pods?
agent -> scheduler -> [ n_workers ]?
I'm trying to figure out where my container image needs to be used, amongst the above
z
It works roughly like this • Agent is running via
prefect agent <type> start
• Agent queries Server/Cloud for flow runs • If a flow run is found, the Agent creates a job template for the scheduler pod using information from the run config (this pod has an image that runs the
prefect execute flow-run
command • Worker pods may be spun up by the scheduler to execute tasks, I don't think they need to run
prefect execute flow-run
Sorry for any confusing language in my responses, I'm not very familiar with Dask/Kubernetes