Hello all. Reposting a post I made to <#C048K1CAV7...
# prefect-getting-started
d
Hello all. Reposting a post I made to #C048K1CAV7Z here. https://prefect-community.slack.com/archives/C048K1CAV7Z/p1697891964004619 I continue to have problems getting a work pool created in Azure as outlined here. I have tried a number of variations to the following:
Copy code
az container create \
--resource-group data-non-production \
--name prefect-agent-test \
--image prefecthq/prefect:2-python3.10 \
--secure-environment-variables PREFECT_API_URL='<https://api.prefect.cloud/api/accounts/XXXXXX/workspaces/XXXXXX>' PREFECT_API_KEY='XXXXXX' \
--command-line "/bin/bash -c 'pip install adlfs s3fs requests pandas; prefect agent start -p default-agent-pool -q test'"
In all cases, the container goes into a waiting state and no work pool is created. I get different log results, but nothing that is useful. I'm sure this is more of an Azure thing, but hoping someone can chime in and tell me that I'm doing something obviously wrong.
k
Hi David! Based on the screenshots you posted, it looks like the command line args aren't working as expected. The pip packages are installing, but the second part of the command isn't executing. I wonder if there's something ACI is having trouble parsing there. The ACI guide you're following was made some time ago. If you don't have any existing deployments, it might be worth trying to create a Container Instance Worker rather than an agent.
d
Thanks Kevin. I just tried to create the instance via the Azure Console instead of using the CLI. I get a start failure, but no additional info in the logs that indicates the cause of the failure. Gotta love Azure. I'll try the the worker instead.
k
I would also try replacing the entire command with
prefect worker start --pool 'my-work-pool' --type azure-container-instance
, leaving out the pip installation steps just to eliminate any other potential causes here
d
@Keith Smith - I can run the
prefect worker start
command locally, and it spins up a local worker that is visible in Prefect. But when I try to run it on the Azure container as part of the container create command, I get similar results as before. Without the pip install line, the returned status shows the instance starts, but then gets killed. It says ERROR, but doesn't provide any detail. This is the full command I ran:
Copy code
az container create \
--resource-group data-non-production \
--name prefect-agent-test \
--image prefecthq/prefect:2-python3.10 \
--secure-environment-variables PREFECT_API_URL='<https://api.prefect.cloud/api/accounts/XXXXXX/workspaces/XXXXXXX>' PREFECT_API_KEY='XXXXX' \
--command-line "/bin/bash -c 'prefect worker start --pool 'my-test-pool' --type azure-container-instance'"
I'm not sure if this is related, but I also tried to stand up a new Azure container via the Azure Console using the
prefecthq/prefect:2-python3.10
image. I did not include any command line args when spinning up the instance via the console. If you look at the log from screenshot I sent earlier, you'll see a
tini WARN
message. Sometime after this, the container was killed.
k
I think this might be a formatting error, can you try it without the single quotes around
my-test-pool
?
-command-line "/bin/bash -c 'prefect worker start --pool my-test-pool --type azure-container-instance'"
d
@Kevin Grismore - thanks, but that didn't work either. Got same results. Here is exact command I executed: