{"id":44750856,"url":"https://github.com/malgorath/cyberbrain-orchestrator","last_synced_at":"2026-02-15T23:10:19.962Z","repository":{"id":331639188,"uuid":"1130532912","full_name":"malgorath/cyberbrain-orchestrator","owner":"malgorath","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-10T16:57:15.000Z","size":339,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-11T04:17:32.257Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/malgorath.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-08T16:33:54.000Z","updated_at":"2026-01-10T16:57:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/malgorath/cyberbrain-orchestrator","commit_stats":null,"previous_names":["malgorath/cyberbrain-orchestrator"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/malgorath/cyberbrain-orchestrator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malgorath%2Fcyberbrain-orchestrator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malgorath%2Fcyberbrain-orchestrator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malgorath%2Fcyberbrain-orchestrator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malgorath%2Fcyberbrain-orchestrator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malgorath","download_url":"https://codeload.github.com/malgorath/cyberbrain-orchestrator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malgorath%2Fcyberbrain-orchestrator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29492005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T19:29:10.908Z","status":"ssl_error","status_checked_at":"2026-02-15T19:29:10.419Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-15T23:10:17.297Z","updated_at":"2026-02-15T23:10:19.956Z","avatar_url":"https://github.com/malgorath.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cyberbrain Orchestrator\n\nA Django 5-based orchestration system for managing Docker container tasks with Django REST Framework API and a simple WebUI.\n\n## Features\n\n- **Django 5 + Django REST Framework**: Modern web framework with powerful API capabilities\n- **PostgreSQL Database**: Robust data storage for orchestrator state\n- **Docker Integration**: Direct access to host Docker daemon via `/var/run/docker.sock`\n- **Task Orchestration**: Support for multiple task types:\n  - Log Triage\n  - GPU Report\n  - Service Map\n- **WebUI Dashboard**: Simple, responsive web interface for managing runs\n- **RESTful API**: Full API for programmatic access\n- **Container Allowlist**: Security feature to control which containers can be accessed\n\n## Architecture\n\n### Database Models\n\n- **Directive**: Task templates/configurations for orchestrator runs\n- **Run**: Represents an orchestration run with status tracking\n- **Job**: Individual tasks within a run (log_triage, gpu_report, service_map)\n- **LLMCall**: Token count tracking for LLM API calls\n- **ContainerAllowlist**: Whitelist of containers that can be accessed\n\n### API Endpoints\n\n- `POST /api/runs/launch/` - Launch a new orchestrator run\n- `GET /api/runs/` - List all runs\n- `GET /api/runs/{id}/` - Get run details\n- `GET /api/runs/{id}/report/` - Fetch run report (markdown + JSON)\n- `GET /api/directives/` - List/manage directives\n- `GET /api/jobs/` - List all jobs\n- `GET /api/containers/` - List/manage container allowlist\n\n## Quick Start\n\n### Prerequisites\n\n- Docker and Docker Compose\n- Port 9595 available on your host IP (e.g., \u003cUNRAID_HOST\u003e; configurable)\n\n### Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/malgorath/cyberbrain-orchestrator.git\ncd cyberbrain-orchestrator\n```\n\n2. Configure environment variables:\n```bash\ncp .env.example .env\n# Edit .env with your configuration\n```\n\n3. Create local directories for volumes:\n```bash\nmkdir -p logs uploads\n```\n\n### Using Published Docker Image (Recommended for Production)\n\nThe Docker image is automatically built and published to GitHub Container Registry (GHCR) on every push to `main` and on release tags:\n\n**Image:** `ghcr.io/malgorath/cyberbrain-orchestrator:latest`\n\n**Available tags:**\n- `latest` - Latest from main branch\n- `v*` - Release versions (e.g., `v1.0.0`)\n- `main-\u003csha\u003e` - Specific commit SHA on main\n- `pr-*` - Pull request builds\n\n**For Unraid/Docker templates, use:**\n```\nghcr.io/malgorath/cyberbrain-orchestrator:latest\n```\n\n**Example docker-compose.yml with published image:**\n```yaml\nversion: '3.8'\nservices:\n  web:\n    image: ghcr.io/malgorath/cyberbrain-orchestrator:latest\n    ports:\n      - \"9595:8000\"\n    environment:\n      - DATABASE_URL=postgresql://...\n    volumes:\n      - /mnt/user/cyberbrain/logs:/app/logs\n      - /var/run/docker.sock:/var/run/docker.sock:ro\n```\n\n4. Start the services:\n```bash\ndocker-compose up -d\n```\n\n5. Run migrations:\n```bash\ndocker-compose exec web /opt/venv/bin/python manage.py migrate\n```\n\n6. Create a superuser for admin access:\n```bash\ndocker-compose exec web /opt/venv/bin/python manage.py createsuperuser\n```\n\n7. Access the application:\n- WebUI: http://\u003cHOST_IP\u003e:9595/\n- API: http://\u003cHOST_IP\u003e:9595/api/\n- Admin: http://\u003cHOST_IP\u003e:9595/admin/\n\n### Local Development (without Docker)\n\n1. Install dependencies:\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate  # On Windows: .venv\\Scripts\\activate\n./.venv/bin/python -m pip install -r requirements.txt\n```\n\n2. Set up PostgreSQL (or use SQLite for development):\n```bash\n# Update POSTGRES_HOST in .env to localhost\n# Or switch to SQLite in settings.py temporarily\n```\n\n3. Run migrations:\n```bash\n./.venv/bin/python manage.py migrate\n```\n\n4. Create superuser:\n```bash\n./.venv/bin/python manage.py createsuperuser\n```\n\n5. Run development server:\n```bash\n./.venv/bin/python manage.py runserver 0.0.0.0:8000\n```\n\n## Usage\n\n### Launching Runs via API\n\n**Launch all tasks:**\n```bash\ncurl -X POST http://\u003cHOST_IP\u003e:9595/api/runs/launch/ \\\n  -H \"Content-Type: application/json\" \\\n  -d '{}'\n```\n\n**Launch specific tasks:**\n```bash\ncurl -X POST http://\u003cHOST_IP\u003e:9595/api/runs/launch/ \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"tasks\": [\"log_triage\", \"gpu_report\"]}'\n```\n\n### Listing Runs\n\n```bash\ncurl http://\u003cHOST_IP\u003e:9595/api/runs/\n```\n\n### Fetching Reports\n\n```bash\ncurl http://\u003cHOST_IP\u003e:9595/api/runs/1/report/\n```\n\n### Managing Container Allowlist\n\n```bash\n# List containers\ncurl http://\u003cHOST_IP\u003e:9595/api/containers/\n\n# Add container\ncurl -X POST http://\u003cHOST_IP\u003e:9595/api/containers/ \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"container_id\": \"abc123\", \"name\": \"my-container\", \"description\": \"Production container\"}'\n```\n\n## Environment Variables\n\nKey environment variables (see `.env.example` for all):\n\n- `POSTGRES_DB`: Database name\n- `POSTGRES_USER`: Database user\n- `POSTGRES_PASSWORD`: Database password\n- `DJANGO_SECRET_KEY`: Django secret key (change in production!)\n- `DJANGO_DEBUG`: Debug mode (False in production)\n- `CYBER_BRAIN_LOGS`: Path to logs directory\n- `UPLOADS_DIR`: Path to uploads directory\n\n## Docker Configuration\n\nThe `docker-compose.yml` file configures:\n\n- **PostgreSQL** service on internal network\n- **Django** web service exposed on `HOST_IP:9595`\n- Volume mounts:\n  - `CYBER_BRAIN_LOGS` → `/logs`\n  - `UPLOADS_DIR` → `/uploads`\n  - `/var/run/docker.sock` → access to host Docker daemon\n- Health checks and automatic restarts\n\n## Security Notes\n\n- **No Prompt Storage**: The system does not store LLM prompts, only token counts\n- **Container Allowlist**: Use the ContainerAllowlist model to restrict container access\n- **Debug Mode**: Set `DJANGO_DEBUG=False` in production\n- **Secret Key**: Change `DJANGO_SECRET_KEY` in production\n- **Docker Socket**: Mounting `/var/run/docker.sock` provides full Docker access - use with caution\n\n## Development\n\n### Running Tests\n\n```bash\n./.venv/bin/python manage.py test --settings=cyberbrain_orchestrator.test_settings\n```\n\n### Creating Migrations\n\n```bash\n./.venv/bin/python manage.py makemigrations\n./.venv/bin/python manage.py migrate\n```\n\n### Accessing Django Shell\n\n```bash\n./.venv/bin/python manage.py shell\n```\n\n## Troubleshooting\n\n### Port Binding Issues\n\nIf port 9595 on your host is not available:\n1. Edit `docker-compose.yml`\n2. Change `\u003cHOST_IP\u003e:9595:8000` to your desired IP:port\n\n### Database Connection Issues\n\n1. Check PostgreSQL is running: `docker-compose ps`\n2. Check logs: `docker-compose logs db`\n3. Verify environment variables in `.env`\n\n### Docker Socket Permission Issues\n\nIf the web container cannot access Docker:\n```bash\ndocker-compose exec web ls -la /var/run/docker.sock\n# Ensure proper permissions\n```\n\n## License\n\nMIT License\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalgorath%2Fcyberbrain-orchestrator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalgorath%2Fcyberbrain-orchestrator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalgorath%2Fcyberbrain-orchestrator/lists"}