Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions Containerfile.c10s
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,11 @@ RUN dnf -y install --allowerasing \
COPY beeai-reasoning.patch /tmp
COPY openinference-reasoning.patch /tmp

# Copy dependency files
COPY requirements-base.txt requirements-agent.txt /tmp/

RUN pip3 install --no-cache-dir \
"litellm!=1.82.7,!=1.82.8" \
beeai-framework[vertexai,mcp,duckduckgo]==0.1.80 \
google-cloud-aiplatform \
openinference-instrumentation-beeai \
arize-phoenix-otel \
redis \
specfile \
pytest \
pytest-asyncio \
GitPython>=3.1.0 \
unidiff \
sentry-sdk>=2.13.0 \
-r /tmp/requirements-agent.txt \
&& cd /usr/local/lib/python3.12/site-packages \
&& patch -p2 -i /tmp/beeai-reasoning.patch \
&& patch -p5 -i /tmp/openinference-reasoning.patch
Expand Down
15 changes: 4 additions & 11 deletions Containerfile.c9s
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,14 @@ RUN dnf -y install --allowerasing \
COPY beeai-reasoning.patch /tmp
COPY openinference-reasoning.patch /tmp

# Copy dependency files
COPY requirements-base.txt requirements-agent.txt /tmp/

# Create Python 3.11 virtual environment and install Python packages
RUN python3.11 -m venv --system-site-packages /opt/beeai-venv \
&& /opt/beeai-venv/bin/pip install --upgrade pip \
&& /opt/beeai-venv/bin/pip install --no-cache-dir \
"litellm!=1.82.7,!=1.82.8" \
beeai-framework[vertexai,mcp,duckduckgo]==0.1.80 \
google-cloud-aiplatform \
openinference-instrumentation-beeai \
arize-phoenix-otel \
redis \
specfile \
koji \
GitPython>=3.1.0 \
unidiff \
sentry-sdk>=2.13.0 \
-r /tmp/requirements-agent.txt \
&& cd /opt/beeai-venv/lib/python3.11/site-packages \
&& patch -p2 -i /tmp/beeai-reasoning.patch \
&& patch -p5 -i /tmp/openinference-reasoning.patch
Expand Down
17 changes: 4 additions & 13 deletions Containerfile.c9s-tests
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,14 @@ RUN dnf -y install --allowerasing \
python3.11-devel \
&& dnf clean all

# Copy dependency files
COPY requirements-base.txt requirements-test.txt /tmp/

# Create Python 3.11 virtual environment and install Python packages
RUN python3.11 -m venv --system-site-packages /opt/beeai-venv \
&& /opt/beeai-venv/bin/pip install --upgrade pip \
&& /opt/beeai-venv/bin/pip install --no-cache-dir \
"litellm!=1.82.7,!=1.82.8" \
beeai-framework[vertexai,mcp,duckduckgo]==0.1.79 \
openinference-instrumentation-beeai \
arize-phoenix-otel \
aiohttp \
redis \
specfile \
pytest \
pytest-asyncio \
flexmock \
koji \
GitPython \
tomli-w
-r /tmp/requirements-test.txt

# Verify no malicious litellm_init.pth was introduced by compromised litellm packages (e.g. 1.82.7, 1.82.8)
RUN MALICIOUS=$(find /usr /opt -name "litellm_init.pth" 2>/dev/null); \
Expand Down
5 changes: 4 additions & 1 deletion Containerfile.mcp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ RUN dnf -y install \
${EXTRA_PACKAGES} \
&& dnf clean all

# Copy dependency files
COPY requirements-mcp.txt /tmp/

# Install beeai mcp server
RUN pip3 install --no-cache-dir "litellm!=1.82.7,!=1.82.8" beeai-framework[mcp]==0.1.80 "specfile>=0.36.0"
RUN pip3 install --no-cache-dir -r /tmp/requirements-mcp.txt

# Create user
RUN useradd -m -G wheel mcp
Expand Down
15 changes: 7 additions & 8 deletions Containerfile.supervisor
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,16 @@ RUN dnf -y install --allowerasing \
gcc \
gcc-c++ \
python3-devel \
&& pip3 install -v --no-cache-dir \
"litellm!=1.82.7,!=1.82.8" \
beeai-framework[vertexai,mcp,duckduckgo]==0.1.79 \
google-cloud-aiplatform \
openinference-instrumentation-beeai \
arize-phoenix-otel \
redis \
specfile \
&& dnf -y remove gcc gcc-c++ python3-devel \
&& dnf clean all

# Copy dependency files
COPY requirements-base.txt requirements-supervisor.txt /tmp/

