Skip to content

capa-cloud/capa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Capa Runtime

Cloud Application API Β· Multi-Runtime Sidecar Β· Write Once, Run Anywhere

Capa Java Β· Capa Go

Go Version License


πŸ“– Introduction

Capa Runtime is the sidecar implementation of the Capa (Cloud Application API) ecosystem. It provides extended capabilities that complement the Capa SDK, enabling advanced features like traffic interception, Actor model, and external system bindings.

Capa Runtime works alongside Capa SDK implementations to provide a complete Multi-Runtime solution for cloud-native applications.

Project status: This repository provides a buildable experimental gRPC runtime baseline. Runtime startup, metadata RPCs, and graceful shutdown are tested; actor methods return gRPC UNIMPLEMENTED while they remain scaffolding. HTTP interception, bindings, and SaaS integrations are roadmap items rather than production-ready features.

Ecosystem Roles

Component Description Current Use
Capa SDK Language-native Cloud Application APIs Application integration
Capa Runtime Optional gRPC sidecar Metadata, lifecycle, and future extended APIs

πŸ—οΈ Architecture

Capa Runtime Architecture

Architecture Layers

capa/
β”œβ”€β”€ cmd/capa/               # Runtime entry point
β”œβ”€β”€ pkg/                    # Core packages
β”‚   β”œβ”€β”€ actors/             # Actor API scaffolding
β”‚   β”œβ”€β”€ grpc/               # gRPC API and server lifecycle
β”‚   β”œβ”€β”€ proto/              # Generated Runtime API types
β”‚   └── runtime/            # Core runtime lifecycle
β”œβ”€β”€ docker/                 # Docker configurations
β”œβ”€β”€ spec/                   # Runtime API specification
└── utils/                  # Utility functions

Key Design Principles:

  • Optional Sidecar: Capa Runtime is optional; SDK works independently
  • Small Runtime Surface: Only implemented packages participate in builds
  • Explicit Lifecycle: Startup failures propagate and shutdown is bounded
  • Extensible API: Generated gRPC contracts provide the integration boundary

✨ Features

Capa Runtime Features

Capability Status Notes
gRPC runtime server βœ… Baseline Starts on configured addresses and registers the Runtime API
Metadata API βœ… Implemented Stores and retrieves runtime metadata in memory
Graceful shutdown βœ… Implemented Stops on signals or the Shutdown RPC with a bounded timeout
Actor API πŸ”¬ Scaffolding RPC contracts return gRPC UNIMPLEMENTED; persistence and execution are not implemented
HTTP interception πŸ—ΊοΈ Roadmap Not included in the current runtime
Bindings and SaaS πŸ—ΊοΈ Roadmap Not included in the current runtime

🎯 Motivation

Why Sidecar?

While Capa SDK provides rich functionality, some capabilities require sidecar architecture:

  1. Actor Model: Requires persistent connections and scheduling
  2. Traffic Interception: Needs network-level control (iptables)
  3. Binding: Benefits from decoupled event processing

Sidecar or SDK?

Capability SDK Runtime Notes
Cloud APIs βœ… β€” Use the language SDK directly
Metadata β€” βœ… Implemented by the gRPC runtime
Lifecycle shutdown β€” βœ… Signal and RPC initiated
Actor ❌ πŸ”¬ Contract only; implementation is incomplete
Binding βœ… πŸ—ΊοΈ Runtime support is a roadmap item
Traffic interception ❌ πŸ—ΊοΈ Not included in the current runtime

πŸš€ Getting Started

Prerequisites

  • Go 1.25 or higher with automatic toolchain selection enabled; this repository selects Go 1.26.5 for patched builds
  • Docker (optional, for containerized deployment)
  • Kubernetes (optional, for orchestrated deployment)

Installation

# Clone the repository
git clone https://github.com/capa-cloud/capa.git
cd capa

# Verify and build the runtime
go test ./...
go build -o capa ./cmd/capa

# Run locally
./capa --app-id example --port 3500

Docker Deployment

# Build Docker image from the repository root
docker build -f docker/Dockerfile -t capa-runtime:latest .

# Run container
docker run -d \
  --name capa-runtime \
  -p 3500:3500 \
  capa-runtime:latest

Kubernetes Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: capa-runtime
spec:
  replicas: 1
  selector:
    matchLabels:
      app: capa-runtime
  template:
    metadata:
      labels:
        app: capa-runtime
    spec:
      containers:
      - name: capa-runtime
        image: capa-runtime:latest
        args: ["--listen-address=0.0.0.0", "--port=3500"]
        ports:
        - containerPort: 3500
---
apiVersion: v1
kind: Service
metadata:
  name: capa-runtime
spec:
  selector:
    app: capa-runtime
  ports:
  - port: 3500
    targetPort: 3500

βš™οΈ Configuration

The runtime is configured with command-line flags:

Flag Default Description
--app-id capa-app Application identifier
--env local Application environment
--cloud local Cloud provider identifier
--listen-address 127.0.0.1 gRPC API listen address
--port 3500 gRPC API port
--callback-port 3501 Application callback port reserved for actor integration
--shutdown-timeout 10s Maximum graceful shutdown duration

πŸ“š Runtime API

The gRPC contract is defined in spec/proto/runtime/v1/runtime.proto. The current executable registers the generated Runtime service and implements metadata and shutdown behavior. Actor RPCs are present for compatibility but return gRPC UNIMPLEMENTED until an actor runtime is available. The Shutdown RPC also completes the process lifecycle; no additional operating-system signal is required.


🌐 Ecosystem

Capa Runtime is part of the Capa Cloud ecosystem:

Project Language Description
capa-java Java Java SDK implementation
capa-go Go Go SDK implementation
cloud-runtimes-jvm Java JVM API specification
cloud-runtimes-golang Go Go API specification

🀝 Contributing

We welcome contributions to Capa Runtime!

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

# Clone and build
git clone https://github.com/capa-cloud/capa.git
cd capa

# Download dependencies
go mod download

# Run tests
go test ./...

# Vet and build the binary
go vet ./...
go build -o capa ./cmd/capa

πŸ“œ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


Building the future of cloud-native applications with Multi-Runtime architecture

Capa Cloud Β· Documentation

About

Mecha Runtime of Cloud Application Api.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors