Skip to content

Container Engine is a revolutionary open-source service that empowers developers to effortlessly deploy containerized applications to the internet with unprecedented simplicity and speed. By intelligently abstracting away the complexity of Kubernetes infrastructure, Container Engine creates a seamless deployment experience

Notifications You must be signed in to change notification settings

AI-Decenter/Open-Container-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Container Engine

Build Status Code Coverage License PRs Welcome Documentation Docker Pulls

   ____            _        _                     _____            _           
  / ___|___  _ __ | |_ __ _(_)_ __   ___ _ __   | ____|_ __   ___(_)_ __   ___ 
 | |   / _ \| '_ \| __/ _` | | '_ \ / _ \ '__|  |  _| | '_ \ / __| | '_ \ / _ \
 | |__| (_) | | | | || (_| | | | | |  __/ |     | |___| | | | (__| | | | |  __/
  \____\___/|_| |_|\__\__,_|_|_| |_|\___|_|     |_____|_| |_|\___|_|_| |_|\___|
                                                                              

Deploy Containers in Seconds. Your App, Live on the Web.

An Open-Source Alternative to Google Cloud Run - Built with Rust & Axum


Introduction

Container Engine is an open-source alternative to Google Cloud Run, built with Rust and the Axum framework. This revolutionary service empowers developers to effortlessly deploy containerized applications to the internet with unprecedented simplicity and speed. By intelligently abstracting away the complexity of Kubernetes infrastructure, Container Engine creates a seamless deployment experience that lets you focus entirely on your code and business logic, not on managing infrastructure.

Unlike proprietary solutions, Container Engine provides a complete User Management System including user registration, authentication, API key management, and deployment management - all while being fully open-source. With Container Engine, the journey from a Docker image to a live, production-ready URL happens with just a single API call—no YAML configurations to write, no kubectl commands to remember, and no infrastructure headaches.

Key Features

User Management System

  • User Registration & Authentication: Complete user registration and login system with secure password management
  • API Key Management: Generate, manage, and revoke API keys for secure access to the platform
  • User Dashboard: Comprehensive user interface for managing deployments, viewing usage, and account settings

Container Deployment & Management

  • Deploy via API: Go from container image to live URL with a single API call, reducing deployment time from hours to seconds.
  • Zero Kubernetes Hassle: No need to write YAML or manage kubectl. Our engine translates simple REST API calls into complex Kubernetes configurations behind the scenes.
  • Auto-generated URLs: Every deployment gets a clean, memorable, and instantly accessible URL with automatic HTTPS certificate provisioning and management.
  • Scalable by Design: Built on the robust foundation of Kubernetes for reliability and scale, with built-in horizontal scaling capabilities.

Technical Features

  • Rust + Axum Backend: High-performance, memory-safe backend built with Rust and the modern Axum web framework
  • OpenAPI Documentation: Complete API documentation with Swagger UI integration using utoipa
  • Registry Agnostic: Pull public or private images from Docker Hub, Google Container Registry, Amazon ECR, GitHub Container Registry, or any other container registry with support for authentication.
  • Environment Variables Management: Securely inject configuration through environment variables without rebuilding images.
  • Deployment Monitoring: Real-time logs and performance metrics for all your deployments in one unified dashboard.
  • Zero Downtime Updates: Update your applications seamlessly with rolling updates that guarantee availability.
  • Automated Setup: Intelligent setup script that checks and installs all required dependencies automatically.

Technology Stack

Container Engine is built with modern, high-performance technologies:

  • Backend: Rust with Axum framework for maximum performance and memory safety
  • Database: PostgreSQL for reliable data persistence
  • Container Orchestration: Kubernetes for scalable container management
  • Authentication: JWT tokens with bcrypt password hashing
  • Monitoring: Prometheus metrics with Grafana dashboards
  • Logging: Structured logging with correlation IDs

The Rust + Axum backend provides exceptional performance while ensuring memory safety and preventing common security vulnerabilities.

Architecture Overview

Container Engine provides a sophisticated yet simple interface between developers and Kubernetes infrastructure. Users interact with the Container Engine REST API or SDK, and our service intelligently translates these high-level deployment requests into the appropriate Kubernetes objects (Deployment, Service, Ingress) on the backend cluster.

The platform handles all the complex networking configuration, ensuring that only the application's HTTP port is exposed to the internet. HTTPS is automatically configured and managed using industry-standard certificates. Upon successful deployment, users receive a public URL to access their application immediately.

                                      +----------------+
                                      |                |
                                      |  Container     |
                                      |  Registry      |
                                      |                |
                                      +--------+-------+
                                               |
                                               | Pull Image
                                               v
