Matt Delacour
02/14/2023, 3:07 PMmy_project.git
/src/
/src/dbt/
/src/dbt/Earthfile # Equivalent to Dockerfile
/src/dbt/my_prefect_job.py
/src/dbt/...
And my Earthfile is like
FROM prefecthq/prefect:2.7-python3.10
WORKDIR /code
...
COPY . .
And so my_prefect_job.py
is under /code/my_prefect_job.py
in my docker image and under /src/dbt/
in my gitlab repository
But once deployed, the run output the following
Downloading flow code from storage at 'src/dbt'
Flow could not be retrieved from deployment.
Traceback (most recent call last):
File "<frozen importlib._bootstrap_external>", line 879, in exec_module
File "<frozen importlib._bootstrap_external>", line 1016, in get_code
File "<frozen importlib._bootstrap_external>", line 1073, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/code/prefect_job.py'
And so I don't understand why it cannot find my flow in gitlab under the right subdirectory nor the flow in the docker contain under the right path 🤷
Did not find any good example about github/gitlab subdir storage strategy.
Thanks in advance 🙏Aaron Gonzalez
02/14/2023, 3:59 PMCOPY . /opt/prefect/flows/
instead?Matt Delacour
02/14/2023, 4:16 PMChristopher Boyd
02/14/2023, 7:58 PMFileNotFoundError: [Errno 2] No such file or directory: '/code/prefect_job.py'
has a different file name than what you reference: /src/dbt/my_prefect_job.py
Matt Delacour
02/14/2023, 9:47 PM/code/prefect_job.py
exists in my docker image
while
/src/dbt/my_prefect_job.py
exists in my repository
And I don't know for which source (docker image or repository) this FileNotFoundError refers toI cannot find any mention ofFileNotFoundError: [Errno 2] No such file or directory: '/code/prefect_job.py'
/code/prefect_job.py
in my repo.
This is really weirdChristopher Boyd
02/17/2023, 1:01 AMpath
and entrypoint
- path is the relative path of your remote storage, and entrypoint is the file/flow defined.
https://github.com/PrefectHQ/prefect/blob/main/src/prefect/deployments.py#L240
So i’d expect something like path=/src/dbt/
and entrypoint=my_prefect_job.py:<flowname>
Braun Reyes
04/21/2023, 5:48 PMprefect deployment build -a data-products/src/orchestration/main_orchestration_flow.py:main_orchestration_flow -sb github/data-flows-dev/data-products/src/orchestration --name base
Matt Delacour
04/30/2023, 8:00 PM