<@ULVA73B9P> I have set the source for my deployme...
# ask-marvin
j
@Marvin I have set the source for my deployment to be a local directory. Each time I start run my deployment, my local changes are reflected in the new run. How is the run detecting my local changes?
m
thought for 184.8 seconds
Short answer: it isn’t “detecting” changes; it’s reading your code live from disk at run time. When you set a deployment’s source to a local directory in Prefect 3.x, the deployment stores that filesystem path. Each flow run resolves the deployment’s source and, for local paths, the worker sets its working directory to that path and imports your flow from there. Because it reads the files at run time, any edits you’ve made since the last run are naturally picked up. A few implications: - This works when the worker can access the same path (e.g., same machine or a shared/mounted volume). If the worker is remote without access to that path, runs will fail. - There’s no packaging/checksum step for local path sources by default; runs are not immutable and will always reflect the current state of the files on disk. If you want reproducible runs that don’t change with local edits: - Use a Git source and pin a commit (each run clones that revision). - Or build an image (e.g., Docker/Kubernetes work pools) that contains your code and run from that image. References (code paths that show how local/remote sources are handled): - Local/remote filesystem abstractions used by deployments: prefect/filesystems.py - Deployment pull steps (note the presence of set_working_directory, git_clone, etc.): prefect/deployments/steps/pull