Mohamed Zaki
08/24/2025, 5:32 PMname: work-wizard-demo
services:
api:
build:
context: .
dockerfile: docker/api/nonprod/Dockerfile
ports:
- "9832:9832"
environment:
PREFECT_API_URL: <http://server:4200/api>
volumes:
- ./api:/app
- ./autoupdate:/app/autoupdate
- ./core:/app/core
extra_hosts:
- "host.docker.internal:host-gateway"
env_file:
- .env
labels:
- "com.azcare.service=work-wizard-api"
- "com.azcare.domain=<http://demo-wizard-api.azcare.ai|demo-wizard-api.azcare.ai>"
healthcheck:
test: [ "CMD-SHELL", "curl -f <http://localhost:9832/health> || exit 1" ]
interval: 5s
timeout: 5s
retries: 5
restart: always
db:
image: postgres:14
environment:
POSTGRES_USER: prefect
POSTGRES_PASSWORD: prefect
POSTGRES_DB: prefect
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U prefect" ]
interval: 5s
timeout: 5s
retries: 5
restart: always
redis:
image: redis:7
volumes:
- redis_data:/data
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping" ]
interval: 5s
timeout: 5s
retries: 5
restart: always
server:
image: prefecthq/prefect:3.4.13-python3.11
labels:
- "com.azcare.service=work-wizard-server"
- "com.azcare.domain=<http://demo-wizard.azcare.ai|demo-wizard.azcare.ai>"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
PREFECT_API_DATABASE_CONNECTION_URL: <postgresql+asyncpg://prefect:prefect@db:5432/prefect>
PREFECT_SERVER_API_HOST: 0.0.0.0
PREFECT_UI_API_URL: "<https://demo-wizard.azcare.ai/api>"
PREFECT_MESSAGING_BROKER: prefect_redis.messaging
PREFECT_MESSAGING_CACHE: prefect_redis.messaging
PREFECT_REDIS_MESSAGING_HOST: redis
PREFECT_REDIS_MESSAGING_PORT: 6379
PREFECT_REDIS_MESSAGING_DB: 0
PREFECT_LOGGING_LEVEL: DEBUG
PREFECT_LOGGING_LOG_PRINTS: True
PREFECT_SERVER_LOGGING_LEVEL: DEBUG
PREFECT_SERVER_LOGGING_LOG_PRINTS: True
PREFECT_SERVER_API_AUTH_STRING: "admin:password"
command: prefect server start --no-services
ports:
- "4200:4200"
healthcheck:
test: [ "CMD-SHELL", "python -c 'import json,urllib.request,sys; sys.exit(0 if json.loads(urllib.request.urlopen(\"<http://localhost:4200/api/health>\", timeout=1).read()) is True else 1)' " ]
interval: 5s
timeout: 3s
retries: 30
restart: always
services:
image: prefecthq/prefect:3.4.13-python3.11
labels:
- "com.azcare.service=work-wizard-prefect"
- "com.azcare.domain=<http://demo-wizard.azcare.ai|demo-wizard.azcare.ai>"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
PREFECT_API_DATABASE_CONNECTION_URL: <postgresql+asyncpg://prefect:prefect@db:5432/prefect>
PREFECT_API_URL: <http://server:4200/api>
PREFECT_MESSAGING_BROKER: prefect_redis.messaging
PREFECT_MESSAGING_CACHE: prefect_redis.messaging
PREFECT_REDIS_MESSAGING_HOST: redis
PREFECT_REDIS_MESSAGING_PORT: 6379
PREFECT_REDIS_MESSAGING_DB: 0
command: prefect server services start
restart: always
create-autoupdate-deployment:
image: prefect-workpool
build:
context: .
dockerfile: docker/autoupdate/Dockerfile
depends_on:
server:
condition: service_healthy
environment:
PREFECT_API_URL: <http://server:4200/api>
PREFECT_SERVER_API_AUTH_STRING: "admin:password"
# command: prefect deployment build autoupdate/pipeline/deployment.py:autoupdate_pipeline --name autoupdate-pipeline --cron "0 0 * * *" --timezone "America/New_York" --infra prefect-wizard-infra --storage-block prefect-s3-block
command: bash -c "cd /opt/prefect/autoupdate && prefect --no-prompt deploy --name autoupdate-deployment"
volumes:
- ./autoupdate:/opt/prefect/autoupdate
- ./core:/opt/prefect/autoupdate/core
env_file:
- .env
autoupdate-worker:
image: prefect-workpool
depends_on:
server:
condition: service_healthy
services:
condition: service_started
create-autoupdate-deployment:
condition: service_completed_successfully
environment:
PREFECT_API_URL: <http://localhost:4200/api>
DOCKER_HOST: <tcp://localhost:2375>
PREFECT_SERVER_API_AUTH_STRING: "admin:password"
# DOCKER_TLS_VERIFY: ${DOCKER_TLS_VERIFY:-}
# DOCKER_CERT_PATH: ${DOCKER_CERT_PATH:-}
network_mode: host
volumes:
- ./autoupdate:/opt/prefect/autoupdate
- ./core:/opt/prefect/autoupdate/core
- ${HOME}/.wizard:/logs
env_file:
- .env
restart: always
volumes:
postgres_data:
redis_data:
networks:
default:
name: work-wizard-network
And here's the error:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/prefect/cli/_utilities.py", line 44, in wrapper
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect/cli/_types.py", line 156, in sync_fn
return asyncio.run(async_fn(*args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect/cli/deploy.py", line 483, in deploy
await _run_single_deploy(
File "/usr/local/lib/python3.11/site-packages/prefect/cli/deploy.py", line 548, in _run_single_deploy
work_pool = await client.read_work_pool(deploy_config["work_pool"]["name"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect/client/orchestration/_work_pools/client.py", line 416, in read_work_pool
response = await self.request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect/client/orchestration/base.py", line 53, in request
return await self._client.send(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect/client/base.py", line 379, in send
response.raise_for_status()
File "/usr/local/lib/python3.11/site-packages/prefect/client/base.py", line 163, in raise_for_status
raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__
prefect.exceptions.PrefectHTTPStatusError: Client error '401 Unauthorized' for url '<http://server:4200/api/work_pools/auto-update-pool>'
Response: {'exception_message': 'Unauthorized'}
For more information check: <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401>
An exception occurred.
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/prefect/cli/_utilities.py", line 44, in wrapper
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect/cli/_types.py", line 156, in sync_fn
return asyncio.run(async_fn(*args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect/cli/deploy.py", line 483, in deploy
await _run_single_deploy(
File "/usr/local/lib/python3.11/site-packages/prefect/cli/deploy.py", line 548, in _run_single_deploy
work_pool = await client.read_work_pool(deploy_config["work_pool"]["name"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect/client/orchestration/_work_pools/client.py", line 416, in read_work_pool
response = await self.request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect/client/orchestration/base.py", line 53, in request
return await self._client.send(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect/client/base.py", line 379, in send
response.raise_for_status()
File "/usr/local/lib/python3.11/site-packages/prefect/client/base.py", line 163, in raise_for_status
raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__
prefect.exceptions.PrefectHTTPStatusError: Client error '401 Unauthorized' for url '<http://server:4200/api/work_pools/auto-update-pool>'
Response: {'exception_message': 'Unauthorized'}
For more information check: <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401>
An exception occurred
Marvin
08/24/2025, 5:32 PMMarvin
08/24/2025, 5:32 PMMohamed Zaki
08/24/2025, 5:32 PMname work-wizard-demo services api build context dockerfile docker/api/nonprod/Dockerfile ports - 9832 9832 environment PREFECT_API_URL <http //server 4200/api> volumes - /api /app - /autoupdate /app/autoupdate - /core /app/core extra_hosts - host docker internal host-gateway env_file - env labels - com azcare service=work-wizard-api - com azcare domain=<http //demo-wizard-api azcare ai|demo-wizard-api azcare ai> healthcheck test [ CMD-SHELL curl -f <http //localhost 9832/health> || exit 1 ] interval 5s timeout 5s retries 5 restart always db image postgres 14 environment POSTGRES_USER prefect POSTGRES_PASSWORD prefect POSTGRES_DB prefect volumes - postgres_data /var/lib/postgresql/data healthcheck test [ CMD-SHELL pg_isready -U prefect ] interval 5s timeout 5s retries 5 restart always redis image redis 7 volumes - redis_data /data healthcheck test [ CMD-SHELL redis-cli ping ] interval 5s timeout 5s retries 5 restart always server image prefecthq/prefect 3 4 13-python3 11 labels - com azcare service=work-wizard-server - com azcare domain=<http //demo-wizard azcare ai|demo-wizard azcare ai> depends_on db condition service_healthy redis condition service_healthy environment PREFECT_API_DATABASE_CONNECTION_URL <postgresql+asyncpg //prefect prefect@db 5432/prefect> PREFECT_SERVER_API_HOST 0 0 0 0 PREFECT_UI_API_URL <https //demo-wizard azcare ai/api> PREFECT_MESSAGING_BROKER prefect_redis messaging PREFECT_MESSAGING_CACHE prefect_redis messaging PREFECT_REDIS_MESSAGING_HOST redis PREFECT_REDIS_MESSAGING_PORT 6379 PREFECT_REDIS_MESSAGING_DB 0 PREFECT_LOGGING_LEVEL DEBUG PREFECT_LOGGING_LOG_PRINTS True PREFECT_SERVER_LOGGING_LEVEL DEBUG PREFECT_SERVER_LOGGING_LOG_PRINTS True PREFECT_SERVER_API_AUTH_STRING admin password command prefect server start --no-services ports - 4200 4200 healthcheck test [ CMD-SHELL python -c 'import json urllib request sys; sys exit(0 if json loads(urllib request urlopen(\ <http //localhost 4200/api/health>\ timeout=1) read()) is True else 1)' ] interval 5s timeout 3s retries 30 restart always services image prefecthq/prefect 3 4 13-python3 11 labels - com azcare service=work-wizard-prefect - com azcare domain=<http //demo-wizard azcare ai|demo-wizard azcare ai> depends_on db condition service_healthy redis condition service_healthy environment PREFECT_API_DATABASE_CONNECTION_URL <postgresql+asyncpg //prefect prefect@db 5432/prefect> PREFECT_API_URL <http //server 4200/api> PREFECT_MESSAGING_BROKER prefect_redis messaging PREFECT_MESSAGING_CACHE prefect_redis messaging PREFECT_REDIS_MESSAGING_HOST redis PREFECT_REDIS_MESSAGING_PORT 6379 PREFECT_REDIS_MESSAGING_DB 0 command prefect server services start restart always create-autoupdate-deployment image prefect-workpool build context dockerfile docker/autoupdate/Dockerfile depends_on server condition service_healthy environment PREFECT_API_URL <http //server 4200/api> PREFECT_SERVER_API_AUTH_STRING admin password # command prefect deployment build autoupdate/pipeline/deployment py autoupdate_pipeline --name autoupdate-pipeline --cron 0 0 * * * --timezone America/New_York --infra prefect-wizard-infra --storage-block prefect-s3-block command bash -c cd /opt/prefect/autoupdate && prefect --no-prompt deploy --name autoupdate-deployment volumes - /autoupdate /opt/prefect/autoupdate - /core /opt/prefect/autoupdate/core env_file - env autoupdate-worker image prefect-workpool depends_on server condition service_healthy services condition service_started create-autoupdate-deployment condition service_completed_successfully environment PREFECT_API_URL <http //localhost 4200/api> DOCKER_HOST <tcp //localhost 2375> PREFECT_SERVER_API_AUTH_STRING admin password # DOCKER_TLS_VERIFY ${DOCKER_TLS_VERIFY -} # DOCKER_CERT_PATH ${DOCKER_CERT_PATH -} network_mode host volumes - /autoupdate /opt/prefect/autoupdate - /core /opt/
[8:32 PM]
prefect/autoupdate/core - ${HOME}/ wizard /logs env_file - env restart always volumes postgres_data redis_data networks default name work-wizard-network
And here's the error ```Traceback (most recent call last) File /usr/local/lib/python3 11/site-packages/prefect/cli/_utilities py line 44 in wrapper return fn(*args *kwargs) ^^^^^^^^^^^^^^^^^^^ File /usr/local/lib/python3 11/site-packages/prefect/cli/_types py line 156 in sync_fn return asyncio run(async_fn(*args *kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File /usr/local/lib/python3 11/asyncio/runners py line 190 in run return runner run(main) ^^^^^^^^^^^^^^^^ File /usr/local/lib/python3 11/asyncio/runners py line 118 in run return self _loop run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File /usr/local/lib/python3 11/asyncio/base_events py line 654 in run_until_complete return future result() ^^^^^^^^^^^^^^^ File /usr/local/lib/python3 11/site-packages/prefect/cli/deployMarvin
08/24/2025, 5:32 PMMarvin
08/24/2025, 5:32 PMMohamed Zaki
08/24/2025, 5:35 PMserver:
image: prefecthq/prefect:3.4.13-python3.11
labels:
- "com.azcare.service=work-wizard-server"
- "com.azcare.domain=<http://demo-wizard.azcare.ai|demo-wizard.azcare.ai>"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
PREFECT_API_DATABASE_CONNECTION_URL: <postgresql+asyncpg://prefect:prefect@db:5432/prefect>
PREFECT_SERVER_API_HOST: 0.0.0.0
PREFECT_UI_API_URL: "<https://demo-wizard.azcare.ai/api>"
PREFECT_MESSAGING_BROKER: prefect_redis.messaging
PREFECT_MESSAGING_CACHE: prefect_redis.messaging
PREFECT_REDIS_MESSAGING_HOST: redis
PREFECT_REDIS_MESSAGING_PORT: 6379
PREFECT_REDIS_MESSAGING_DB: 0
PREFECT_LOGGING_LEVEL: DEBUG
PREFECT_LOGGING_LOG_PRINTS: True
PREFECT_SERVER_LOGGING_LEVEL: DEBUG
PREFECT_SERVER_LOGGING_LOG_PRINTS: True
PREFECT_SERVER_API_AUTH_STRING: "admin:password"
command: prefect server start --no-services
ports:
- "4200:4200"
healthcheck:
test: [ "CMD-SHELL", "python -c 'import json,urllib.request,sys; sys.exit(0 if json.loads(urllib.request.urlopen(\"<http://localhost:4200/api/health>\", timeout=1).read()) is True else 1)' " ]
interval: 5s
timeout: 3s
retries: 30
restart: always
create-autoupdate-deployment:
image: prefect-workpool
build:
context: .
dockerfile: docker/autoupdate/Dockerfile
depends_on:
server:
condition: service_healthy
environment:
PREFECT_API_URL: <http://server:4200/api>
PREFECT_SERVER_API_AUTH_STRING: "admin:password"
# command: prefect deployment build autoupdate/pipeline/deployment.py:autoupdate_pipeline --name autoupdate-pipeline --cron "0 0 * * *" --timezone "America/New_York" --infra prefect-wizard-infra --storage-block prefect-s3-block
command: bash -c "cd /opt/prefect/autoupdate && prefect --no-prompt deploy --name autoupdate-deployment"
volumes:
- ./autoupdate:/opt/prefect/autoupdate
- ./core:/opt/prefect/autoupdate/core
env_file:
- .env
autoupdate-worker:
image: prefect-workpool
depends_on:
server:
condition: service_healthy
services:
condition: service_started
create-autoupdate-deployment:
condition: service_completed_successfully
environment:
PREFECT_API_URL: <http://localhost:4200/api>
DOCKER_HOST: <tcp://localhost:2375>
PREFECT_SERVER_API_AUTH_STRING: "admin:password"
# DOCKER_TLS_VERIFY: ${DOCKER_TLS_VERIFY:-}
# DOCKER_CERT_PATH: ${DOCKER_CERT_PATH:-}
network_mode: host
volumes:
- ./autoupdate:/opt/prefect/autoupdate
- ./core:/opt/prefect/autoupdate/core
- ${HOME}/.wizard:/logs
env_file:
- .env
restart: always
I get this auth error with create-autoupdate-deployment:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect/client/base.py", line 379, in send
response.raise_for_status()
File "/usr/local/lib/python3.11/site-packages/prefect/client/base.py", line 163, in raise_for_status
raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__
prefect.exceptions.PrefectHTTPStatusError: Client error '401 Unauthorized' for url '<http://server:4200/api/work_pools/auto-update-pool>'
Response: {'exception_message': 'Unauthorized'}
For more information check: <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401>
Marvin
08/24/2025, 5:35 PMresearch_prefect_topic
📊 Tools used:
• research_prefect_topic
(1x)