# Install remaining dependencies using pip
RUN pip3 install -v --no-cache-dir \
-r /tmp/requirements-supervisor.txt
Comment on lines 25 to +36

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The build dependencies (gcc, gcc-c++, python3-devel) are currently installed and immediately removed in the first RUN instruction, before pip3 install is executed in a separate layer. This means these build tools are not available when pip3 install runs, which will cause installation failures if any package or its dependencies require compilation. Additionally, installing and removing them in the first layer without using them is redundant.

To fix this, we should copy the requirements files first, and then install the build tools, run pip3 install, and clean them up all within the same RUN instruction to keep the image size small.

    && dnf clean all

# Copy dependency files
COPY requirements-base.txt requirements-supervisor.txt /tmp/

# Install remaining dependencies using pip (with temporary build tools)
RUN dnf -y install --allowerasing gcc gcc-c++ python3-devel \
    && pip3 install -v --no-cache-dir -r /tmp/requirements-supervisor.txt \
    && dnf -y remove gcc gcc-c++ python3-devel \
    && dnf clean all


# Verify no malicious litellm_init.pth was introduced by compromised litellm packages (e.g. 1.82.7, 1.82.8)
RUN MALICIOUS=$(find /usr /opt -name "litellm_init.pth" 2>/dev/null); \
if [ -n "$MALICIOUS" ]; then \
Expand Down
9 changes: 5 additions & 4 deletions Containerfile.tests
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ RUN git config --global user.email "ymir-tests@example.com" \
# Set PYTHONPATH so ymir namespace package can be imported
ENV PYTHONPATH=/src:$PYTHONPATH

# Install BeeAI Framework and FastMCP
# Copy dependency file
COPY requirements-base.txt /tmp/

# Install BeeAI Framework
RUN pip3 install --no-cache-dir \
"litellm!=1.82.7,!=1.82.8" \
beeai-framework[vertexai,mcp,duckduckgo]==0.1.79 \
fastmcp redis backoff
-r /tmp/requirements-base.txt
Comment on lines +34 to +36

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

fastmcp was removed from the pip3 install command but is not included in requirements-base.txt or system packages. This will lead to a ModuleNotFoundError when running tests that depend on fastmcp.

We should add fastmcp back to the pip3 install command.

# Install BeeAI Framework and FastMCP
RUN pip3 install --no-cache-dir \
      -r /tmp/requirements-base.txt \
      fastmcp


# Verify no malicious litellm_init.pth was introduced by compromised litellm packages (e.g. 1.82.7, 1.82.8)
RUN MALICIOUS=$(find /usr /opt -name "litellm_init.pth" 2>/dev/null); \
Expand Down
8 changes: 8 additions & 0 deletions requirements-agent.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Agent container dependencies (c9s, c10s)
-r requirements-base.txt
google-cloud-aiplatform
aiohttp>=3.12.15
koji
GitPython>=3.1.0
unidiff
sentry-sdk>=2.13.0
8 changes: 8 additions & 0 deletions requirements-base.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Shared pip dependencies for all containers (except MCP)
# Prevent installation of compromised litellm package versions
litellm!=1.82.7,!=1.82.8
beeai-framework[vertexai,mcp,duckduckgo]==0.1.80
openinference-instrumentation-beeai
arize-phoenix-otel
redis>=6.4.0
specfile>=0.36.0
4 changes: 4 additions & 0 deletions requirements-mcp.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Dependencies for the MCP gateway container (beeai[mcp] only, no vertexai/duckduckgo)
litellm!=1.82.7,!=1.82.8
beeai-framework[mcp]==0.1.80
specfile>=0.36.0
3 changes: 3 additions & 0 deletions requirements-supervisor.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Supervisor container dependencies
-r requirements-base.txt
google-cloud-aiplatform
9 changes: 9 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# c9s test container dependencies
-r requirements-base.txt
aiohttp>=3.12.15
koji
GitPython>=3.1.0
pytest
pytest-asyncio
flexmock>=0.12.2
tomli-w
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Dependencies specific to the root ymir package
ymir-common
ymir-tools
# Note: ymir-common and ymir-tools are workspace packages (not on PyPI).
# They are resolved by uv via [tool.uv.sources] in pyproject.toml.
# For development setup, use: uv sync
litellm!=1.82.7,!=1.82.8
aiohttp>=3.12.15
arize-phoenix-otel>=0.13.0
beautifulsoup4>=4.13.4
beeai-framework[duckduckgo]
beeai-framework[duckduckgo]==0.1.80
copr>=1.129
fastmcp>=2.11.3
ogr>=0.55.0
Expand Down
Loading