This is an example machine learning workflow that will:
- Receive a notification from a minio webhook event about an uploaded image to kick off the workflow
- Download the image and crop all detected faces into multiple individual files
- For each cropped face, parallelly run a face recognition model to identify the name of the face based on a directory of known faces
- Suspend the workflow and wait for external approval from the UI
- Succeed or fail the workflow depending on approval from the previous step
- Argo Workflows v3.5
- S3 bucket (see minio directory for example in-cluster minio deployment)
- WorkflowEventBinding for submitting a workflow from a minio webhook
- DAG template for defining dependent steps
- Script template for inlined Python code
- Input artifacts and artifact passing
- Data template for processing artifacts and generating fan-out steps
- Suspend template with approval
- Conditionals
- The actual Workflow
A WorkflowEventBinding allows the Argo API server to act as a webhook receiver.
Minio is configured with a Webhook Event Destination to the Argo API server. e.g.:
- Event ID: argo-workflows-ml-demo
- Event destination: https://workflows.demo.akuity.io:443/api/v1/events/argo-workflows-ml-demo/
- Auth Token:
<bearer token from minio.service-account-token>
The face-detect
bucket should be configured so that webhook event destination is subscribed to PUT
events on the bucket:
The face-detect
bucket should contain three top-level directories:
to-be-identified
- Any upload to this directory will kick off a face-detect workflow (filter is defined in the WorkflowEventBinding). For your convenience, you may use the test-data directory.known-faces
- A pre-populated directory of images of known people. The name of the jpeg reflects the name of the known person (e.g.Obama.jpg
). For your convenience, you may use the known-faces directory.wf-artifacts
- Intermediate storage used by the workflows. This can be periodically cleaned.