-
Couldn't load subscription status.
- Fork 445
Beeai integration #394
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
Beeai integration #394
Conversation
Summary of ChangesHello @tomkis, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new Dockerfile for the Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a Dockerfile for the content planner agent. My review focuses on improving the Dockerfile by applying best practices for security, image size optimization, build caching, and reproducibility. The suggested changes will lead to a more efficient and robust container image.
| ENV UV_LINK_MODE=copy \ | ||
| PRODUCTION_MODE=true |
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.
The environment variable PRODUCTION_MODE is set here and then again on line 18. This is redundant, and the second declaration will overwrite the first. To avoid confusion and keep the Dockerfile clean, you should set this variable only once. I recommend removing this declaration and only keeping the one on line 18.
ENV UV_LINK_MODE=copy
| COPY samples/python/agents/content_planner/ /app | ||
| WORKDIR /app | ||
|
|
||
| RUN uv sync --no-cache --locked --link-mode copy |
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.
To better leverage Docker's layer caching, you should first copy only the dependency-related files (pyproject.toml and uv.lock) and install the dependencies before copying the rest of the application source code. This way, Docker won't need to reinstall all dependencies every time you make a change to your source code, which will significantly speed up your builds.
WORKDIR /app
COPY samples/python/agents/content_planner/pyproject.toml samples/python/agents/content_planner/uv.lock ./
RUN uv sync --no-cache --locked --link-mode copy
COPY samples/python/agents/content_planner/ .
| # Create a startup script | ||
| RUN echo '#!/bin/bash' > /app/start.sh && \ | ||
| echo 'uv run . &' >> /app/start.sh && \ | ||
| echo 'npx --yes tomkis/beeai-a2a-proxy start -p 8000 -r GOOGLE_API_KEY &' >> /app/start.sh && \ |
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.
The npx --yes tomkis/beeai-a2a-proxy command downloads and runs the proxy every time the container starts. This can introduce startup delays and makes your container's behavior dependent on network availability and the state of the npm registry. For better performance and reproducibility, it's recommended to install this tool during the image build process.
You can achieve this by:
- Adding
npm install -g tomkis/beeai-a2a-proxyto your package installationRUNstep (e.g., on line 5). - Changing this line to call the globally installed proxy directly.
echo 'beeai-a2a-proxy start -p 8000 -r GOOGLE_API_KEY &' >> /app/start.sh && \
| RUN apt-get update && apt-get install -y curl git && \ | ||
| curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ | ||
| apt-get install -y nodejs && \ | ||
| apt-get clean && rm -rf /var/lib/apt/lists/* |
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.
To minimize the Docker image size, it's a good practice to use the --no-install-recommends flag with apt-get install. This prevents the installation of packages that are only "recommended" and not strictly "depended" upon, which are often not needed and can increase the image size unnecessarily.
RUN apt-get update && apt-get install -y --no-install-recommends curl git && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y --no-install-recommends nodejs && \
apt-get clean && rm -rf /var/lib/apt/lists/*
No description provided.