Signed-off-by: ale <ale@manalejandro.com>
Este commit está contenido en:
ale
2026-01-18 01:52:47 +01:00
padre 1692dbf411
commit 644828e4f2
Se han modificado 14 ficheros con 453 adiciones y 25 borrados

Ver fichero

@@ -82,5 +82,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Permission-based capabilities for agents
- Confirmation required for destructive operations
[Unreleased]: https://github.com/debai/debai/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/debai/debai/releases/tag/v1.0.0
[Unreleased]: https://github.com/manalejandro/debai/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/manalejandro/debai/releases/tag/v1.0.0

Ver fichero

@@ -10,7 +10,7 @@ By participating in this project, you agree to maintain a respectful and inclusi
### Reporting Bugs
1. Check if the bug has already been reported in [Issues](https://github.com/debai/debai/issues)
1. Check if the bug has already been reported in [Issues](https://github.com/manalejandro/debai/issues)
2. If not, create a new issue with:
- Clear, descriptive title
- Steps to reproduce

75
Dockerfile Archivo normal
Ver fichero

@@ -0,0 +1,75 @@
FROM python:3.12-slim
LABEL maintainer="Debai Team <debai@example.com>"
LABEL description="Debai AI Agent Management System"
LABEL version="1.0.0"
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
wget \
git \
ca-certificates \
gnupg \
lsb-release \
&& rm -rf /var/lib/apt/lists/*
# Install Docker CLI (for Docker Model Runner integration)
RUN install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
chmod a+r /etc/apt/keyrings/docker.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt-get update && \
apt-get install -y --no-install-recommends docker-ce-cli && \
rm -rf /var/lib/apt/lists/*
# Create debai user and group
RUN groupadd -r debai --gid=1000 && \
useradd -r -g debai --uid=1000 --home-dir=/home/debai --shell=/bin/bash debai && \
mkdir -p /home/debai && \
chown -R debai:debai /home/debai
# Set working directory
WORKDIR /app
# Copy project files
COPY --chown=debai:debai pyproject.toml README.md LICENSE ./
COPY --chown=debai:debai src/ ./src/
COPY --chown=debai:debai data/ ./data/
# Install Python dependencies and Debai
RUN pip install --no-cache-dir -e . && \
pip install --no-cache-dir gunicorn uvicorn[standard]
# Create required directories
RUN mkdir -p /etc/debai /var/lib/debai /var/log/debai && \
chown -R debai:debai /etc/debai /var/lib/debai /var/log/debai
# Copy default configuration
RUN cp data/config/debai.yaml /etc/debai/config.yaml && \
chown debai:debai /etc/debai/config.yaml
# Switch to debai user
USER debai
# Initialize Debai (creates config directories)
RUN debai init || true
# Expose ports
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=40s \
CMD python -c "import requests; requests.get('http://localhost:8000/health')" || exit 1
# Default command
CMD ["python", "-m", "uvicorn", "debai.api:app", "--host", "0.0.0.0", "--port", "8000"]

201
Dockerfile.gui Archivo normal
Ver fichero

@@ -0,0 +1,201 @@
FROM node:20-slim
LABEL maintainer="Debai Team <debai@example.com>"
LABEL description="Debai Web GUI"
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
curl \
&& rm -rf /var/lib/apt/lists/*
# Create app user
RUN useradd -m -s /bin/bash debai
WORKDIR /app
# Copy Python backend
COPY --chown=debai:debai pyproject.toml README.md ./
COPY --chown=debai:debai src/ ./src/
# Install Python dependencies
RUN pip3 install --no-cache-dir --break-system-packages -e .
# Create web GUI directory
RUN mkdir -p /app/web && chown -R debai:debai /app/web
# Simple web server for GUI
COPY --chown=debai:debai <<'EOF' /app/web/server.js
const http = require('http');
const fs = require('fs');
const path = require('path');
const PORT = 8080;
const server = http.createServer((req, res) => {
if (req.url === '/' || req.url === '/index.html') {
res.writeHead(200, { 'Content-Type': 'text/html' });
res.end(`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Debai - AI Agent Management</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
color: #333;
}
.container {
background: white;
border-radius: 20px;
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
padding: 3rem;
max-width: 600px;
width: 90%;
text-align: center;
}
h1 {
color: #667eea;
font-size: 2.5rem;
margin-bottom: 1rem;
}
.subtitle {
color: #666;
font-size: 1.2rem;
margin-bottom: 2rem;
}
.status {
background: #f0f9ff;
border: 2px solid #0ea5e9;
border-radius: 10px;
padding: 1rem;
margin: 2rem 0;
}
.status-item {
display: flex;
justify-content: space-between;
padding: 0.5rem 0;
border-bottom: 1px solid #e0e7ff;
}
.status-item:last-child { border-bottom: none; }
.btn {
display: inline-block;
background: #667eea;
color: white;
padding: 1rem 2rem;
border-radius: 10px;
text-decoration: none;
font-weight: 600;
transition: all 0.3s;
margin: 0.5rem;
}
.btn:hover {
background: #5568d3;
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}
.info {
background: #fef3c7;
border-left: 4px solid #f59e0b;
padding: 1rem;
margin: 1rem 0;
text-align: left;
}
</style>
</head>
<body>
<div class="container">
<h1>🤖 Debai</h1>
<p class="subtitle">AI Agent Management System</p>
<div class="status">
<h3 style="margin-bottom: 1rem;">System Status</h3>
<div class="status-item">
<span><strong>API Status:</strong></span>
<span id="api-status">Checking...</span>
</div>
<div class="status-item">
<span><strong>Models Service:</strong></span>
<span id="models-status">Checking...</span>
</div>
<div class="status-item">
<span><strong>Version:</strong></span>
<span>1.0.0</span>
</div>
</div>
<div class="info">
<strong> Note:</strong> This is a placeholder web interface.
Use the GTK GUI application for full functionality or access the API directly.
</div>
<div>
<a href="http://localhost:8000/docs" class="btn" target="_blank">📚 API Docs</a>
<a href="http://localhost:9090" class="btn" target="_blank">📊 Metrics</a>
<a href="http://localhost:3000" class="btn" target="_blank">📈 Grafana</a>
</div>
<p style="margin-top: 2rem; color: #666; font-size: 0.9rem;">
For full GUI functionality, install the GTK application:<br>
<code style="background: #f3f4f6; padding: 0.5rem; border-radius: 5px; display: inline-block; margin-top: 0.5rem;">
debai-gui
</code>
</p>
</div>
<script>
async function checkStatus() {
try {
const apiResponse = await fetch('http://localhost:8000/health');
document.getElementById('api-status').innerHTML =
apiResponse.ok ? '✅ Running' : '❌ Down';
} catch {
document.getElementById('api-status').innerHTML = '❌ Unreachable';
}
try {
const modelsResponse = await fetch('http://localhost:11434/api/tags');
document.getElementById('models-status').innerHTML =
modelsResponse.ok ? '✅ Running' : '❌ Down';
} catch {
document.getElementById('models-status').innerHTML = '❌ Unreachable';
}
}
checkStatus();
setInterval(checkStatus, 30000);
</script>
</body>
</html>
`);
} else if (req.url === '/health') {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ status: 'ok' }));
} else {
res.writeHead(404);
res.end('Not Found');
}
});
server.listen(PORT, '0.0.0.0', () => {
console.log(\`Web GUI running on http://0.0.0.0:\${PORT}\`);
});
EOF
USER debai
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
CMD ["node", "/app/web/server.js"]

Ver fichero

@@ -35,7 +35,7 @@ Debai is a comprehensive application for generating and managing AI agents that
```bash
# Download the latest release
wget https://github.com/debai/debai/releases/latest/download/debai_1.0.0-1_all.deb
wget https://github.com/manalejandro/debai/releases/latest/download/debai_1.0.0-1_all.deb
# Install
sudo dpkg -i debai_1.0.0-1_all.deb
@@ -46,7 +46,7 @@ sudo apt-get install -f
```bash
# Clone the repository
git clone https://github.com/debai/debai.git
git clone https://github.com/manalejandro/debai.git
cd debai
# Install dependencies
@@ -328,8 +328,8 @@ Debai is released under the [GNU General Public License v3.0](LICENSE).
## Support
- 📚 [Documentation](https://debai.readthedocs.io)
- 🐛 [Issue Tracker](https://github.com/debai/debai/issues)
- 💬 [Discussions](https://github.com/debai/debai/discussions)
- 🐛 [Issue Tracker](https://github.com/manalejandro/debai/issues)
- 💬 [Discussions](https://github.com/manalejandro/debai/discussions)
---

6
debian/control vendido
Ver fichero

@@ -9,9 +9,9 @@ Build-Depends: debhelper-compat (= 13),
python3-pip,
python3-venv
Standards-Version: 4.6.2
Homepage: https://github.com/debai/debai
Vcs-Git: https://github.com/debai/debai.git
Vcs-Browser: https://github.com/debai/debai
Homepage: https://github.com/manalejandro/debai
Vcs-Git: https://github.com/manalejandro/debai.git
Vcs-Browser: https://github.com/manalejandro/debai
Rules-Requires-Root: no
Package: debai

2
debian/copyright vendido
Ver fichero

@@ -1,7 +1,7 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: debai
Upstream-Contact: Debai Team <debai@example.com>
Source: https://github.com/debai/debai
Source: https://github.com/manalejandro/debai
Files: *
Copyright: 2025-2026 Debai Team

152
docker-compose.yml Archivo normal
Ver fichero

@@ -0,0 +1,152 @@
version: '3.8'
services:
# Debai Core Service
debai-core:
build:
context: .
dockerfile: Dockerfile
image: debai/core:latest
container_name: debai-core
restart: unless-stopped
environment:
- DEBAI_CONFIG_DIR=/etc/debai
- DEBAI_DATA_DIR=/var/lib/debai
- DEBAI_LOG_LEVEL=${DEBAI_LOG_LEVEL:-info}
- DEBAI_API_HOST=0.0.0.0
- DEBAI_API_PORT=8000
volumes:
- debai-config:/etc/debai
- debai-data:/var/lib/debai
- debai-logs:/var/log/debai
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- debai-network
ports:
- "8000:8000"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Docker Model Runner (Ollama)
debai-models:
image: ollama/ollama:latest
container_name: debai-models
restart: unless-stopped
environment:
- OLLAMA_HOST=0.0.0.0
volumes:
- debai-models:/root/.ollama
networks:
- debai-network
ports:
- "11434:11434"
deploy:
resources:
limits:
memory: 8G
reservations:
memory: 4G
# Uncomment for GPU support (NVIDIA)
# runtime: nvidia
# environment:
# - NVIDIA_VISIBLE_DEVICES=all
# Web GUI (Optional)
debai-gui:
build:
context: .
dockerfile: Dockerfile.gui
image: debai/gui:latest
container_name: debai-gui
restart: unless-stopped
depends_on:
- debai-core
environment:
- DEBAI_API_URL=http://debai-core:8000
networks:
- debai-network
ports:
- "8080:8080"
# Prometheus (Monitoring)
prometheus:
image: prom/prometheus:latest
container_name: debai-prometheus
restart: unless-stopped
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
networks:
- debai-network
ports:
- "9090:9090"
# Grafana (Dashboards)
grafana:
image: grafana/grafana:latest
container_name: debai-grafana
restart: unless-stopped
depends_on:
- prometheus
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-debai}
- GF_USERS_ALLOW_SIGN_UP=false
- GF_SERVER_ROOT_URL=http://localhost:3000
- GF_INSTALL_PLUGINS=
volumes:
- grafana-data:/var/lib/grafana
- ./grafana/provisioning:/etc/grafana/provisioning:ro
networks:
- debai-network
ports:
- "3000:3000"
# Redis (Optional - for caching and task queue)
redis:
image: redis:7-alpine
container_name: debai-redis
restart: unless-stopped
command: redis-server --appendonly yes
volumes:
- redis-data:/data
networks:
- debai-network
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
debai-config:
driver: local
debai-data:
driver: local
debai-logs:
driver: local
debai-models:
driver: local
prometheus-data:
driver: local
grafana-data:
driver: local
redis-data:
driver: local
networks:
debai-network:
driver: bridge
ipam:
config:
- subnet: 172.28.0.0/16

Ver fichero

@@ -6,7 +6,7 @@ This guide provides detailed instructions for installing Debai on your GNU/Linux
### System Requirements
- **Operating System**: Debian 12 (Bookworm) or newer, Ubuntu 22.04 or newer, or compatible
- **Operating System**: Debian 13 (Trixie) or newer, Ubuntu 24.04 or newer, or compatible
- **Python**: 3.10 or later
- **RAM**: 4GB minimum, 8GB recommended
- **Disk**: 10GB free space (more for AI models)
@@ -44,7 +44,7 @@ Download and install the `.deb` package:
```bash
# Download the latest release
wget https://github.com/debai/debai/releases/latest/download/debai_1.0.0-1_all.deb
wget https://github.com/manalejandro/debai/releases/latest/download/debai_1.0.0-1_all.deb
# Install
sudo dpkg -i debai_1.0.0-1_all.deb
@@ -85,7 +85,7 @@ pip install -e ".[gui,dev,docs]"
```bash
# Clone the repository
git clone https://github.com/debai/debai.git
git clone https://github.com/manalejandro/debai.git
cd debai
# Install build dependencies
@@ -225,7 +225,7 @@ pip install -r requirements.txt
```bash
# Download new version
wget https://github.com/debai/debai/releases/latest/download/debai_1.0.0-1_all.deb
wget https://github.com/manalejandro/debai/releases/latest/download/debai_1.0.0-1_all.deb
# Upgrade
sudo dpkg -i debai_1.0.0-1_all.deb
@@ -287,5 +287,5 @@ After installation:
## Getting Help
- 📚 [Documentation](https://debai.readthedocs.io)
- 🐛 [Issue Tracker](https://github.com/debai/debai/issues)
- 💬 [Discussions](https://github.com/debai/debai/discussions)
- 🐛 [Issue Tracker](https://github.com/manalejandro/debai/issues)
- 💬 [Discussions](https://github.com/manalejandro/debai/discussions)

Ver fichero

@@ -161,7 +161,7 @@ Command line syntax error.
.BR qemu-img (1),
.BR systemctl (1)
.SH BUGS
Report bugs at: https://github.com/debai/debai/issues
Report bugs at: https://github.com/manalejandro/debai/issues
.SH AUTHOR
Debai Team <debai@example.com>
.SH COPYRIGHT

Ver fichero

@@ -70,10 +70,10 @@ debai = "debai.cli:main"
debai-gui = "debai.gui:main"
[project.urls]
Homepage = "https://github.com/debai/debai"
Homepage = "https://github.com/manalejandro/debai"
Documentation = "https://debai.readthedocs.io"
Repository = "https://github.com/debai/debai.git"
Issues = "https://github.com/debai/debai/issues"
Repository = "https://github.com/manalejandro/debai.git"
"Bug Tracker" = "https://github.com/manalejandro/debai/issues"
Changelog = "https://github.com/debai/debai/blob/main/CHANGELOG.md"
[tool.setuptools.packages.find]

Ver fichero

@@ -32,7 +32,7 @@ class ISOGenerator:
self,
output_path: Path,
base_distro: str = "debian",
release: str = "bookworm",
release: str = "trixie",
arch: str = "amd64",
include_agents: bool = True,
include_gui: bool = True,

Ver fichero

@@ -32,7 +32,7 @@ class QCOW2Generator:
output_path: Path,
disk_size: str = "20G",
base_distro: str = "debian",
release: str = "bookworm",
release: str = "trixie",
arch: str = "amd64",
memory_mb: int = 2048,
cpus: int = 2,

Ver fichero

@@ -167,8 +167,8 @@ class DebaiApplication(Adw.Application):
version=__version__,
copyright="© 2025 Debai Team",
license_type=Gtk.License.GPL_3_0,
website="https://github.com/debai/debai",
issue_url="https://github.com/debai/debai/issues",
website="https://github.com/manalejandro/debai",
issue_url="https://github.com/manalejandro/debai/issues",
comments="AI Agent Management System for GNU/Linux",
developers=["Debai Team"],
)