Hi,
I need help in deployment while moving fromPrefect 2 to Prefect 3. Here is my deployment in prefect 2 :
We have created a docker image for our flows and store it in our private nexus repo.
Used following code to cretae abd save the docker
def set_docker_container(image_name: str, image_version: str, repo_url: str, environment: str):
docker_container = DockerContainer(
image=repo_url + image_name + ":" + image_version,
image_pull_policy="ALWAYS",
image_registry=DockerRegistry.load(image_name + "-registry"),
volumes=["//var/run/docker.sock:/var/run/docker.sock"]
)
docker_container.save(image_name + "-container-" + environment, overwrite=True)
deployment = Deployment.build_from_flow(
flow=flow,
name=flow_name + "-deployment" + "-" + env,
work_queue_name="claimsheroqueue-" + env,
work_pool_name="agent-" + env,
infrastructure=DockerContainer.load(args.image_name + "-container-" + env)
)
deployment.apply()
Now, when I move to Prefect 3.0 and use deploy() method on the flow like below, I am getting following error "Work pool 'agent-dev' does not support custom Docker images. Please use a work pool with an
image
variable in its base job template or specify a remote storage location for the flow with
.from_source
. If you are attempting to deploy a flow to a local process work pool, consider using
flow.serve
instead."
flow.deploy(
name=flow_name + "-deployment" + "-" + env,
work_queue_name="claimsheroqueue-" + env,
work_pool_name="agent-" + env,
build="False",
image=args.repo_url + args.image_name + ":" + args.image_version
)
Is it not possible to deploy the flows which are in custom docker image in private repo in Prefect 3.0?
Note : My work pool is of type "Prefect Agent"