Hi Team, How do i identify the images correspondin...
# ask-community
r
Hi Team, How do i identify the images corresponding to Prefect V2 under Dockerhub prefecthq/server . The tags doesnt seem to be helpful in identifying it. Is there any documentation around using Dockerhub imags correctly ?
1
r
Hi Rahul, the Prefect 2 images are all in prefecthq/prefect on Docker Hub.
o
.. And there are no separate server images, it's all just prefect. 🙂
👍 1
r
ohh i was suspecting that.. thats great actually!! Thanks! I guess i should go through this Readme, but is there any additional documentation you can suggest ? In V1 we had images like prefecthq/ui prefecthq/apollo prefecthq/server but now everything is under prefecthq/prefect is that correct ?
r
That is correct! The same image can run the Prefect Orion server (which includes the UI and API) or a Prefect agent. You can even use the image to run CLI commands if you want to experiment with it before installing Prefect 2 locally. In case it's helpful, I put together a GitHub repo that shows how to do all of that using Docker Compose: https://github.com/rpeden/prefect-docker-compose
🙌 2
r
Awesome.. this will be helpful.. Thank you!!
@Ryan Peden Is Minio a mandatory requirement or you are just using it for some specific feature ?
r
I'm just using it to demonstrate remote storage. It's not required
1
r
@Ryan Peden I tried with docker image tags 2.6.6-python3.9-conda and 2.6.5-python3.10 in both of them i am getting this error while running in ECS
Copy code
ModuleNotFoundError: No module named 'psycopg2'
the dependency packages should be already there in docker images isnt it ?
r
Prefect uses
asyncpg
instead of
psycopg2
, so
psycopg2
isn't included in the image. If you're using Postgres instead of SQLite for Orion, make sure your connection string starts with
postgres-asyncpg
and not
postgres-psycopg2
r
ohh let me check this.. and yes im using postgres... i also see postgres-asyncpg way of connection string in the model repo you provided earlier... Thanks!!
@Ryan Peden if we use postgres, what is the least supported version.. looks like postgres 11 is not compitable... in your demo repo you are using 14...
r
Postgres 13 is the minimum requirement
r
yeah that makes sense.. i made progress from last error but because i was on PG 11, i am facing other errors... tomorrow i will try with PG 14... (working in IST timezone) Thanks for your help!
Hi @Ryan Peden , just making sure all my issues are here in one thread 😛 So, I am setting up server and agents in AWS ECS when i run the ECS agent with below command its
Copy code
prefect agent start -q ${QUEUE_NAME} \
      --run-task-kwargs /root/.prefect/kwargs.json \
      --task-definition /root/.prefect/task_definition_${AWS_ENV}.yaml \
      --cluster ${ECS_CLUSTER_NAME} \
      --task-role-arn ${FLOW_TASK_ROLE} \
      --execution-role-arn ${FLOW_EXECUTION_ROLE} \
      --task-definition-add-uuid true
It is failing with below error
Copy code
TypeError: loader must define exec_module()
even in local env. The variables and files mentioned in command are there.. this is how we were running it in previous version, minus the
-q queue name
. Any idea why it could be happening ?
r
Hi Rahul! Prefect 2 agents are infrastructure agnostic, so
prefect agent start
doesn't know what to do with the ECS-specific flags. Instead, you would need to set values in an ECSTask infrastructure block, which you can then use when creating deployments.
r
ohh, got it.. let me take look at docs and modify the agent to run the binary directly without these parameters
this makes sense because in previous version we used to run 'prefect agent ecs start.....'