+---------------+    API Request    +----------+----------+    Manages    +----------------+
|               |                   |                     |               |                |
|   Developer   +------------------>+  Container Engine   +-------------->+   Kubernetes   |
|               |                   |                     |               |   Cluster      |
+---------------+    API Response   +----------+----------+               +--------+-------+
                                               |                                   |
                                               | Create                            |
                                               v                                   v
                                     +-------------------+              +---------------------+
                                     |                   |              |                     |
                                     |  Public URL       |<-------------+  Deployment,        |
                                     |  user.domain.app  |              |  Service, Ingress   |
                                     |                   |              |                     |
                                     +-------------------+              +---------------------+

The architecture is designed to be cloud-agnostic, meaning Container Engine can orchestrate deployments across multiple cloud providers or on-premise Kubernetes clusters with consistent behavior and performance.

Getting Started

Prerequisites

  • An account with Container Engine (register via API or web interface)
  • An API Key generated from your user dashboard or via the API
  • A Docker image available in a container registry

API Documentation

For comprehensive API documentation including authentication, user management, and deployment endpoints, see APIs.md.

Installation Options

Python SDK

For Python developers who want programmatic control:

pip install container-engine-sdk

JavaScript/TypeScript SDK

For web and Node.js applications:

npm install container-engine-sdk
# or
yarn add container-engine-sdk

CLI Tool

For command-line enthusiasts:

# Install globally
npm install -g container-engine-cli

# Basic usage
container-engine deploy --image nginx:latest --name my-website

Quick Start Guide

  1. Sign up for a Container Engine account at [your-domain]
  2. Generate an API key from your user dashboard
  3. Prepare your application in a Docker container
  4. Deploy your container using one of our SDKs or the REST API
  5. Access your application at the automatically generated URL

Usage (API Example)

Deploy an application using the API:

Endpoint

POST /v1/deployments

Headers

Authorization: Bearer <your-api-key>
Content-Type: application/json

Request Body

{
	"appName": "hello-world",
	"image": "nginx:latest",
	"port": 80,
	"envVars": {
		"BACKGROUND_COLOR": "blue"
	}
}

Example (curl)

curl -X POST https://api.[your-domain]/v1/deployments \
	-H "Authorization: Bearer <your-api-key>" \
	-H "Content-Type: application/json" \
	-d '{
		"appName": "hello-world",
		"image": "nginx:latest",
		"port": 80,
		"envVars": {"BACKGROUND_COLOR": "blue"}
	}'

Success Response

{
	"status": "pending",
	"deploymentId": "dpl-a1b2c3d4e5",
	"message": "Deployment 'hello-world' is being processed.",
	"url": "https://hello-world.decenter.app"
}

SDK Examples

Python

from container_engine import ContainerEngineClient

# Initialize client
client = ContainerEngineClient(api_key="your-api-key")

# Deploy a container
deployment = client.deploy(
    app_name="hello-world",
    image="nginx:latest",
    port=80,
    env_vars={"BACKGROUND_COLOR": "blue"}
)

# Get deployment URL
print(f"Deployment URL: {deployment.url}")

JavaScript

import { ContainerEngineClient } from 'container-engine-sdk';

// Initialize client
const client = new ContainerEngineClient({ apiKey: 'your-api-key' });

// Deploy a container
async function deployContainer() {
  const deployment = await client.deploy({
    appName: 'hello-world',
    image: 'nginx:latest',
    port: 80,
    envVars: { BACKGROUND_COLOR: 'blue' }
  });
  
  console.log(`Deployment URL: ${deployment.url}`);
}

deployContainer();

Lifecycle Management

Container Engine provides a full suite of API endpoints to manage the complete lifecycle of your deployments:

POST   /v1/deployments       # Create a new deployment
GET    /v1/deployments       # List all deployments
GET    /v1/deployments/{id}  # Get deployment details
PUT    /v1/deployments/{id}  # Update a deployment
DELETE /v1/deployments/{id}  # Delete a deployment
GET    /v1/deployments/{id}/logs  # Stream deployment logs

Advanced Features

Custom Domains

Map your own domain name to your deployment:

curl -X POST https://api.[your-domain]/v1/deployments/{id}/domains \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "myapp.example.com"
  }'

Horizontal Scaling

Scale your application horizontally to handle more traffic:

curl -X PATCH https://api.[your-domain]/v1/deployments/{id}/scale \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "replicas": 5
  }'

Health Checks

Configure custom health checks for your application:

curl -X POST https://api.[your-domain]/v1/deployments \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "appName": "hello-world",
    "image": "nginx:latest",
    "port": 80,
    "healthCheck": {
      "path": "/health",
      "initialDelaySeconds": 5,
      "periodSeconds": 10
    }
  }'

Security

Container Engine takes security seriously at every layer:

+------------------------+    +------------------------+    +------------------------+
| Authentication Layer   |    | Network Security       |    | Runtime Security       |
+------------------------+    +------------------------+    +------------------------+
| - API Key Auth         |    | - Auto TLS/SSL         |    | - Container Isolation  |
| - OAuth 2.0 Support    |    | - Network Policies     |    | - Resource Limits      |
| - Rate Limiting        |    | - DDoS Protection      |    | - Vulnerability Scans  |
+------------------------+    +------------------------+    +------------------------+

