Roman
12/23/2023, 4:51 PMpull: prefect.deployments.steps.git_clone:
with Prefect flows running in a Kubernetes job? I'm exploring ways to speed up execution. Currently, whenever I update my flow code, I have to rebuild the image used in the Kubernetes job each time.Roman
12/23/2023, 5:08 PMentrypoint
directive in my Prefect deployment YAML does when using my own container. Is it just a path variable? Or does Prefect still retrieve the entrypoint flow code in some manner?Kevin Grismore
12/23/2023, 5:23 PMgit_clone
pull step for kubernetes jobs. the entrypoint
is the path to your flow function relative to the working directory (set either in your dockerfile or another pull step, or /opt/prefect
if you're using a prefect base image and don't change the working directory). prefect will supply its own container startup command by default for running a flow, which will then use the entrypoint to execute your flow function, so you don't need to provide that kind of information in your dockerfileRoman
12/25/2023, 4:41 PMdeployments:
- name: test-dep
path: /test-dir
entrypoint: test.py:sleep
work_pool:
name: my_k8s_work_pool
pull:
- prefect.deployments.steps.set_working_directory:
directory: /app
- prefect.deployments.steps.git_clone:
repository: <https://github.com/my_git_user/my_git_project.git>
dockerfile:
FROM prefecthq/prefect:2-python3.11-kubernetes
RUN mkdir /app
COPY test.py /app/test.py
From the execution logs, it seems that Prefect is searching for the flow function in /app/my_git_project/test.py
. This indicates that it first enters the working directory /app
and then navigates to the cloned my_git_project
directory. It appears that the path: /test-dir
directive is ignored in this case. Am I right?