Files
runtime/INTEGRATION_COMPLETE.md
Hanzo Dev c3efd3a149 feat: Add new Dockerfiles and improve containerization
- Add main Dockerfile for production builds
- Add Dockerfile.runtime for secure code execution
- Add Dockerfile.runtime.fixed with improved configuration
- Include .dockerignore for build optimization
- Add integration documentation and publishing guides
- Update API and CLI components for better runtime support
- Enhance sandbox and container management features
2025-08-16 23:03:39 -05:00

3.9 KiB

Hanzo Runtime Integration Complete

Summary

The Hanzo Runtime has been successfully prepared for release with full IAM integration and dashboard SSO support.

What's Ready

📦 NPM Packages (v0.7.0)

  • @hanzo/api-client - TypeScript API client
  • @hanzo/runner-api-client - Runner API client
  • @hanzo/runtime - Main TypeScript SDK

🐍 Python Packages (v0.7.0)

  • hanzo-runtime - Main Python SDK
  • hanzo_runtime_api_client - Python API client
  • hanzo_runtime_api_client_async - Async Python API client

🔐 IAM Integration

  • OAuth2 authentication examples
  • Token validation middleware
  • Automatic token refresh
  • Service-to-service auth
  • Dashboard SSO configuration

📊 Dashboard Integration

  • OIDC authentication ready
  • IAM token validation
  • Seamless SSO flow
  • User context from IAM

Test Results

✅ All TypeScript packages build successfully
✅ Dashboard builds with OIDC support  
✅ API supports IAM token validation
✅ Integration examples are valid
✅ Documentation is complete

Quick Start

1. Publish Packages

# Set your tokens
export PYPI_TOKEN=your_pypi_token
export NPM_OTP=your_npm_otp  # Or enter interactively

# Run publish script
./publish-with-tokens.sh

2. Configure IAM

In Hanzo IAM, create the Runtime application:

{
  "name": "runtime-dashboard",
  "client_id": "runtime-dashboard",
  "redirect_uris": [
    "https://runtime.hanzo.ai",
    "https://runtime.hanzo.ai/callback"
  ],
  "grant_types": ["authorization_code", "client_credentials"]
}

3. Deploy Dashboard

# Set environment variables
export VITE_OIDC_DOMAIN=https://iam.hanzo.ai
export VITE_OIDC_CLIENT_ID=runtime-dashboard
export VITE_API_URL=https://api.runtime.hanzo.ai

# Build and deploy
pnpm nx build dashboard
# Deploy dist/apps/dashboard to your hosting

4. Use the SDKs

TypeScript:

import { HanzoRuntime } from '@hanzo/runtime';
import { authenticateWithIAM } from './iam-auth';

const token = await authenticateWithIAM();
const client = new HanzoRuntime({ apiKey: token });

Python:

from hanzo_runtime import HanzoRuntime
from iam_auth import HanzoIAMAuth

iam = HanzoIAMAuth()
client = HanzoRuntime(api_key=iam.get_token())

Architecture

┌─────────────┐     ┌─────────────┐     ┌──────────────┐
│  Hanzo IAM  │────▶│  Dashboard  │────▶│ Runtime API  │
│  (Casdoor)  │     │   (React)   │     │  (NestJS)    │
└─────────────┘     └─────────────┘     └──────────────┘
       │                                         │
       │                                         ▼
       │                                 ┌──────────────┐
       └────────────────────────────────▶│   Sandbox    │
                                         │  Execution   │
                                         └──────────────┘

Files Created

  • /PUBLISH_INSTRUCTIONS.md - Publishing guide
  • /publish-with-tokens.sh - Automated publish script
  • /test-integration.sh - Integration test script
  • /examples/iam-integration/ - Complete integration examples
    • typescript/iam-auth.ts - TypeScript authentication
    • python/iam_auth.py - Python authentication
    • runtime-api-middleware.ts - API middleware
    • README.md - Integration guide
    • dashboard-sso.md - Dashboard SSO setup

Support


The Hanzo Runtime is ready for production! 🚀