strong-quill-48244
02/20/2025, 1:12 PMjolly-florist-66728
02/20/2025, 1:12 PMstrong-quill-48244
02/20/2025, 1:35 PMjolly-florist-66728
02/20/2025, 1:35 PM--pkgs
flag:
pyflyte --pkgs subwf1 --pkgs subwf2 register --image mindmeld="ghcr.io/your_org/subwf1-image:latest" --image borebuster="ghcr.io/your_org/subwf2-image:latest"
You can also specify images in your configuration file (e.g. $HOME/.flyte/config.yaml
) so that when you run the registration command, each subworkflow uses its designated image.
Configuring Different Images in Workflows
Inside each subworkflow code, when defining tasks you can pass a custom image using the container_image
parameter in the @task
decorator. For example:
from flytekit import task, workflow
@task(container_image="ghcr.io/your_org/subwf1-image:latest")
def task_subwf1() -> str:
return "Result from subworkflow 1"
@workflow
def sub_wf1() -> str:
return task_subwf1()
And for another subworkflow:
from flytekit import task, workflow
@task(container_image="ghcr.io/your_org/subwf2-image:latest")
def task_subwf2() -> str:
return "Result from subworkflow 2"
@workflow
def sub_wf2() -> str:
return task_subwf2()
These subworkflows—once registered—can be imported into your orchestration workflow and invoked like ordinary functions. For instance:
from flytekit import workflow
from subwf1 import sub_wf1
from subwf2 import sub_wf2
@workflow
def orchestration_wf() -> None:
result1 = sub_wf1()
result2 = sub_wf2()
# Further processing or triggering subsequent workflows
This approach meets your requirements because:
• Each subworkflow is developed, built, and registered independently (with its own container image).
• They can later be imported into an orchestration workflow to form an integrated execution plan—with a single point of monitoring for progress and task-level details.
Would you like more examples on structuring your project or further details on configuration options?
---
Sources:
- Registering workflows – Flyte documentation
- Multiple images in a workflow – Flyte documentation
Sources:
- Registering workflows – Flyte documentation
- Multiple images in a workflow – Flyte documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.prehistoric-florist-79267
02/20/2025, 2:00 PMjolly-florist-66728
02/20/2025, 2:00 PMmy_project/
orchestration/
orchestration_wf.py # Imports: from subwf1 import sub_wf1, from subwf2 import sub_wf2
subwf1/
sub_wf1.py # Defines sub_wf1 with its own container image
subwf2/
sub_wf2.py # Defines sub_wf2 with its own container image
During registration, you’d run a command similar to:
pyflyte register --non-fast --version t1 \
--pkgs my_project/orchestration \
--pkgs my_project/subwf1 \
--pkgs my_project/subwf2
This command tells Flyte to serialize and register all the workflows found in those packages so that your orchestration workflow can properly import and call the subworkflow definitions. Each subworkflow can still have its own container image specified via the container_image
parameter in its @task
decorators, meeting your requirement for different images per workflow.
Would you like further details on how to structure your repository or on additional configuration options (such as specifying the source root) to ensure the subworkflow modules get included during registration?
---
Sources:
- Registering workflows – Flyte documentation
- Multiple images in a workflow – Flyte documentation
Sources:
- Registering workflows – Flyte documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.freezing-airport-6809
strong-quill-48244
02/21/2025, 8:00 AMFlyteRemote
. Which works just fine but lacks in representation in the UI. Trying to figure out if we can use subworksflows as a part of the main workflow but run the subworkflows with dedicated images.