Skip to content

Serverless document pipeline on IBM Cloud Code Engine

A serverless document pipeline on IBM Cloud Code Engine: partner systems PUT files into a Cloud Object Storage bucket, an Object Storage event subscription starts one extract job run per object, the job inserts records into Databases for PostgreSQL and reports to Event Notifications, which sends email and Slack, and a scale-to-zero Code Engine app serves the results, with both pulling images from Container Registry.

ibmlogos10 nodes2 groups9 edges
Edit in the playgroundOpen full size
Serverless document pipeline on IBM Cloud Code Engine with Cloud Object Storage, an extract job, a review app, Databases for PostgreSQL, Event Notifications, Container Registry, email and SlackServerless document pipeline on IBM Cloud Code Engine with Cloud Object Storage, an extract job, a review app, Databases for PostgreSQL, Event Notifications, Container Registry, email and SlackServerless document pipeline on IBM Cloud Code Engine with Cloud Object Storage, an extract job, a review app, Databases for PostgreSQL, Event Notifications, Container Registry, email and SlackServerless document pipeline on IBM Cloud Code Engine with Cloud Object Storage, an extract job, a review app, Databases for PostgreSQL, Event Notifications, Container Registry, email and Slack
ibm-code-engine-serverless.yamlOn GitHub
# yaml-language-server: $schema=../references/diagram.schema.json
title: Serverless document pipeline on IBM Cloud Code Engine
subtitle: Each upload to Object Storage starts a Code Engine job run that writes to PostgreSQL, and an app serves the results
direction: right
# The tightest spacing keeps the five columns inside a README column at full label size.
layout: { spacing: 0.5 }

# IBM's technical diagram guide asks for a legend in every diagram, so solid lines get one too.
legend:
  solid: Requests and data access
  dashed: Events and notifications
  dotted: Container images

groups:
  # orrery has no IBM group styles; IBM's guide draws groups as plain outlined boxes, so these use
  # the neutral types with Carbon icons in the headers, as in ibm-cloud-openshift.
  ibmcloud: { type: box, label: IBM Cloud, icon: ibm:ibm-cloud }
  # A Code Engine project is the boundary: its apps, jobs and event subscriptions share one
  # namespace, scale to zero and are billed only while they run.
  project: { type: box, label: Code Engine project, icon: ibm:ibm-cloud-code-engine, in: ibmcloud }

nodes:
  partners: { icon: ibm:document-import, label: Partner systems, note: S3 API uploads }
  staff: { icon: ibm:user-multiple, label: Operations team, note: Browser }
  registry: { icon: ibm:container-registry, label: Container Registry, note: Private images, in: ibmcloud }
  cos: { icon: ibm:object-storage, label: Cloud Object Storage, note: Inbound bucket, in: ibmcloud }
  job: { icon: ibm:job-run, label: Extract job, note: "Code Engine job, one run per object", in: project }
  app: { icon: ibm:application-web, label: Review app, note: "Code Engine app, scales to zero", in: project }
  db: { icon: ibm:ibm-cloud-databases, label: Databases for PostgreSQL, note: Extracted records, in: ibmcloud }
  en: { icon: ibm:ibm-cloud-event-notification, label: Event Notifications, note: Pipeline topic, in: ibmcloud }
  email: { icon: ibm:email, label: Email, note: Destination }
  slack: { icon: logos:slack-icon, label: Slack, note: Destination }

edges:
  - partners -> cos: PUT
  # A COS event subscription in the project turns each object write into a job run.
  - cos --> job: write event
  - job -> db: insert
  - staff -> app: HTTPS
  - app -> db: query
  - job --> en: run finished
  - en --> email, slack
  - registry ..> project: pull

Start from this one

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

$ orrery init ibm-code-engine-serverless$ orrery render diagram.yaml -f all --theme both