Contributing

We enthusiastically welcome contributions to the Container Engine project! Whether you're fixing bugs, adding features, improving documentation, or helping with tests, your input is valuable.

Contribution Process

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Setup

Container Engine includes an automated setup script that handles dependency installation and environment configuration:

# Clone the repository
git clone https://github.com/ngocbd/Open-Container-Engine.git
cd Open-Container-Engine

# Make setup script executable
chmod +x setup.sh

# Check system dependencies
./setup.sh check

# Full automated setup (installs dependencies if missing)
./setup.sh setup

# Start development server
./setup.sh dev

Available Setup Commands

# Get help and see all available commands
./setup.sh help

# Development commands
./setup.sh build          # Build the project
./setup.sh test           # Run Rust tests
./setup.sh format         # Format code
./setup.sh lint           # Run linting

# Integration testing
make test-setup           # Setup integration test environment
make test-integration     # Run comprehensive API integration tests
make test-integration-verbose  # Run integration tests with verbose output
make test-clean          # Clean integration test environment

# Database management
./setup.sh db-up          # Start database services
./setup.sh db-down        # Stop database services
./setup.sh db-reset       # Reset database and volumes
./setup.sh migrate        # Run database migrations
./setup.sh sqlx-prepare   # Prepare SQLx for offline compilation

# Docker operations
./setup.sh docker-build   # Build Docker image
./setup.sh docker-up      # Start all services with Docker
./setup.sh docker-down    # Stop all Docker services

# Cleanup
./setup.sh clean          # Clean build artifacts

Manual Setup (if needed)

If you prefer manual setup or the automated script doesn't work for your system:

# Install Rust and Cargo
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install SQLx CLI
cargo install sqlx-cli --no-default-features --features native-tls,postgres

# Start database services
docker compose up postgres redis -d

# Create environment file
cp .env.example .env

# Run migrations
export DATABASE_URL="postgresql://postgres:password@localhost:5432/container_engine"
sqlx migrate run

# Prepare SQLx for offline compilation
cargo sqlx prepare

# Build and run
cargo build
cargo run

API Documentation

Once the server is running, you can access:

Dependencies

The setup script automatically checks for and installs:

  • Rust (latest stable version)
  • Docker & Docker Compose
  • Git & curl
  • Python 3 (optional, for development tools)
  • SQLx CLI (for database migrations)

Testing

Container Engine includes a comprehensive test suite to ensure API reliability and functionality.

Integration Tests

We maintain a complete integration test suite using pytest that validates all API endpoints:

  • 93 integration tests covering every API endpoint
  • Automated test environment with Docker management
  • Authentication testing for JWT tokens and API keys
  • Error case validation for proper error handling
  • Response format verification ensuring API consistency

Running Integration Tests

# Setup test environment (install Python dependencies)
make test-setup

# Run all integration tests
make test-integration

# Run tests with verbose output
make test-integration-verbose

# Run specific test category
pytest -m auth              # Authentication tests
pytest -m deployment        # Deployment tests
pytest -m monitoring        # Monitoring tests

# Clean up test environment
make test-clean

Test Categories

  • Authentication (13 tests): Registration, login, logout, token refresh
  • API Keys (12 tests): Creation, listing, revocation, authentication
  • User Profile (15 tests): Profile management, password changes
  • Deployments (23 tests): CRUD operations, scaling, lifecycle management
  • Monitoring (11 tests): Logs, metrics, status endpoints
  • Domains (12 tests): Custom domain management
  • Health Check (3 tests): Server health monitoring
  • Infrastructure (4 tests): Test framework validation

Continuous Integration

Integration tests run automatically on every commit to the main branch via GitHub Actions, ensuring:

  • Code quality through linting and formatting checks
  • Database compatibility with PostgreSQL
  • Redis connectivity and caching functionality
  • Complete API endpoint validation

For detailed testing documentation, see tests/README.md and INTEGRATION_TESTS.md.

Unit Tests

Rust unit tests are available for core functionality:

# Run Rust unit tests
cargo test

# Run with verbose output
cargo test -- --nocapture

Roadmap

We're continuously improving Container Engine with new features and enhancements:

  • Q4 2025: Multi-cluster deployment support and advanced traffic routing
  • Q1 2026: Native serverless function support
  • Q2 2026: Advanced monitoring and observability features
  • Q3 2026: Machine learning model deployment specialization

License

Distributed under the MIT License. See LICENSE.txt for more information.

MIT License

Copyright (c) 2025 Container Engine Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files...

Contact / Acknowledgments

Special thanks to all contributors and the open-source projects that make Container Engine possible, including Kubernetes, Docker, and the vibrant cloud-native ecosystem.

About

Container Engine is a revolutionary open-source service that empowers developers to effortlessly deploy containerized applications to the internet with unprecedented simplicity and speed. By intelligently abstracting away the complexity of Kubernetes infrastructure, Container Engine creates a seamless deployment experience

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published