Skip to main content

Workflow automation framework — define infrastructure as YAML, automate with Python, execute in containers

Project description

CUTIP

Python 3.11+ Pydantic v2 uv Runtime CI Docs

Automate multi-step operations using containers as reproducible execution environments.

CUTIP is a workflow automation framework. You define container infrastructure as typed YAML artifacts, write orchestration logic in Python, and CUTIP handles the lifecycle: pre-build file generation, container startup ordering, health-check loops, and post-deployment verification. Every artifact is validated statically before any container runtime is contacted.

Containers are the medium, not the goal. The task is the goal — SSH into a VM, configure a service, patch a deployment, start a dev environment. CUTIP makes that operation structured, validated, and reproducible.

What cutip is NOT

  • Not a Docker replacement. cutip uses Docker or Podman as backends. It does not build images differently or replace docker run.
  • Not a Kubernetes orchestrator. cutip manages local container workloads. For K8s operations, use cutip-blocks which provides kubectl blocks over SSH.
  • Not a CI/CD system. cutip runs workflows locally or in containers. It complements CI — it doesn't replace GitHub Actions or Jenkins.
  • Not a Docker Compose replacement for simple stacks. If you're running postgres + redis + your app with no custom startup logic, use Compose. cutip solves a different class of problems.

Who is this for

  • DevOps engineers automating VM or Kubernetes operations that span multiple tools (SSH, kubectl, REST APIs)
  • Teams that outgrew bash scripts but don't need the weight of Ansible
  • Developers who want reproducible multi-step procedures with validation, hooks, and visual inspection
  • Anyone who needs to generate config files, exec into containers during startup, or branch on health state

The model

ImageCard   ─┐
NetworkCard ─┘──>  ContainerCard  ──>  Unit  ──>  Group  ──>  workflow.py
Layer What it is
Card A YAML file defining one container resource (image, network, or container config). Validated by Pydantic v2.
Unit A named container instance — references one ContainerCard + optional pre/post hooks.
Group A collection of Units + a workflow.py. The executable artifact: cutip run <group>.
Workflow A Python function main(ctx) that starts containers, runs health checks, and orchestrates. Full Python — no DSL.

Every artifact is a versioned YAML file (apiVersion: cutip/v1). Every ref is resolved and validated before any backend is contacted.

Install

pip install cutip

Quick start

cutip init              # scaffold a workspace with example projects
cutip validate          # static validation — no container runtime needed
cutip plan hello-world  # dry-run — print what would happen
cutip run hello-world   # validate → connect → execute workflow

Before and after

Before (bash script):

#!/bin/bash
ssh root@$VM_IP "kubectl exec -n prod deploy/web -- cat /opt/config/handler.py > /root/patches/handler.py"
ssh root@$VM_IP "sed -i 's|get_host(req)|localhost:4000|g' /root/patches/handler.py"
ssh root@$VM_IP "chmod 777 /root/patches/handler.py"
ssh root@$VM_IP "kubectl get deployment -n prod web -o yaml | python3 -c 'import sys,yaml; ...' | kubectl apply -f -"
ssh root@$VM_IP "kubectl rollout status deployment -n prod web --timeout=120s"
# Hope nothing went wrong. No validation. No rollback. No visibility.

After (cutip workflow):

@orchestrator
def main(ctx):
    container.start(ctx, container="ops-runner")

    with ssh.session(ctx, container="ops-runner",
                     host=vm["ip"], username="root", password=pw) as sesh:

        stage("Pre-op Validation")
        ssh.probe(ctx, sesh)
        k8s.get_deployment(ctx, sesh, namespace="prod", deployment="web")

        stage("Operations")
        patch_handler(ctx, sesh)
        apply_deploy(ctx, sesh)

        stage("Post-op Validation")
        k8s.rollout_status(ctx, sesh, namespace="prod", deployment="web")

    container.stop(ctx, container="ops-runner")

Every step is a named @action. The workflow is validated before execution. Failed steps report which action and stage broke. The entire pipeline is visible as a DAG in CUTIP Desktop.

How it compares

Bash script Docker Compose Ansible CUTIP
Validation None Runtime only YAML lint Static graph validation — no runtime needed
Reproducibility Hope-based Image tags Playbook idempotency Deterministic: same YAML + same workflow = same result
Startup ordering Sequential commands depends_on with health poll Task ordering Python: exec into container, branch on result
Pre-build hooks Makefile target None None pre_build(ctx) per unit
Post-start hooks None None Handlers (limited) startup(ctx) per unit
Secrets .env or hardcoded .env flat substitution Vault / vars secrets.yaml with fail-fast validation
Visual inspection set -x None --verbose DAG visualization in CUTIP Desktop
Migration Manual Manual cutip from-compose converts any compose file

Ecosystem

Project Description
cutip Core framework — YAML artifacts, Python workflows, CLI
cutip-blocks Reusable workflow blocks — SSH, kubectl, file ops, container lifecycle (34 blocks, 9 categories)
cutip-desktop Visual companion — DAG visualization, artifact inspection, container management, observability

CLI

Command Description
cutip init Scaffold workspace with example projects
cutip validate Static graph validation (no runtime needed)
cutip plan <group> Dry-run: print execution table
cutip run <group> Validate, connect, execute workflow
cutip tree Print workspace artifact tree
cutip show <type> <name> Dump a resolved artifact
cutip from-compose <file> Convert a Docker Compose file to cutip artifacts
cutip secrets set/list/check Manage secrets.yaml

Documentation

joshuajerome.github.io/cutip

  • Why CUTIP? — detailed comparison with Docker Compose
  • Concepts — cards, units, groups, lifecycle, graph resolution
  • Quickstart — end-to-end walkthrough
  • Use Cases — real-world examples

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

cutip-2.3.0-cp313-cp313-win_amd64.whl (387.4 kB view details)

Uploaded CPython 3.13Windows x86-64

cutip-2.3.0-cp313-cp313-manylinux_2_34_x86_64.whl (536.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

cutip-2.3.0-cp313-cp313-macosx_11_0_arm64.whl (480.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cutip-2.3.0-cp313-cp313-macosx_10_12_x86_64.whl (484.9 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

File details

Details for the file cutip-2.3.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: cutip-2.3.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 387.4 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cutip-2.3.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fefe4a542d248591d938a90d0679c7ceb30e756c4c563aaafd22ff9ac1e672de
MD5 bcef1fe7127e29c79075ae4de22d9543
BLAKE2b-256 fcc5d8c6e42e6504f1821345f4939a6c324f9f25bf8c099ea956b7cbd63f508e

See more details on using hashes here.

File details

Details for the file cutip-2.3.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cutip-2.3.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 301b8aa2906226f0bc3d4a60b77fcfd406f1151455bd2585ea9c29b4bdae2384
MD5 a60e931877ae2f3f0e6d896c3ece7f3d
BLAKE2b-256 9750cc3de26d1b78f0ac86a7a42caff5e62a2a80ddd6efe25be96bef78f2007b

See more details on using hashes here.

File details

Details for the file cutip-2.3.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cutip-2.3.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 976480b4757305a3dbe783d277e5fd6cdedfda7cb0cc74e0a2d68d075e657a93
MD5 04a2eb6139ec89741b8d342ad75e1a37
BLAKE2b-256 3dfbd9cc8f541e93d9c00c52b2d5f17d846472c0b461bd00ebfdaebd573fe3c4

See more details on using hashes here.

File details

Details for the file cutip-2.3.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for cutip-2.3.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9bde7d7451a6c5576ce6c9af5a10d11c567da880476bea594c3b291ce7389efd
MD5 687a8e152af32c03fc1f7a057347cdd9
BLAKE2b-256 11801d53d19e04aa6bb47cbd8cdd51dde0e2f857b1ac488bf54425fefd41442a

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