This message was deleted.
# ask-marvin
s
This message was deleted.
m
Your message was too long, here's your message at the allowed limit: I need help fixing and completing my dynamic pipeline architecture built with Prefect and FastAPI The goal is to have a system that can execute a sequence of modules where each module can run either in the main process or in a separate Docker container The in-process execution works but the Docker execution logic is incomplete and broken Below is a detailed summary of the current architecture followed by the specific questions I need help with Background System Architecture The system is a dynamic pipeline that executes a sequence of modules The output of one module called an artifact (referenced by a URI) is passed as input to the next *Key Components & Logic Flow * •
dynamic_pipeline_flow
(Main Flow)
This is the orchestrator It loops through a list of module configurations and calls the
run_module
task for each one passing the output artifact from the previous step to the next •
run_module
(Task)
This is a hybrid executor responsible for running a single module ◦ In-Process Mode (Working) It dynamically imports and runs the specified Python module It correctly handles loading input artifacts from a URI and saving the output artifact ◦ Docker Mode (Broken) It attempts to trigger a separate Prefect deployment (
module-docker-subflow-deployment
) as a subflow This implementation is incomplete •
docker_subflow
(Subflow)
This is a placeholder flow intended to execute a module inside a Docker container It is currently unimplemented • API & Deployments A FastAPI endpoint (
/pipelines/run
) triggers new pipeline runs On startup the application creates two deployments one for the main flow targeting a process-based worker pool (
local-pool
) and one for the Docker subflow targeting a Docker-based worker pool (
local-docker-pool
) The API endpoint currently always submits runs to the main process-based deployment which is a key part of the problem Key Problems & Questions Based on the architecture described above please provide code examples and explanations to solve the following problems 1 Implementing the Docker Subflow Call In the
run_module
task the call to
run_deployment
for Docker execution is incomplete How do I correctly pass all necessary parameters (
module_path
params
upstream_data
) to the subflow deployment and how do I retrieve the resulting artifact URI from the completed subflow run to pass to the next module? 2
docker_subflow
Implementation
The
docker_subflow
is currently empty What should its implementation look like? Specifically how should it be structured to ◦ Receive the
module_path
and other parameters? ◦ Load the input artifact using the
upstream_data
URI from within its Docker container? ◦ Dynamically execute the specified module? ◦ Save the output as a new artifact and return its URI to the parent flow? 3 Handling Artifacts Across Environments My
upstream_data
is an artifact URI (e g a path to cloud storage like S3 or a shared local path) What is the best practice to ensure that both the main process-based flow and the separate Docker subflow can reliably read from and write to these artifact locations? 4 Correctly Using Deployments The
/pipelines/run
endpoint hardcodes the main deployment Is this