Kubernetes Platform for GenAI Applications
Project description
OGM Platform
Kubernetes Platform for GenAI Applications
Overview
OGM Platform is a comprehensive command-line tool that simplifies Kubernetes development for Generative AI applications. It provides one-command setup for complete development environments with K3s or full Kubernetes clusters.
The platform is designed to bridge the gap between local development and production deployment, offering developers a unified workflow for building, testing, and deploying GenAI applications on Kubernetes.
Key Features
- ๐ One-Command Setup: Initialize complete Kubernetes clusters (K3s or Full K8s)
- ๐ Multi-Environment Support: Seamless deployment across local, dev, stage, and production
- ๐ฆ Helm Integration: Automated Helm chart deployment and management
- ๐ Authentication Management: Secure credential storage and Kubernetes context handling
- ๐ Monitoring & Diagnostics: Built-in health checks and troubleshooting tools
- ๐ GitOps Workflow: Automated repository synchronization
- ๐ก๏ธ Production Ready: Enterprise-grade security and reliability
- ๐๏ธ Modular Architecture: Extensible design for custom components
Installation
From PyPI (Recommended)
pip install ogm-platform
From Source
git clone https://github.com/ogmworldwide/ogm-platform.git
cd ogm-platform
pip install -e .
Development Installation
git clone https://github.com/ogmworldwide/ogm-platform.git
cd ogm-platform
pip install -e ".[dev]"
Quick Start
After installation, initialize your development environment:
# Initialize a development environment
ogm init
# Deploy applications
ogm deploy
# Check cluster status
ogm status
# Clean up environment
ogm destroy
Architecture
Core Components
The OGM Platform consists of several key modules:
ogm/
โโโ cli.py # Command-line interface and command routing
โโโ config.py # Configuration management and validation
โโโ auth.py # Authentication and credential management
โโโ k3s.py # K3s cluster operations and management
โโโ helm.py # Helm chart deployment and management
โโโ git_ops.py # Git operations with authentication
โโโ state.py # State persistence and cluster tracking
โโโ diagnostic.py # Health checks and troubleshooting
โโโ insight.py # Analytics and monitoring
โโโ readiness.py # Deployment readiness checks
โโโ sync.py # Synchronization operations
โโโ utils.py # Utility functions and helpers
Design Principles
- Modular Design: Each module has a single responsibility
- Dependency Injection: Clean separation of concerns
- Configuration-Driven: Behavior controlled by configuration files
- Error Handling: Comprehensive error handling and logging
- Security First: Secure credential management and access controls
Data Flow
User Input โ CLI Parser โ Command Handler โ Manager โ Kubernetes API
โ
Configuration โ State Manager โ File System
โ
Credentials โ Auth Manager โ Secure Storage
Commands
Core Commands
| Command | Description | Example |
|---|---|---|
ogm init |
Initialize Kubernetes cluster and environment | ogm init |
ogm deploy |
Deploy applications to cluster | ogm deploy myapp |
ogm destroy |
Remove applications or entire environment | ogm destroy myapp |
ogm status |
Check cluster and application status | ogm status |
ogm logs |
View application logs | ogm logs myapp |
Configuration Commands
| Command | Description | Example |
|---|---|---|
ogm config |
Manage configuration settings | ogm config set environment dev |
ogm auth |
Manage authentication credentials | ogm auth set git |
Development Commands
| Command | Description | Example |
|---|---|---|
ogm dev |
Development workflow commands | ogm dev shell |
ogm test |
Run tests and validation | ogm test unit |
ogm build |
Build and package applications | ogm build myapp |
Advanced Commands
| Command | Description | Example |
|---|---|---|
ogm diagnostic |
Run diagnostic checks | ogm diagnostic full |
ogm insight |
View analytics and metrics | ogm insight usage |
ogm sync |
Synchronize repositories and configs | ogm sync repos |
Configuration
Configuration Files
The platform uses a hierarchical configuration system:
- Global Config:
~/.ogm/config.yaml- User-specific settings - Project Config:
.ogmconfig- Project-specific settings - Environment Variables: Runtime overrides
Example Configuration
# .ogmconfig
version: "1.0.0"
repos_dir: ~/ogm-repos
k3s:
version: v1.28.5+k3s1
kubeconfig_path: ~/.kube/config
data_dir: /var/lib/rancher/k3s
kubernetes:
version: v1.28.5
cluster_name: ogm-cluster
network_plugin: calico
environments:
dev:
cluster_type: k3s
nodes: 1
prod:
cluster_type: kubernetes
nodes: 3
Environment Variables
| Variable | Description | Default |
|---|---|---|
OGM_ENVIRONMENT |
Target environment | dev |
OGM_CONFIG_DIR |
Configuration directory | ~/.ogm |
OGM_LOG_LEVEL |
Logging verbosity | INFO |
KUBECONFIG |
Kubernetes config path | ~/.kube/config |
Usage Examples
Basic Development Workflow
# 1. Initialize development environment
ogm init
# 2. Set up authentication
ogm auth set git --username yourusername --token yourtoken
# 3. Clone and deploy an application
ogm deploy my-genai-app
# 4. Check status
ogm status
# 5. View logs
ogm logs my-genai-app
# 6. Clean up when done
ogm destroy my-genai-app
Multi-Environment Deployment
# Deploy to different environments
OGM_ENVIRONMENT=staging ogm deploy myapp
OGM_ENVIRONMENT=production ogm deploy myapp
# Check status across environments
ogm status --environment staging
ogm status --environment production
Custom Configuration
# Create custom configuration
ogm config set k3s.version v1.29.0+k3s1
ogm config set kubernetes.nodes 5
# View current configuration
ogm config list
Development
Setting Up Development Environment
# Clone the repository
git clone https://github.com/ogmworldwide/ogm-platform.git
cd ogm-platform
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
# Run linting
black ogm/
flake8 ogm/
mypy ogm/
Running Tests
# Run all tests
pytest
# Run specific test file
pytest tests/test_cli.py
# Run with coverage
pytest --cov=ogm --cov-report=html
# Run integration tests
pytest tests/integration/
Code Quality
The project uses several tools to maintain code quality:
- Black: Code formatting
- Flake8: Linting and style checking
- MyPy: Static type checking
- Pytest: Unit and integration testing
- Coverage: Test coverage reporting
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes and add tests
- Run the test suite:
pytest - Check code quality:
black ogm/ && flake8 ogm/ && mypy ogm/ - Commit your changes:
git commit -am 'Add your feature' - Push to the branch:
git push origin feature/your-feature - Create a Pull Request
Code Structure
ogm/
โโโ cli.py # Main CLI entry point
โโโ config.py # Configuration management
โโโ managers/ # Business logic managers
โ โโโ auth_manager.py
โ โโโ k3s_manager.py
โ โโโ helm_manager.py
โ โโโ git_manager.py
โโโ models/ # Data models and schemas
โ โโโ config.py
โ โโโ cluster.py
โ โโโ deployment.py
โโโ utils/ # Utility functions
โ โโโ logging.py
โ โโโ validation.py
โ โโโ helpers.py
โโโ commands/ # CLI command implementations
โโโ init.py
โโโ deploy.py
โโโ destroy.py
โโโ status.py
API Reference
Core Classes
CLI Class
from ogm.cli import main
# Run the CLI
main()
Configuration Manager
from ogm.config import ConfigManager
config = ConfigManager()
settings = config.load()
Authentication Manager
from ogm.auth import AuthManager
auth = AuthManager()
auth.set_credentials('git', username='user', token='token')
Managers
The platform uses a manager pattern for different concerns:
- ConfigManager: Handles configuration loading and validation
- AuthManager: Manages authentication credentials
- K3sManager: Handles K3s cluster operations
- HelmManager: Manages Helm chart deployments
- GitManager: Handles Git operations
- StateManager: Manages cluster state persistence
Troubleshooting
Common Issues
Cluster Initialization Fails
# Check system requirements
ogm diagnostic system
# Check network connectivity
ogm diagnostic network
# View detailed logs
ogm logs --level DEBUG
Authentication Issues
# Reset credentials
ogm auth clear
# Reconfigure authentication
ogm auth set git
# Test authentication
ogm auth test
Deployment Failures
# Check cluster status
ogm status
# View deployment logs
ogm logs deployment-name
# Run diagnostics
ogm diagnostic cluster
Debug Mode
Enable debug logging for detailed troubleshooting:
export OGM_LOG_LEVEL=DEBUG
ogm command --verbose
Getting Help
# View help for any command
ogm --help
ogm command --help
# View diagnostic information
ogm diagnostic --full
# Check version and system info
ogm version
Security
Credential Management
The platform securely stores credentials using:
- Encrypted local storage
- Environment variable support
- Integration with system keyrings
- Temporary credential caching
Best Practices
- Never commit credentials to version control
- Use environment-specific credentials
- Regularly rotate authentication tokens
- Enable audit logging for production deployments
Performance
Optimization Tips
- Use K3s for development environments
- Configure appropriate resource limits
- Enable caching for repeated operations
- Use incremental deployments when possible
Monitoring
# View performance metrics
ogm insight performance
# Monitor resource usage
ogm insight resources
# Check cluster health
ogm diagnostic health
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For support and questions:
- ๐ง Email: dev@ogmplatform.com
- ๐ Documentation: https://docs.ogmplatform.com
- ๐ Issues: https://github.com/ogmworldwide/ogm-platform/issues
- ๐ฌ Discussions: https://github.com/ogmworldwide/ogm-platform/discussions
Changelog
See CHANGELOG.md for version history and updates.
Roadmap
Upcoming Features
- Enhanced multi-cluster support
- Improved CI/CD integration
- Advanced monitoring and alerting
- Plugin system for custom components
- Cloud provider integrations
Contributing to the Roadmap
We welcome feature requests and contributions. Please see our Contributing Guide for details on how to get involved. /home/mksaraf/projects/ogm-platform-package/README.ogm-platform.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ogm_platform-1.0.14.tar.gz.
File metadata
- Download URL: ogm_platform-1.0.14.tar.gz
- Upload date:
- Size: 69.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
229a042d0cb12b42cd70a85618aa841921b1168086cc1ab0b3834c823b4d3300
|
|
| MD5 |
7355c08b67b4f4767ddac3fd06728c1b
|
|
| BLAKE2b-256 |
3a7cf675c3debed72313a27c393a350144173c4b8f1a703b3b90e2a963ba1e1e
|
File details
Details for the file ogm_platform-1.0.14-py3-none-any.whl.
File metadata
- Download URL: ogm_platform-1.0.14-py3-none-any.whl
- Upload date:
- Size: 71.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3190f69bacd5794b9f84d14f37c4c9d7e054d6375eb2546abc4331ef7e6c9ee
|
|
| MD5 |
cb94677e3f00b3dcd358633ec96f11a0
|
|
| BLAKE2b-256 |
040061afcc350b07c078f4485550d03b9cb31b1ec2e7b7435f2bf78e29e1831b
|