Skip to content

Commit 2ac9fb6

Browse files
authored
Merge branch 'main' into patch-1
2 parents 68c6a1c + f3d8929 commit 2ac9fb6

25 files changed

Lines changed: 1630 additions & 1385 deletions

.github/workflows/checkstyle.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Check formatting
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Install uv
18+
run: |
19+
curl -LsSf https://astral.sh/uv/install.sh | sh
20+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.13'
26+
27+
- name: Check formatting
28+
id: check-formatting
29+
run: |
30+
uv run black --check --diff src/ tests/ || \
31+
echo -e "Formatting check failed. Please run 'uv run black src/ tests/' to fix."

.github/workflows/docker.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Docker Image builder
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
- name: Build container
16+
uses: docker/build-push-action@v5
17+
with:
18+
context: .
19+
push: false
20+
tags: dremio-mcp-server:${{ github.sha }}
21+
- name: Validate docker
22+
run: |
23+
docker run -e TOOLS_MODE=FOR_DATA_PATTERNS \
24+
-e DREMIO_URI=https://fake \
25+
-e DREMIO_OAUTH_SUPPORTED=false \
26+
dremio-mcp-server:${{ github.sha }} \
27+
dremio-mcp-server tools list
28+
- name: Install uv
29+
run: |
30+
curl -LsSf https://astral.sh/uv/install.sh | sh
31+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
32+
33+
- name: Set up Python
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: '3.13'
37+
38+
- name: Start container
39+
run: |
40+
docker run -e TOOLS_MODE=FOR_DATA_PATTERNS \
41+
-e DREMIO_URI=https://fake \
42+
-e DREMIO_OAUTH_SUPPORTED=false \
43+
-p 6789:6789 \
44+
--name mcp --rm \
45+
--network host \
46+
dremio-mcp-server:${{ github.sha }} \
47+
dremio-mcp-server run --enable-streaming-http --port 6789 --no-log-to-file \
48+
--enable-json-logging &
49+
50+
- name: Test container
51+
run: |
52+
uv run python tests/stremable_http_cli.py --url http://127.0.0.1:6789/mcp --token fake
53+
54+
- name: Stop container
55+
run: |
56+
docker stop mcp
57+

Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Build stage
2+
FROM python:3.13-slim AS builder
3+
4+
ENV PYTHONUNBUFFERED=1 \
5+
PYTHONDONTWRITEBYTECODE=1 \
6+
PIP_NO_CACHE_DIR=1
7+
8+
WORKDIR /build
9+
10+
# Copy project files
11+
COPY pyproject.toml README.md ./
12+
COPY src/ ./src/
13+
14+
# Build wheel
15+
RUN pip install --upgrade pip build && \
16+
python -m build --wheel --outdir /dist
17+
18+
# Runtime stage
19+
FROM python:3.13-slim
20+
21+
ENV PYTHONUNBUFFERED=1 \
22+
PYTHONDONTWRITEBYTECODE=1
23+
24+
# Create non-root user
25+
RUN useradd -m -u 1001 appuser
26+
27+
WORKDIR /app
28+
29+
# Copy wheel from builder
30+
COPY --from=builder /dist/*.whl /tmp/
31+
32+
# Install the wheel and dependencies
33+
RUN pip install --no-cache-dir /tmp/*.whl && \
34+
rm /tmp/*.whl
35+
36+
USER 1001
37+
38+
# Console script is now properly installed
39+
CMD ["dremio-mcp-server", "run"]

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ requires-python = ">=3.11"
1111
dependencies = [
1212
"aiohttp>=3.11.12",
1313
"beeai-framework>=0.1.8",
14+
"black>=25.1.0",
1415
"click>=8.1.8",
1516
"fastapi>=0.115.11",
1617
"langchain>=0.3.20",
@@ -20,8 +21,10 @@ dependencies = [
2021
"langchain-openai>=0.3.7",
2122
"langgraph>=0.3.12",
2223
"mcp>=1.9.4",
24+
"multidict>=6.4.0",
2325
"openai>=1.65.3",
2426
"pandas>=2.2.3",
27+
"pandas-stubs==2.3.0.250703",
2528
"prompt-toolkit>=3.0.50",
2629
"pydantic>=2.10.6",
2730
"pydantic-settings>=2.8.1",

src/dremioai/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
#
1+
#
22
# Copyright (C) 2017-2025 Dremio Corporation
3-
#
3+
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
66
# You may obtain a copy of the License at
7-
#
7+
#
88
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
9+
#
1010
# Unless required by applicable law or agreed to in writing, software
1111
# distributed under the License is distributed on an "AS IS" BASIS,
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
#
15+
#

src/dremioai/api/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
#
1+
#
22
# Copyright (C) 2017-2025 Dremio Corporation
3-
#
3+
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
66
# You may obtain a copy of the License at
7-
#
7+
#
88
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
9+
#
1010
# Unless required by applicable law or agreed to in writing, software
1111
# distributed under the License is distributed on an "AS IS" BASIS,
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
#
15+
#
1616

1717
import sys
1818
import os

src/dremioai/api/cli/__init__.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
#
1+
#
22
# Copyright (C) 2017-2025 Dremio Corporation
3-
#
3+
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
66
# You may obtain a copy of the License at
7-
#
7+
#
88
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
9+
#
1010
# Unless required by applicable law or agreed to in writing, software
1111
# distributed under the License is distributed on an "AS IS" BASIS,
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
#
16-
15+
#

src/dremioai/api/cli/engines.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
#
1+
#
22
# Copyright (C) 2017-2025 Dremio Corporation
3-
#
3+
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
66
# You may obtain a copy of the License at
7-
#
7+
#
88
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
9+
#
1010
# Unless required by applicable law or agreed to in writing, software
1111
# distributed under the License is distributed on an "AS IS" BASIS,
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
#
15+
#
1616

1717
from typing import Annotated, Optional, List
1818
from typer import Option, Argument, Typer

src/dremioai/api/cli/prometheus.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
#
1+
#
22
# Copyright (C) 2017-2025 Dremio Corporation
3-
#
3+
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
66
# You may obtain a copy of the License at
7-
#
7+
#
88
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
9+
#
1010
# Unless required by applicable law or agreed to in writing, software
1111
# distributed under the License is distributed on an "AS IS" BASIS,
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
#
15+
#
1616

1717
from typing import Annotated, Optional, List
1818
from typer import Option, Argument, Typer, BadParameter
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
#
1+
#
22
# Copyright (C) 2017-2025 Dremio Corporation
3-
#
3+
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
66
# You may obtain a copy of the License at
7-
#
7+
#
88
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
9+
#
1010
# Unless required by applicable law or agreed to in writing, software
1111
# distributed under the License is distributed on an "AS IS" BASIS,
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
#
16-
15+
#

0 commit comments

Comments
 (0)