diff --git a/.env.docker b/.env.docker new file mode 100644 index 0000000..2e9f6f2 --- /dev/null +++ b/.env.docker @@ -0,0 +1,20 @@ +# OpenSearch Connection +OPENSEARCH_URL=http://opensearch:9200 +OPENSEARCH_USERNAME=admin +OPENSEARCH_PASSWORD=Admin1234! + +# Authentication (disable for local development) +AG_UI_AUTH_ENABLED=false + +# CORS +AG_UI_CORS_ORIGINS=http://localhost:5601 + +# Logging +AG_UI_LOG_FORMAT=human +AG_UI_LOG_LEVEL=INFO + +# OS MCP Server +MCP_SERVER_URL=http://agent-server:9900/mcp + +# Prevent timeouts for longer running sub-agents +AG_UI_MAX_CONSECUTIVE_TIMEOUTS=18000 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0901a01 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.12-slim +WORKDIR /app + +# Install git for potentially pulling dependencies, and build requirements +RUN apt-get update && apt-get install -y git build-essential && rm -rf /var/lib/apt/lists/* + +# Copy project files +COPY . . + +# Install dependencies including the server package +RUN pip install --no-cache-dir -e . + +# Expose the application port +EXPOSE 8001 + +# Run the server +CMD ["uvicorn", "server.ag_ui_app:app", "--host", "0.0.0.0", "--port", "8001"] diff --git a/README.md b/README.md index 254d5cb..12b7894 100644 --- a/README.md +++ b/README.md @@ -102,9 +102,37 @@ AG_UI_LOG_LEVEL=INFO ## Quick Start -### Complete Setup (3-Component Stack) +### Complete Setup (Docker Compose) - Recommended -To run the full demo with OpenSearch, Agent Server, and Dashboards: +The easiest way to run the full 3-component stack (OpenSearch, Agent Server, and Dashboards) is using Docker Compose. + +1. **Configure Environment** + ```bash + cp .env.docker .env.docker # Note: Edit this if you need to add LLM provider credentials + ``` + +2. **Start the Stack** + ```bash + docker-compose up -d --build + ``` + +3. **Verify Health** + ```bash + # Check Agent Server health + curl http://localhost:8001/health + + # Check if Dashboards is up (it may take a minute) + curl -I http://localhost:5601 + ``` + +4. **Access the Chat** + - Open http://localhost:5601 + - Click the chat icon (💬) in the top-right header + - Start asking questions about your data! + +### Manual Setup (Option 2) + +To run the components individually: **Terminal 1 - OpenSearch** ```bash diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5a7ec79 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,48 @@ +version: '3.8' + +services: + opensearch: + image: opensearchproject/opensearch:latest + environment: + - discovery.type=single-node + - OPENSEARCH_INITIAL_ADMIN_PASSWORD=Admin1234! + - "DISABLE_SECURITY_PLUGIN=true" + ports: + - "9200:9200" + - "9600:9600" + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:9200 || exit 1"] + interval: 10s + timeout: 5s + retries: 5 + + agent-server: + build: . + env_file: .env.docker + environment: + - OPENSEARCH_URL=http://opensearch:9200 + ports: + - "8001:8001" + depends_on: + opensearch: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8001/health"] + interval: 10s + timeout: 5s + retries: 5 + + opensearch-dashboards: + image: opensearchproject/opensearch-dashboards:latest + ports: + - "5601:5601" + environment: + - OPENSEARCH_HOSTS=["http://opensearch:9200"] + - "DISABLE_SECURITY_DASHBOARDS_PLUGIN=true" + volumes: + - ./opensearch_dashboards.docker.yml:/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml + depends_on: + opensearch: + condition: service_healthy + agent-server: + condition: service_started diff --git a/opensearch_dashboards.docker.yml b/opensearch_dashboards.docker.yml new file mode 100644 index 0000000..c5ae387 --- /dev/null +++ b/opensearch_dashboards.docker.yml @@ -0,0 +1,15 @@ +server.host: "0.0.0.0" +opensearch.hosts: ["http://opensearch:9200"] +opensearch.ssl.verificationMode: none + +# OpenSearch Agent Server Integration +uiSettings: + overrides: + "home:useNewHomePage": true + +contextProvider: + enabled: true + +chat: + enabled: true + agUiUrl: "http://localhost:8001/runs"