Skip to main content

Container Unit Templates in Python — a deterministic framework for building container workloads

Project description

CUTIP

Python 3.11+ Pydantic v2 uv Runtime CI Docs

Container Unit Templates in Python — a deterministic framework for defining, validating, and orchestrating container environments using structured YAML artifacts and Python workflows.

CUTIP is not a wrapper around docker-compose. It is an opinionated engineering layer: every container resource is a versioned, validated artifact; every deployment is a reproducible Python function.


The Model

Container infrastructure is organized into four composable layers:

ImageCard   ─┐
NetworkCard ─┤──▶  ContainerCard  ──▶  Unit  ──▶  Group  ──▶  workflow.py
VolumeCard  ─┘
Layer What it represents
Card One atomic container resource (image, network, volume, or container config)
Unit One running container instance — a ContainerCard reference
Group A collection of Units + a Python workflow.py — the executable artifact
Workflow A plain Python function main(ctx: CutipContext) — full control, no magic

Every artifact is a versioned YAML file. Every ref is validated before any backend is contacted.


Install

pip install cutip

Or install from source with uv:

git clone https://github.com/joshuajerome/cutip && cd cutip
uv pip install -e .
cutip --help

[!NOTE] cutip init, cutip tree, cutip validate, cutip show, and cutip plan run without any container runtime installed. Only cutip run requires Podman.


Quick Look

# cutip/cards/images/app.yaml
apiVersion: cutip/v1
kind: ImageCard
metadata:
  name: app
spec:
  source: build
  context: resources/buildtime
  dockerfile: resources/dockerfiles/app.dockerfile
  tag: latest
# cutip/cards/containers/app.yaml
apiVersion: cutip/v1
kind: ContainerCard
metadata:
  name: app
spec:
  imageRef:
    ref: images/app
  networkRef:
    ref: networks/dev
  environment:
    ENV: production
  workdir: /app
# cutip/groups/dev/workflow.py
def main(ctx):
    ctx.container("app").start()
cutip validate
cutip plan dev
cutip run dev

CLI

Command Description
cutip init [--path] Scaffold workspace directories and cutip.yaml
cutip tree [--path] Print discovered cards, units, and groups
cutip validate [--path] Full schema + graph validation (no backend required)
cutip show card <ref> Dump a resolved card as YAML
cutip show unit <name> Show a unit's resolved card graph
cutip show group <name> Show a group's units and workflow status
cutip plan <group> [--path] Dry-run: print execution table, start nothing
cutip run <group> [--local] [--path] Validate → connect → execute workflow
cutip group ls List all groups in the workspace
cutip unit ls List all units in the workspace
cutip card ls List all cards in the workspace

cutip run connects to the Podman socket over SSH by default. Pass --local to use the local socket directly (useful in CI or rootless setups).


vars.yaml

Workspace variables are declared in cutip/vars.yaml with two sections:

required:
  ssh_private_key: ""   # must be filled in — cutip fails fast if empty

generated:
  data_dir: ".my-data"  # cutip creates this directory automatically

CUTIP validates all {{ vars.key }} references in cards before any container backend is contacted — missing or empty required values surface as a clear error, not a runtime failure.


Documentation

Full documentation at joshuajerome.github.io/cutip

Section Contents
Getting Started Installation, quickstart, workspace layout
Concepts The 4-layer model, cards, units, groups, graph resolution
Reference CLI flags, card schemas, workflow contract, exceptions
Guides Podman setup, writing workflows, CI/CD

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cutip-0.1.2.tar.gz (133.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cutip-0.1.2-py3-none-any.whl (51.7 kB view details)

Uploaded Python 3

File details

Details for the file cutip-0.1.2.tar.gz.

File metadata

  • Download URL: cutip-0.1.2.tar.gz
  • Upload date:
  • Size: 133.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cutip-0.1.2.tar.gz
Algorithm Hash digest
SHA256 598bcef306b7666cde0e4d3cf7ef6739b1f27d9c051ad8fe46774fe96a08e61b
MD5 9b076946d8a91e88e505b98ba84fa8bc
BLAKE2b-256 1d9726f38530458f62b6047d5a07d56864886b5747b9cf0069a184b3a7e40beb

See more details on using hashes here.

File details

Details for the file cutip-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cutip-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 51.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cutip-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dee492d5836a520a39bd2ea54cfabfb62f2495b720e00bee6b2d7c401902847a
MD5 c20083c6f32b496181e9c2cad2dc4c2a
BLAKE2b-256 eb56054c00ea923f8b01b455d540f2d7332942df8b5b6f9f9bf67afd237e82b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page