Sync reqs#578
Conversation
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
There was a problem hiding this comment.
Code Review
This pull request refactors dependency management across multiple Containerfiles by extracting hardcoded pip packages into dedicated requirements files and copying them during the build process. However, two critical issues were identified: in Containerfile.supervisor, build tools are uninstalled before pip3 install runs in a separate layer, which will cause compilation failures; and in Containerfile.tests, the fastmcp package was accidentally omitted during the refactoring, leading to a missing dependency error.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| 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 |
There was a problem hiding this comment.
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
| # 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 |
There was a problem hiding this comment.
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
The requirements installed by pip were defined inside container files. Updating them required modification of multiple files at the same time, keeping track of changes to avoid drift. In the worst case scenario, forgetting to update test container, while updating production container, could result in bugs moving undetected into production.
This PR factors out all dependencies into separate requirements files, which are then used across containers.
For example, the Centos 9 test container file, uses
requirements-base.txt,requirements-agent.txtandrequirements-test.txt. While building the image, both files are copied inside/tmpand dependencies are installed usingpip -r.When one needs to update agent dependencies across all containers, it is enough to change
requirements-agent.txt, and all containers will use new dependency list.Additional changes: