Skip to main content

Deployment automation for Refua campaign workloads across private and public clouds.

Project description

refua-deploy

refua-deploy generates deployment bundles for running Refua campaigns across public and private clouds.

It integrates with sibling projects in this workspace:

  • ClawCures
  • refua-mcp

When these projects are present, refua-deploy auto-detects their versions and uses matching default image tags.

Super Simple

If you just want it working with sensible defaults:

cd refua-deploy
poetry install
poetry run refua-deploy init --output deploy.yaml --name refua-prod --visibility public --provider aws
poetry run refua-deploy render --config deploy.yaml --output-dir dist
bash dist/bootstrap/cluster-bootstrap.sh

What this does automatically:

  • Picks Kubernetes as orchestrator for public cloud.
  • Enables network auto-discovery and fills ingress/host/origin defaults.
  • Enables cluster bootstrap artifact generation.
  • Enables GPU auto mode by default.
  • Detects local ClawCures and refua-mcp versions for image tags.

Goals

  • Minimal required inputs.
  • Automatic network defaults.
  • Automatic cluster bootstrap artifacts.
  • GPU support that is transparent by default.

Features

  • Validated deployment config for:
    • Public cloud providers: aws, gcp, azure, oci, digitalocean, linode, vultr, hetzner, ibm, alibaba, scaleway, exoscale
    • Private cloud providers: onprem, openstack, vmware, baremetal, proxmox, nutanix
  • Runtime target selection:
    • kubernetes renderer
    • compose renderer
  • Automatic network inference:
    • Ingress host from explicit config, env, or inferred metadata defaults
    • Allowed hosts/origins inferred when omitted
  • Automatic bootstrap artifacts (Kubernetes targets):
    • bootstrap/cluster-bootstrap.sh
    • bootstrap/metadata.auto.json
    • bootstrap/network.auto.env
  • Kubernetes bundle renderer:
    • Namespace
    • ConfigMap
    • Secret templates
    • Campaign output PVC
    • refua-mcp Deployment + Service
    • ClawCures CronJob
    • Optional Ingress
    • Optional NetworkPolicy
    • kustomization.yaml
  • Compose bundle renderer:
    • refua_mcp service
    • campaign_runner service
    • .env.template
  • GPU-aware deployment controls:
    • gpu.mode=auto (default): GPU-friendly scheduling/runtime hints with CPU fallback.
    • gpu.mode=required: hard GPU requests/limits for Kubernetes and gpus: all for Compose.
    • gpu.mode=off: disables GPU behavior.
  • Plan output (plan.json) for CI/CD review and approvals.

Install

cd refua-deploy
poetry install

Quick Start

Generate a starter config with maximum automation:

poetry run refua-deploy init \
  --output deploy/public.yaml \
  --name refua-oncology-prod \
  --visibility public \
  --provider aws \
  --orchestrator kubernetes \
  --provisioning-level auto \
  --gpu-mode auto \
  --gpu-vendor nvidia

Validate and preview plan:

poetry run refua-deploy plan \
  --config deploy/public.yaml \
  --output deploy/plan.json

Render artifacts:

poetry run refua-deploy render \
  --config deploy/public.yaml \
  --output-dir dist/public

Run generated bootstrap script:

bash dist/public/bootstrap/cluster-bootstrap.sh

Private cloud with compose:

poetry run refua-deploy init \
  --output deploy/private.yaml \
  --visibility private \
  --provider onprem \
  --orchestrator compose

Private cloud with Kubernetes (for example k3s/rke2):

poetry run refua-deploy init \
  --output deploy/private-k8s.yaml \
  --visibility private \
  --provider vmware \
  --orchestrator kubernetes

Metadata Auto-Discovery

refua-deploy can infer network/cluster context from:

  • Explicit config values (highest priority)
  • Environment variables
  • Cloud metadata endpoints (when enabled)

Control flag:

  • REFUA_DEPLOY_ENABLE_METADATA_HTTP=0 disables HTTP metadata probing.

Useful environment overrides:

  • REFUA_INGRESS_HOST
  • REFUA_PUBLIC_IP
  • REFUA_PRIVATE_IP
  • REFUA_AWS_VPC_ID
  • REFUA_AWS_SUBNET_IDS
  • REFUA_GCP_NETWORK
  • REFUA_GCP_SUBNETWORK
  • REFUA_AZURE_RESOURCE_GROUP

Config Schema

Top-level keys:

  • name
  • cloud.visibility
  • cloud.provider
  • openclaw.base_url (required)
  • runtime:
    • namespace
    • orchestrator (kubernetes or compose)
    • campaign
    • mcp
  • kubernetes:
    • distribution (eks, gke, aks, oke, doks, lke, vke, hke, iks, ack, ske, k3s, rke2, openshift, talos, kubeadm, generic)
    • service_type (ClusterIP, NodePort, LoadBalancer)
    • ingress_class
    • storage_class
    • create_network_policy
    • namespace_annotations
  • gpu:
    • mode (off, auto, required)
    • vendor (nvidia, amd, intel)
    • count
    • resource_name
    • mcp_enabled
    • campaign_enabled
    • node_selector
    • toleration_key
  • automation:
    • auto_discover_network
    • bootstrap_cluster
    • provisioning_level (manual, assisted, auto)
    • cluster_name
    • kubernetes_version
    • node_count
    • node_instance_type
    • node_disk_gb
  • network
  • security
  • storage

Examples:

  • examples/public_aws.yaml
  • examples/private_onprem.yaml

Integration Details

Generated artifacts follow existing Refua runtime contracts:

  • Campaign env vars:
    • REFUA_CAMPAIGN_OPENCLAW_BASE_URL
    • REFUA_CAMPAIGN_OPENCLAW_MODEL
    • REFUA_CAMPAIGN_TIMEOUT_SECONDS
    • OPENCLAW_GATEWAY_TOKEN
  • MCP runtime env vars:
    • REFUA_MCP_TRANSPORT
    • REFUA_MCP_HOST
    • REFUA_MCP_PORT
    • REFUA_MCP_ALLOWED_HOSTS
    • REFUA_MCP_ALLOWED_ORIGINS
    • REFUA_MCP_AUTH_TOKENS
  • GPU runtime env vars:
    • REFUA_GPU_MODE
    • REFUA_GPU_VENDOR
    • REFUA_GPU_COUNT
    • vendor hints like CUDA_VISIBLE_DEVICES, NVIDIA_VISIBLE_DEVICES where relevant

Development

Run checks:

poetry run ruff check src tests
poetry run mypy src
poetry run pytest

Build package:

poetry build

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

refua_deploy-0.6.0.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

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

refua_deploy-0.6.0-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file refua_deploy-0.6.0.tar.gz.

File metadata

  • Download URL: refua_deploy-0.6.0.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.14.3 Darwin/25.2.0

File hashes

Hashes for refua_deploy-0.6.0.tar.gz
Algorithm Hash digest
SHA256 12c5f5e283dbfdc955a2deb04a8262337a38c2473959a23a3465753a07d6ebb4
MD5 4751fc0f350769791acb17fd2d617ba2
BLAKE2b-256 41e939f258bd5e6e654184cc65fcc4f61467b1d50861c03e9236442d36834843

See more details on using hashes here.

File details

Details for the file refua_deploy-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: refua_deploy-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.14.3 Darwin/25.2.0

File hashes

Hashes for refua_deploy-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 589f66d83989025ba44cbea2eb57cc8e0f8fd3fbe5fafa12b93fb5fc34da4a3c
MD5 18c7005c60b91a9088c53999554ec167
BLAKE2b-256 12dd7a7e93b84405514efa1662b1e7c8ce9a0dd84eb57bcd10dac06c38b8c8aa

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