-
Notifications
You must be signed in to change notification settings - Fork 6
Add docker-compose setup for local development #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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"] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we utilize the existing |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need a specific env file for the Docker setup? Couldn't we just use the example env file like this: That way we'd only need to update one example file when introducing new variables, not two files.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1, and note that LLM provider credentials are needed for the agent to work |
||
| ``` | ||
|
|
||
| 2. **Start the Stack** | ||
| ```bash | ||
| docker-compose up -d --build | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe |
||
| ``` | ||
|
|
||
| 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 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could we also add the MCP server: https://github.com/opensearch-project/opensearch-mcp-server-py as it is required by agent server? Ok to address in another PR too.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that opensearch-mcp-server-py does not have an official Docker image yet but we can start it with |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we can use
uvas the package manager: https://docs.astral.sh/uv/guides/integration/docker/