Paco Ibañez
08/19/2022, 9:28 PMpackager
or storage
arguments but none of them are working for me.
deployment = Deployment.build_from_flow(
name="docker-example",
flow=my_docker_flow,
packager=FilePackager(filesystem=RemoteFileSystem.load('minio-docker')),
# storage_block=RemoteFileSystem.load('minio-docker'),
infrastructure=DockerContainer(
image = 'prefect-orion:2.1.1',
image_pull_policy = 'IF_NOT_PRESENT',
networks = ['prefect'],
env = {
"USE_SSL": False,
"AWS_ACCESS_KEY_ID": "blablabla",
"AWS_SECRET_ACCESS_KEY": "blablabla",
"ENDPOINT_URL": '<http://minio:9000>',
}
),
)
deployment.apply()
With the above code the deployment is created but the flow is not uploaded to minioIlya Galperin
08/19/2022, 9:37 PMfrom prefect.deployments import Deployment
from prefect.filesystems import S3
from my_project.flow import entrypoint
# creating the storage block
block = S3(bucket_path="cdp-prefect-storage/flows", aws_access_key=aws_access_key, aws_secret_access_key=aws_secret_access_key)
block.save("default-block", overwrite=True)
# building the deployment
deployment = Deployment.build_from_flow(
flow=entrypoint,
name="my_deployment",
work_queue_name="default",
storage=S3.load("default-block"),
infrastructure=infrastructure,
)
Paco Ibañez
08/20/2022, 1:29 PMDockerContainer
infrastructure to load the flow from minio