-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: No module named '__prefect_loader__'
move deployments into their own module so the flow module name can be determined see PrefectHQ/prefect#5984 (comment)
- Loading branch information
Showing
4 changed files
with
51 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
FROM prefecthq/prefect:2.0b8-python3.9 | ||
|
||
# used by the file-packager deployment to fetch flow | ||
# from the remote file system using fsspec | ||
RUN pip install s3fs | ||
|
||
# point fsspec at minio inside the cluster | ||
COPY config/fsspec-minio.json config/fsspec.json | ||
ENV FSSPEC_CONFIG_DIR=/opt/prefect/config | ||
|
||
# add flows so they can be referenced by import path | ||
# by the orion-packager-import deployment | ||
COPY flows flows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from prefect.deployments import Deployment | ||
from prefect.filesystems import RemoteFileSystem | ||
from prefect.flow_runners import KubernetesFlowRunner | ||
from prefect.packaging.file import FilePackager | ||
from prefect.packaging.orion import OrionPackager | ||
from prefect.packaging.serializers import ImportSerializer | ||
|
||
from flows.kubes_flow import kubes_flow | ||
|
||
# use the default packager (OrionPackager) to store the flow's source file | ||
# as an anonymous JSON block in the Orion database. The block is encrypted. | ||
Deployment( | ||
name="orion-packager", | ||
flow=kubes_flow, | ||
flow_runner=KubernetesFlowRunner( | ||
image="orion-registry:5000/flow:latest", | ||
), | ||
) | ||
|
||
# use the OrionPackager with the ImportSerializer to store the flow's import path | ||
# as a JSON block in the database, for import at runtime. Requires the flow be | ||
# baked into the the docker image. | ||
Deployment( | ||
name="orion-packager-import", | ||
flow=kubes_flow, | ||
flow_runner=KubernetesFlowRunner( | ||
image="orion-registry:5000/flow:latest", | ||
), | ||
packager=OrionPackager(serializer=ImportSerializer()), | ||
) | ||
|
||
# use the FilePackager to store the flow's source file in S3 using fsspec | ||
Deployment( | ||
name="file-packager", | ||
flow=kubes_flow, | ||
flow_runner=KubernetesFlowRunner( | ||
image="orion-registry:5000/flow:latest", | ||
# use to read the stored flow from minio when the flow executes | ||
env={"AWS_ACCESS_KEY_ID": "minioadmin", "AWS_SECRET_ACCESS_KEY": "minioadmin"}, | ||
), | ||
packager=FilePackager(filesystem=RemoteFileSystem(basepath="s3://minio-flows/")), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters