my prefect server setup prefect-metrics.waow.tech
python orchestration
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

use python 3.14 image + uv run --with for ephemeral flow envs

- switch base image to prefecthq/prefect:3-python3.14-kubernetes (has uv built in)
- command override: uv run --with git+tangled.sh creates an ephemeral env per flow run,
solving the ordering problem (deps available before pull steps)
- pull step simplified to just clone (for flow files on disk)
- remove UV_PROJECT_ENVIRONMENT hack from work pool
- DRY up prefect.yaml with YAML anchors for work pool config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

zzstoatzz 644d9ecc d6276c42

+20 -24
+16 -21
prefect.yaml
··· 3 3 pull: 4 4 - prefect.deployments.steps.run_shell_script: 5 5 script: | 6 - bash -c "rm -rf my-prefect-server && (git clone --depth 1 --branch main https://tangled.sh/zzstoatzz.io/my-prefect-server.git my-prefect-server || git clone --depth 1 --branch main https://github.com/zzstoatzz/my-prefect-server.git my-prefect-server) && cd my-prefect-server && pip install -q -U uv && export PATH=\"$HOME/.local/bin:$PATH\" UV_PROJECT_ENVIRONMENT=.venv && uv python install 3.14 && uv sync --python 3.14" 6 + bash -c "rm -rf my-prefect-server && (git clone --depth 1 --branch main https://tangled.sh/zzstoatzz.io/my-prefect-server.git my-prefect-server || git clone --depth 1 --branch main https://github.com/zzstoatzz/my-prefect-server.git my-prefect-server)" 7 7 - prefect.deployments.steps.set_working_directory: 8 8 directory: my-prefect-server 9 9 10 + definitions: 11 + work_pools: 12 + k8s: &k8s 13 + name: kubernetes-pool 14 + job_variables: 15 + command: >- 16 + uv run 17 + --with 'my-prefect-server @ git+https://tangled.sh/zzstoatzz.io/my-prefect-server.git' 18 + prefect flow-run execute 19 + 10 20 deployments: 11 21 - name: diagnostics 12 22 entrypoint: flows/diagnostics.py:diagnostics 13 - work_pool: 14 - name: kubernetes-pool 15 - job_variables: 16 - command: uv run prefect flow-run execute 23 + work_pool: *k8s 17 24 schedules: 18 25 - cron: "*/5 * * * *" 19 26 20 27 - name: gh-notifications 21 28 entrypoint: flows/gh_notifications.py:gh_notifications 22 - work_pool: 23 - name: kubernetes-pool 24 - job_variables: 25 - command: uv run prefect flow-run execute 29 + work_pool: *k8s 26 30 schedules: 27 31 - cron: "0 * * * *" # hourly 28 32 parameters: ··· 30 34 31 35 - name: tangled-items 32 36 entrypoint: flows/tangled_items.py:tangled_items 33 - work_pool: 34 - name: kubernetes-pool 35 - job_variables: 36 - command: uv run prefect flow-run execute 37 + work_pool: *k8s 37 38 schedules: 38 39 - cron: "0 * * * *" # hourly 39 40 40 41 - name: enrich 41 42 entrypoint: flows/enrich.py:enrich 42 - work_pool: 43 - name: kubernetes-pool 44 - job_variables: 45 - command: uv run prefect flow-run execute 43 + work_pool: *k8s 46 44 concurrency_limit: 1 47 45 schedules: 48 46 - cron: "5 * * * *" # 5 minutes after gh-notifications 49 47 50 48 - name: cleanup 51 49 entrypoint: flows/cleanup.py:cleanup 52 - work_pool: 53 - name: kubernetes-pool 54 - job_variables: 55 - command: uv run prefect flow-run execute 50 + work_pool: *k8s 56 51 schedules: 57 52 - cron: "0 2 * * 0" 58 53 parameters:
+4 -3
scripts/patch_work_pool.py
··· 45 45 envs = props.setdefault("env", {}).setdefault("default", {}) 46 46 envs["PREFECT_LOCAL_STORAGE_PATH"] = "/prefect-results" 47 47 envs["ANALYTICS_DB_PATH"] = "/prefect-analytics/analytics.duckdb" 48 - # tell uv sync to install into system Python instead of creating a .venv — 49 - # this makes deps available to the prefect engine without any sys.path hacks 50 - envs["UV_PROJECT_ENVIRONMENT"] = "/usr/local" 48 + envs.pop("UV_PROJECT_ENVIRONMENT", None) 49 + 50 + # use python 3.14 base image (uv is pre-installed) 51 + props.setdefault("image", {})["default"] = "prefecthq/prefect:3-python3.14-kubernetes" 51 52 52 53 # clean up finished job pods after 5 minutes — prevents overlayfs snapshot accumulation 53 54 props.setdefault("finished_job_ttl", {})["default"] = 300