Resolves paths using super_config aliases and enqueues a pipeline run task using Huey. Returns the task ID which can be used to check the status.
(request: PipelineRunRequest)
| 229 | summary="Queue a dataset generation pipeline for execution.", |
| 230 | ) |
| 231 | def queue_pipeline_run(request: PipelineRunRequest): |
| 232 | """ |
| 233 | Resolves paths using super_config aliases and enqueues a pipeline run task using Huey. |
| 234 | Returns the task ID which can be used to check the status. |
| 235 | """ |
| 236 | try: |
| 237 | # as little logic for the queue and paths, in the post, as possible |
| 238 | print(f"DEBUG: Queuing task with:") |
| 239 | print(f" Resolved Node Path: {request.node_path}") |
| 240 | print(f" Resolved Config Path: {request.config_path}") |
| 241 | print(f" Parameters: {request.parameters}") |
| 242 | # request.parameters.update(task_id=task.id) # TODO is this how it's done? |
| 243 | |
| 244 | # Enqueue the task with resolved paths |
| 245 | task = run_pipeline_task( |
| 246 | node_path=request.node_path, |
| 247 | config_path=request.config_path, |
| 248 | parameters=request.parameters, |
| 249 | ) |
| 250 | return PipelineRunResponse( |
| 251 | pipeline_id=task.id, |
| 252 | message="Pipeline run queued successfully.", |
| 253 | ) |
| 254 | except Exception as e: |
| 255 | print(f"ERROR during path resolution or task enqueueing: {e}") |
| 256 | traceback.print_exc() # Log traceback for debugging |
| 257 | raise HTTPException( |
| 258 | status_code=500, |
| 259 | detail=f"Failed to resolve paths or enqueue pipeline task: {e}", |
| 260 | ) |
| 261 | |
| 262 | |
| 263 | @app.get( |
nothing calls this directly
no test coverage detected