Open d-jeph opened 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 77.00%. Comparing base (
b246e24
) to head (b6b5190
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hi @d-jeph , thank you submitting this PR. Its super helpful.
For prefect, we have upgraded from agents
to workers
. This issue has the details
Can we incorporate this in the docker-compose.yml
?
Also will we be able to start mutliple workers in the current setup ? On production we use 3 - 2 workers execute work from ddp
queue and 1 from manual-dbt
queue.
Hi @d-jeph , thank you submitting this PR. Its super helpful.
For prefect, we have upgraded from
agents
toworkers
. This issue has the details Can we incorporate this in thedocker-compose.yml
?Also will we be able to start mutliple workers in the current setup ? On production we use 3 - 2 workers execute work from
ddp
queue and 1 frommanual-dbt
queue.
@Ishankoradia Thanks. I will update the code to use workers and also the multiple workers
Hi @d-jeph , thank you submitting this PR. Its super helpful. For prefect, we have upgraded from
agents
toworkers
. This issue has the details Can we incorporate this in thedocker-compose.yml
? Also will we be able to start mutliple workers in the current setup ? On production we use 3 - 2 workers execute work fromddp
queue and 1 frommanual-dbt
queue.@Ishankoradia Thanks. I will update the code to use workers and also the multiple workers
@Ishankoradia I have pushed the updated docker-compose.yml
. I could not find a straight forward way for making the number of workers dynamic so for now I have three different services, one for each worker
@fatchat I added a github actions workflow change to this PR as well.
Thanks @d-jeph i will take a look at this and merge it before the weekend.
Hi @d-jeph , the docker compose works very nicely. I am able to run proxy + prefect on my current local database via docker.
One thing i noticed, when i run an existing prefect deployment (from its UI, where prefect is running via docker). It throws this error. Although the flow is getting submitted to the container worker but looks like it is still trying to find the code (to be run) from the host. Wanted to check if you have faced this before, looks we might have to update the existing deployment to read from prefect-proxy's storage instead of host somehow.
@Ishankoradia Thanks for flagging this. Yes we experienced the same issue when we tested this on GCP. I have updated the docker compose files to add a shared volume between the proxy service(where the flow code lives) and the prefect worker containers. This should help prefect get access to the flow code. Please test and let me know if you get any errors.
Hey @d-jeph thanks for making the changes. This is what i found in testing experiment
docker compose up
and connected it to my local prefect that has whole lot of deployments setupdepolyment
and update the column path
to /app
. This is absolutely fine, we could run a script that does this for our current deployments if/when we move to dockerize production deployment.What i suspect the problem is, we are using a new prefect image (a different env) for each worker and the prefect itself. The way we have setup in our deployment currently is - we run all workers & the prefect from the same environment as proxy (requirements.txt
). We need to somehow make sure that the env for workers & prefect_server & proxy are same or atleast have same dependencies
@Ishankoradia Thanks for sharing this.
I have now setup a new Docker file Dockerfile.prefect_server
that creates a prefect server image that includes the same dependencies as the proxy service - this is the image used now in the docker compose for the prefect server and worker service. When I used the proxy requirements.txt
I however got an error cannot import name 'safe _get_annotation' from 'griffe.agents-nodes'
so I had to upgrade the griffe
package to the newest version 0.47.0
. Please let me know if you've encountered the error
I have also noticed the team upgraded prefect to a new version 2.18.3
so I upgraded the image used as well.
Please test and let me know if you experience any errors on your end.
Feature: Dockerize Prefect Server, Agent and Proxy
Issue
In the current setup it's not possible to run prefect, prefect agent and the proxy as docker containers. This PR adds the necessary docker files to enable running these services as containers.
Changes
Added the following files and folders:
Docker
folder with adocker_compose.yml
file andenv.template
file. Thedocker_compose
file has three services:prefect_proxy
,server
, andagent
Dockerfile
for the proxy python applicationenv.template
file contains the necessary environment variables for thedocker_compose
filedocker_compose.dev.yml
for running the services locally during development and testingdocker.yml
that contains a Github actions workflow for pushing the docker images to docker hub