Amith M
08/11/2025, 9:38 PMMarvin
08/11/2025, 9:38 PMMarvin
08/11/2025, 9:46 PMrm -rf /opt/prefect/armor-adk-deployments-prefect
- Or repoint the existing clone to the correct remote:
cd /opt/prefect/armor-adk-deployments-prefect
git remote set-url origin <the-repo-url-configured-on-your-deployment>
git fetch
Prevent it going forward
- Give each repo its own base working directory per work pool, or dedicate a pool per repo.
- Update the pool’s base job template working_dir so clones don’t collide:
1) Inspect the pool:
prefect work-pool inspect <your-pool>
2) Grab the default template and edit:
prefect work-pool get-default-base-job-template --type process --file base.json
# set "working_dir" to a base path you control, e.g. "/opt/prefect/repos"
prefect work-pool update <your-pool> --base-job-template base.json
With a base like /opt/prefect/repos, Prefect clones each repo into a subfolder named after the repo, avoiding dropping it in /opt/prefect or some shared path that already contains a mismatched checkout.
About templating working_dir
- Base job templates support Jinja-style templating, so you can make paths unique per run or per deployment. For example:
{
"job_configuration": {
"working_dir": "/opt/prefect/repos/{{ deployment.name }}/{{ flow_run.id }}"
}
}
This avoids collisions entirely by isolating each run. If you don’t need per-run isolation, per-deployment is usually sufficient:
"/opt/prefect/repos/{{ deployment.name }}"
If you share a host among many repos, I recommend:
- One process work pool per repo, each with a distinct working_dir base (e.g., /opt/prefect/repos/<repo>), or
- A single pool with a templated working_dir as above.
If you can share:
- Worker type (process, docker, kubernetes?)
- The repo URL you configured on the deployment
- Your work pool’s current base job template (working_dir)
…I can propose an exact base.json you can drop in with prefect work-pool update
.
Docs, for reference (light reading):
- Work pools and base job templates: https://docs.prefect.io/latest/deploy/
- Deploying from source overview: https://docs.prefect.io/latest/deploy/
Yes, the links are thrilling. Almost as thrilling as deleting a directory and watching the error go away.