Add configurable base directory for included bundle files - #22769
Draft
Strainy wants to merge 1 commit into
Draft
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
this PR adds an
include_files_base_diroption to infrastructure decorators so bundle file patterns can be resolved outside the directory containing the flow file.The option accepts a string or
pathlib.Path. Omitting it preserves the existing behavior of resolving patterns relative to the flow file.Implementation details
create_bundle_for_flow_runpreviously always derived the collection root frominspect.getfile(flow.fn). It now uses the configured base directory when present, including for archive-relative paths and.prefectignorefiltering.The option is propagated through
InfrastructureBoundFlow,bind_flow_to_infrastructure, andwith_options, and is exposed by the Docker, ECS, Azure Container Instance, Cloud Run, Vertex AI, and Kubernetes decorators.User documentation and generated API references are updated for the new option.
Validation
uv run pytest tests/_experimental/bundles/test_bundles.py -q --tb=short(14 passed)uv run pytest tests/_experimental/bundles/test_include_files_integration.py -q --tb=short(15 passed, 4 optional-AWS skips)uv run pytest tests/test_infrastructure_bound_flow.py -k 'include_files' -q --tb=short(10 passed)git diff --check