Skip to content

ksasar1000/react-native-app-intro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

805 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WebAssemblyRuntimeConfig

Automated tool to fetch container runtime specifications from various orchestrators (Kubernetes, Docker Swarm, Nomad, etc.) and generate standardized YAML manifests for easy consumption by deployment pipelines and infrastructure tools.

⚑ Capabilities

  • πŸ”§ Unified Schema: Consistent YAML output format for declarative infrastructure
  • πŸ” Auto Discovery: Intelligent detection of runtime features (GPU access, persistent volumes, network policies)
  • πŸ—οΈ Multi-Orchestrator: Extensible architecture supporting multiple container platforms
  • ⚑ Parallel Collection: Efficient concurrent data retrieval from multiple control planes
  • πŸ“Š Consolidated Output: Generate both platform-specific manifests and complete environment files
  • πŸ€– CI/CD Integration: Automated scheduled updates for runtime specifications

πŸ“₯ Setup

Requirements

  • Go 1.21+
  • Make

Compilation

git clone https://github.com/container-core/runtime-spec.git
cd runtime-spec
make build

πŸš€ Quick Start

Basic Operation

Collect runtime specs from all orchestrators:

go run main.go collect-all

Specify output location:

go run main.go collect-all -d ./manifests

Collect from specific platforms:

go run main.go collect-platforms -p kubernetes,nomad

Command Reference

# Collect from all platforms
go run main.go collect-all [FLAGS]

# Collect from specific platforms
go run main.go collect-platforms -p <PLATFORMS> [FLAGS]

Flags:
  -d, --directory <DIR>    Output directory [default: specs]
  -c, --config <CONFIG>    Configuration file [default: config/orchestrators.yaml]
  -v, --verbose           Enable verbose logging

πŸ“„ Output Schema

Platform-Specific YAML

platform: kubernetes
platformName: Kubernetes
lastUpdated: 2025-01-15T10:30:00Z
runtimes:
  - id: containerd/stable
    name: Containerd Stable
    cgroupDriver: systemd
    storageDriver: overlay2
    gpuSupport: true
    volumeTypes:
      - persistent
      - ephemeral
    networkPlugins:
      - cni
      - calico
    description: Production-grade container runtime with full Kubernetes integration...

Consolidated Manifest (all.yaml)

version: 2.1.0
generatedAt: 2025-01-15T10:30:00Z
totalRuntimes: 24
orchestrators:
  kubernetes:
    platformId: kubernetes
    platformName: Kubernetes
    runtimes:
      - id: containerd/stable
        name: Containerd Stable
        cgroupDriver: systemd
        storageDriver: overlay2
        gpuSupport: true
        volumeTypes:
          - persistent
          - ephemeral
        networkPlugins:
          - cni
          - calico

βš™οΈ Configuration

Orchestrator Settings (Optional)

Create config/orchestrators.yaml file:

kubernetes:
  api_endpoint: "https://k8s-api.cluster.local"
  auth_token_env: "KUBERNETES_TOKEN"
  timeout: 45
  rate_limit: 15

nomad:
  api_endpoint: "https://nomad-server.local:4646"
  auth_token_env: "NOMAD_TOKEN"
  timeout: 30

docker_swarm:
  api_endpoint: "https://swarm-manager.local:2376"
  tls_verify: true
  timeout: 25

Authentication

For secured orchestrators, set corresponding environment variables:

export KUBERNETES_TOKEN="bearer-token-here"
export NOMAD_TOKEN="nomad-secret-here"

πŸ”„ Pipeline Automation

The project includes GitLab CI pipeline with multiple execution modes:

⏰ Scheduled Execution

  • Code Updates: Triggers on merge to main branch (go.mod, main.go, pipeline config)
  • Version Tags: Automatically triggered by v*.*.* tags

πŸ‘† Manual Triggers

  • Pipeline Dispatch: Manual execution with platform selection - Creates merge request
  • Tag Deployment: Create and push vx.y.z tag for versioned deployments

πŸ”§ Update Workflow

  • Manual/Pipeline: Creates merge request for team review
  • Direct Commits: Immediate commit to main branch (bypasses review)
  • Tag Events: Deployment-only, no code changes

🏷️ Release Variants

Versioned Deployments

# Create versioned deployment
git tag v2.1.0
git push origin v2.1.0

# Automated pipeline will:
# 1. Collect latest runtime specifications
# 2. Generate YAML manifests
# 3. Create deployment package with comprehensive assets
# 4. Upload platform-specific archives

πŸ“¦ Deployment Assets

Each tagged release includes:

  • πŸ“ˆ Runtime statistics and platform metrics
  • ⏱️ Generation timestamp
  • πŸ—‚οΈ Complete bundle (runtime-specs-{version}.tar.gz)
  • πŸ”— Individual platform archives
  • πŸ“‹ Direct YAML file access
  • πŸ› οΈ Integration templates

πŸ“‚ Repository Layout

β”œβ”€β”€ cmd/
β”‚   └── collector/        # CLI entry point
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ models/          # Type definitions
β”‚   β”œβ”€β”€ platforms/       # Orchestrator implementations
β”‚   β”œβ”€β”€ fetcher/         # Data collection logic
β”‚   β”œβ”€β”€ generator/       # Manifest generation
β”‚   └── config/          # Configuration handling
β”œβ”€β”€ specs/               # Generated YAML files
β”œβ”€β”€ runtime_manifests/   # Git-tracked specification files
β”œβ”€β”€ docs/                # Technical documentation
└── .gitlab/            # CI/CD configuration

🧩 Adding New Platforms

  1. Create new file in internal/platforms/ (e.g., mesos.go)
  2. Implement the PlatformCollector interface:
type MesosCollector struct {}

func (m *MesosCollector) FetchRuntimes() ([]RuntimeSpec, error) {
    // Implement API calls and data transformation
}

func (m *MesosCollector) PlatformID() string { return "mesos" }
func (m *MesosCollector) PlatformName() string { return "Apache Mesos" }
  1. Register collector in internal/platforms/registry.go
  2. Add platform to main configuration

Detailed implementation guide: Platform Integration

🏭 Currently Supported Platforms

  • βœ… Kubernetes - 24 runtimes with GPU, storage, and network capability detection
  • 🚧 Nomad - In development
  • 🚧 Docker Swarm - Planned
  • 🚧 Apache Mesos - Planned

πŸ”¬ Development

Test Suite

go test ./...

Debug Output

DEBUG=true go run main.go collect-all

Code Quality

go fmt ./...
go vet ./...
staticcheck ./...

πŸ“š Documentation

🎯 Implementation Examples

Deployment Pipeline Integration

# GitLab CI example
stages:
  - collect
  - validate
  - deploy

collect_specs:
  stage: collect
  script:
    - go run main.go collect-all -d ./generated
  artifacts:
    paths:
      - generated/

Infrastructure Analysis

Generated YAML files support:

  • πŸ“Š Runtime capability analysis
  • πŸ” Platform feature comparison
  • πŸ’° Cost optimization insights
  • πŸ“ˆ Performance benchmarking

🀝 Community Contributions

Feature requests and code contributions welcome!

  1. Fork repository
  2. Create feature branch
  3. Implement changes
  4. Submit merge request

πŸ“œ License

Apache 2.0 License

πŸ™Œ Credits

Thanks to container orchestrator communities for providing comprehensive APIs and specifications.

PR Merge: 2025-11-26 01:58:11

About

Co-authored-by_ contributor[bot] automated-merge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors