Prefect Runbook (K8s Dev Worker)
This runbook describes the current Prefect workflow for rapid in-cluster development.
Current Model
prefect-serverruns inside the namespace and exposes API/UI on port4200.prefect-dev-workerruns as a long-lived worker pod using work pooldev-process(processtype).- Deployments in
prefect.yamlrungit_cloneon each flow run, so code is pulled from Git (branchadd-prefect) instead of baked/appsource.
This means you do not need to rebuild the image for normal code changes; commit and push is enough.
Required Components
- Helm release with Prefect enabled and secret injection configured.
- A
dev-processwork pool in Prefect. - Valid Oracle credentials in
secrets.existingSecret(e.g.specify-secret). - Migration image containing runtime dependencies:
prefectpython-oracledbwith Oracle Instant Client for thick mode
Helm Configuration Notes
In charts/specify7/staging.values.yaml:
prefect.server.enabled: trueprefect.devWorker.enabled: trueprefect.devWorker.workPool: "dev-process"prefect.devWorker.image.*points to your migration image tag.secrets.existingSecretpoints to the env secret with Oracle and Prefect vars.
Daily Dev Loop
- Start API access:
kubectl port-forward svc/specify7-prefect-server 4200:4200
- In another terminal:
source .venv/bin/activate
export PREFECT_API_URL=http://127.0.0.1:4200/api
-
Commit and push code changes to
add-prefect(the branch configured inprefect.yaml). -
Register/update deployment:
prefect deploy --all
- Run connectivity checks:
# TEST
prefect deployment run "Oracle Connectivity Check/oracle-connectivity-dev" --param target=TEST
# PROD
prefect deployment run "Oracle Connectivity Check/oracle-connectivity-dev" --param target=PROD
- Inspect results:
prefect flow-run ls
prefect flow-run logs <FLOW_RUN_ID>
kubectl logs -f -l component=prefect-dev-worker
Known Oracle Failure Patterns
-
DPY-6005 ... [Errno 111] Connection refused
Network path or listener is not reachable from the cluster. -
DPY-6001 ... service is not registered (ORA-12514-like)
Host/port are reachable, butORACLE_*_SERVICEis wrong for that listener. -
DPY-3001 ... only supported in thick mode
Server requires native network encryption/integrity; thick mode is required. -
DPI-1047 ... cannot locate libclntsh.so
Oracle Instant Client library is missing/invisible in image or stale image tag is still running.
Practical Tips
- Use explicit image tags (not only
latest) for reproducibility. - Keep
prefect.yamlpull branch aligned with your active branch. - If runs are stuck in
Scheduled, verify worker health and in-namespace connectivity toprefect-server:4200.