Repository navigation
[azure-ai-projects] Add samples for dynamic and nested + dynamic pipelines - #17
Open
zzn2 wants to merge 5 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ode delegate Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
zzn2
force-pushed
the
zhizhu-microsoft-dynamic-pipeline-samples
branch
from
December 4, 2026 09:44
6810d46 to
204ca04
Compare
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.
Background
The
azure.ai.projects.dslsamples undersamples/jobsshow pipelines whose graph is fully known at submission, including nested@pipelinecomposition insample_pipeline_nested.py. The Foundry pipeline service also supports dynamic nodes, whose steps are decided while the job runs, and the SDK exposes them as@dynamic(added in #16). Customers have no example of authoring and submitting such a pipeline.What this adds
A new
samples/jobs/pipeline_dynamicfolder:steps/shards.pydefines a source-backedprocess_shard@componentand a@dynamicfan_out(shard_count, label)that adds oneprocess_shardnode per shard usingshard_count.result(), the value resolved at runtime. It is import-safe because the dynamic node imports this module inside the job, where the submission-time environment variables do not exist.sample_pipeline_dynamic.pysubmits a pipeline whose only step is the dynamic fan-out.sample_pipeline_nested_dynamic.pyputs a nested@pipelinesubgraph (the fixed produce → normalize steps from the nested sample) and a top-level dynamic fan-out in the same parent pipeline.Both scripts follow the existing pipeline samples: they read
FOUNDRY_PROJECT_ENDPOINT,JOB_COMPUTE_ID,JOB_ENVIRONMENT_IMAGE,JOB_NODE_UAI_RESOURCE_IDandJOB_INSTANCE_TYPE, submit withclient.pipeline_jobs.create_or_update(...), and print the job name, ID, status and, when returned, the portal URL. The nested-only case is not duplicated; it stays insample_pipeline_nested.py.flowchart LR P["workflow<br/>(@pipeline)"] --> N["text_subgraph<br/>(nested @pipeline)"] P --> D["fan_out<br/>(@dynamic)"] D -. "at runtime" .-> S0["process_shard 0"] D -. "at runtime" .-> S1["process_shard 1"]Scope and prerequisites
azure-ai-projects[dynamic]at the authoring version, and the user-assigned identity must be allowed to register components in the project; the docstrings say so.@dynamicinside a nested pipeline.Dependencies
@dynamicand its runtime executor); this branch is stacked on it, so the diff includes those commits until [azure-ai-projects] Add @dynamic pipeline nodes compiled at job runtime #16 merges.