vk
09/03/2022, 6:49 PM@flow
def print_hi():
print(f'Hi, 123') # Press ⌘F8 to toggle the breakpoint.
deployment = Deployment.build_from_flow(
name="print_hi",
flow=print_hi,
skip_upload=True,
infrastructure=KubernetesJob(
image='my-image',
)
)
deployment.apply()
This created a deployment, but why does it say This deployment is deprecated
With the General Availability release of Prefect 2.0, we modified the approach to creating deployments.
? This is the code from latest test cases, prefect 2.3.1, how can it be deprecated? And why is "Run" button inactive?
my-image
is based on prefect-onion:latest
and has my flow code in /opt/prefect/flows
. By the way, how does it know which flow to run if there is more that one flow in that folder?Jeff Hale
09/03/2022, 8:19 PMvk
09/06/2022, 2:45 PMfrom prefect import flow
@flow
def docker_flow():
print(f'Hi, docker')
if __name__ == '__main__':
docker_flow()
and `ci_cd_process.py`:
from prefect.deployments import Deployment
from prefect.infrastructure import KubernetesJob
from docker_flow import docker_flow
deployment = Deployment.build_from_flow(
name="orion-docker-flow",
flow=docker_flow,
work_queue_name="default",
infrastructure=KubernetesJob(
image='prefecthq/prefect:2-python3.10',
)
)
print(deployment.apply())
still same issues, fresh clean env, python 3.10.6
any ideas what could be wrong?Jeff Hale
09/06/2022, 3:25 PM@flow
def print_hi():
print(f'Hi, 123') # Press ⌘F8 to toggle the breakpoint.
deployment = Deployment.build_from_flow(
name="print_hi",
flow=print_hi,
skip_upload=True,
infrastructure=KubernetesJob(
image='my-image',
)
)
deployment.apply()
with 2.3.1 and with Prefect Cloud as the server. No issues.
Are you using an Orion server that needs updated to a newer version of Prefect?vk
09/07/2022, 1:53 PMJeff Hale
09/07/2022, 3:08 PM