liveBook · Manning

Workflow orchestration

As explained in Designing Deep Learning Systems: A guide for software engineers

The coordination and scheduling of the steps, dependencies, and execution of computational workflows.

Workflow orchestration automates the creation, scheduling, execution, monitoring, and troubleshooting of workflows: execution plans made of dependent operations. In deep learning systems, a workflow is commonly a DAG whose steps fetch and transform data, train and evaluate models, and release results. The orchestration service is the control plane that keeps these runs moving across system components. section 9.0 section 9.1.2 section 9.4

It turns a prototype—often a single notebook or Python program—into scheduled production automation. Breaking work into steps makes common operations reusable across projects, while the orchestrator coordinates calls to services such as dataset management and model training, then tracks each run’s progress. section 9.1.2 section 1.2.2 section 1.4

A practical orchestration design needs to address:

  • Correct, repeatable, on-schedule execution for every valid workflow. section 9.2.3
  • Easy workflow creation, testing, monitoring, and troubleshooting for data scientists. section 9.2.3 section 9.1.3
  • Custom task operators and executors that suit infrastructure such as Amazon EC2 or Kubernetes. section 9.2.3
  • Isolation between workflow authors and executions, plus scalability and human-centric operation. section 9.2.3 section 9.4

A scheduled training DAG

Define parsing, augmentation, dataset building, and training as ordered tasks; branch afterward into online and offline evaluation before model release. Give each task inputs, outputs, and an action—for example, an HTTP request that starts a training job—then validate locally and submit the DAG with both a monthly schedule and an event trigger. section 9.2.1

Listing 9.3 A sample Metaflow workflow
# define workflow DAG in a python class
class DataProcessWorkflow(FlowSpec):
 
  # define "data source" as an input parameter for the workflow 
  data_source = Parameter(
     "datasource_path", help="the data storage location for data process"
     , required=True
  )
 
  @step
  def start(self):
    # The parameter “self.data_source” are available in all steps.
    self.newdata_path = dataUtil.fetch_new_data(self.data_source)
 
    self.next(self.transform_data)
 
  @step
  def transform_data(self):
    self.new_data = dataUtil.convert(self.newdata_path)
 
    # fan out to two parallel branches after data transfer.
    self.next(self.save_to_db, self.notify_data_science_team)
 
  @step
  def save_to_db(self):
    dataUtil.store_data(self.new_data)
    self.next(self.join)
 
  @step
  def notify_data_science_team(self):
    slackUtil.send_notification(messageUtil.build_message(self.new_data))
 
    self.next(self.join)
 
  # join the two parallel branches steps: 
  # notify_data_science_team and save_to_db 
  @step
  def join(self, inputs):
      
    self.next(self.end)
 
  @step
  def end(self, inputs):
    # end the flow.
    pass
 
 
if __name__ == "__main__":
  DataProcessWorkflow()

This Python flow shows workflow steps, shared parameters, a parallel fan-out, and a join; it makes the DAG structure concrete before deployment. section 9.3.3

Tool choice follows the workload and operating environment. Airflow and Argo Workflows fit non-ML automation; Argo is suited to teams using Kubernetes and Docker. Metaflow emphasizes ML development by keeping local and production workflow development behind a unified API, with exports to Argo Workflows or AWS Step Functions. section 9.3.3 section 9.3.4

How Designing Deep Learning Systems: A guide for software engineers covers it

How deep it goes
Defines DAG execution, explains production authoring and design principles, then compares implementation tools without detailing their internals.
Examples
Uses a training DAG, a YAML-defined task sequence, and a Python Metaflow data-processing flow with parallel branches.
What it assumes
Assumes familiarity with local model prototyping while introducing workflows, DAGs, scheduling, and orchestration from zero.
What you can do after
Evaluate/understand orchestration designs and select Airflow, Argo Workflows, or Metaflow for stated project conditions.
How it connects
Connects workflow DAGs with dataset management, model training, metadata and artifacts, Kubernetes, and Docker.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Designing Deep Learning Systems: A guide for software engineers. The section links point to the parts of the book it draws on.