Understanding Task Execution#
When you submit a workflow to OSMO, each task runs as a Kubernetes pod on your backend cluster. This page explains the technical architecture of these podsβhow theyβre structured, how the containers inside the pod communicate, and what happens during execution.
Tip
Why read this? Understanding OSMO workflow pod execution helps you debug issues, optimize data operations, and provide necessary support to users in case of workflow failures or when they use interactive features like exec and port-forward.
Task Pod Architecture#
Every workflow task executes as a Kubernetes pod with three containers that work together. These containers share volumes (/osmo/data/input and /osmo/data/output) and communicate via Unix sockets to seamlessly orchestrate your task from data download through execution to results upload.
The Three Containers#
Each pod contains three containers working together to execute your task:
(Init Container)
Prepares the environment before your code runs:
Creates
/osmo/data/inputand/osmo/data/outputdirectoriesInstalls OSMO CLI (available in your container)
Sets up Unix socket for inter-container communication
Runs once β Exits after setup
(Sidecar Container)
Coordinates task execution and data:
Downloads input data from cloud storage
Streams logs to OSMO service in real-time for monitoring
Uploads output artifacts after completion
Handles interactive requests (exec, port-forward)
Runs throughout task lifetime
(Main Container)
Runs your code as a process:
Executes the command you specified
Uses requested CPU/GPU/memory resources
Reads input data from
/osmo/data/inputWrites output data to
/osmo/data/outputLogs to stdout/stderr
Runs your code from start to exit
Execution Flow#
Every task follows this four-phase progression:
1. Initialize π§
OSMO Init sets up environment
Creates directories, installs OSMO CLI, configures Unix socket for inter-container communication
2. Download β¬οΈ
OSMO Ctrl fetches data
Downloads and extracts input datasets to /osmo/data/input
3. Execute βΆοΈ
Your code runs inside the container
Reads inputs, writes outputs, logs streamed in real-time
4. Upload β¬οΈ
OSMO Ctrl saves results
Uploads artifacts from /osmo/data/output
Note
Data handling is automatic. Your code only needs to read from {{input}} (/osmo/data/input) and write to {{output}} (/osmo/data/output). The Ctrl container manages all transfers.
Practical Guide#
Directory Structure#
Your container automatically has access to these paths:
/osmo/data/
βββ input/ β Read input datasets here
β βββ 0/dataset1/
β βββ 1/dataset2/
βββ output/ β Write results here
β βββ (your artifacts)
βββ socket/ β Unix socket (managed by OSMO)
βββ data.sock
Example Task Configuration#
tasks:
- name: train-model
image: nvcr.io/nvidia/pytorch:24.01-py3
command: ["python", "train.py"]
args:
- --input={{input:0}}/dataset1
- --input={{input:1}}/dataset2
- --output={{output}}/model
Debugging#
View Container Logs
osmo-ctrl logs (data operations):
$ kubectl logs <pod-name> -c osmo-ctrl
Your container logs (application output):
$ kubectl logs <pod-name> -c <task-name>
Interactive Access
Access your running container with a shell:
$ osmo exec my-workflow task-1 -- bash
How it works: Command flows through OSMO Service β osmo-ctrl β User Container via Unix socket
Resource Allocation
Your container: All requested CPU/GPU/memory
osmo-ctrl overhead: ~50-100 MB memory, minimal CPU (active during transfers only)
Learn More#
See also
Workflow Overview - User guide for writing workflows
Workflow Lifecycle - Understanding workflow states
Architecture - Overall OSMO system architecture