Skip to content

HPC batch processing with AWS Batch

An upload to S3 fires an EventBridge rule that starts Step Functions, which submits AWS Batch jobs to a Spot compute environment; the jobs mount an FSx for Lustre file system linked to the bucket and log to CloudWatch.

aws9 nodes5 groups8 edges
Edit in the playgroundOpen full size
HPC batch on AWS: S3, EventBridge, Step Functions and AWS Batch running Spot Instances over FSx for Lustre, with CloudWatch logsHPC batch on AWS: S3, EventBridge, Step Functions and AWS Batch running Spot Instances over FSx for Lustre, with CloudWatch logsHPC batch on AWS: S3, EventBridge, Step Functions and AWS Batch running Spot Instances over FSx for Lustre, with CloudWatch logsHPC batch on AWS: S3, EventBridge, Step Functions and AWS Batch running Spot Instances over FSx for Lustre, with CloudWatch logs
aws-hpc-batch.yamlOn GitHub
# yaml-language-server: $schema=../references/diagram.schema.json
title: HPC batch processing with AWS Batch
subtitle: New input in Amazon S3 starts a workflow that runs AWS Batch jobs on Spot capacity over Amazon FSx for Lustre
direction: down

legend:
  solid: Data and control
  dashed: Job logs

groups:
  cloud: { type: aws:cloud }
  region: { type: aws:region, label: us-east-1, in: cloud }
  control: { type: zone, label: Workflow, in: region }
  vpc: { type: aws:vpc, in: region }
  compute: { type: aws:spot-fleet, label: AWS Batch compute environment, in: vpc }

nodes:
  users: { icon: aws:users, label: Researchers }
  input: { icon: aws:s3-bucket, label: Input and results, note: Amazon S3 bucket, in: region }
  events: { icon: aws:eventbridge-rule, label: Object created rule, note: Amazon EventBridge, in: control }
  workflow: { icon: aws:step-functions, label: AWS Step Functions, note: Run workflow, in: control }
  batch: { icon: aws:batch, label: AWS Batch, note: Job queue, in: control }
  fsx: { icon: aws:fsx-lustre, label: Amazon FSx for Lustre, note: Scratch file system mounted by jobs, in: vpc }
  spot-1: { icon: aws:ec2-spot-instance, label: Spot Instance, note: Amazon EC2, in: compute }
  spot-2: { icon: aws:ec2-spot-instance, label: Spot Instance, note: Amazon EC2, in: compute }
  logs: { icon: aws:cloudwatch, label: Amazon CloudWatch, note: Job logs, in: region }

edges:
  - users -> input: { label: upload }
  - input -> events: { label: object created }
  # constraint: false keeps the workflow steps side by side in one row.
  - { from: events, to: workflow, constraint: false }
  - { from: workflow, to: batch, constraint: false }
  - batch -> compute: { label: run jobs }
  # FSx for Lustre imports from and exports to the bucket; the jobs mount the file system.
  - { from: input, to: fsx, arrow: start, label: import and export }
  - { from: fsx, to: compute, arrow: start, constraint: false }
  - batch --> logs: job logs

Start from this one

Copies the spec to diagram.yaml, then renders every format.

$ orrery init aws-hpc-batch$ orrery render diagram.yaml -f all --theme both