- 
                Notifications
    
You must be signed in to change notification settings  - Fork 452
 
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
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,51 @@ | ||
| name: Build and Push Agent Image | ||
| 
     | 
||
| on: | ||
| push: | ||
| tags: | ||
| - "release-*" | ||
| 
     | 
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| 
     | 
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
| 
     | 
||
| - name: Set up Python environment | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.x" | ||
| 
     | 
||
| - name: Install BeeAI CLI | ||
| run: pip install beeai-cli | ||
| 
     | 
||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v2 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| 
     | 
||
| - name: Set up Docker | ||
| uses: docker/setup-docker-action@v4 | ||
| with: | ||
| daemon-config: '{"features": {"containerd-snapshotter": true}}' | ||
| 
     | 
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| 
     | 
||
| - name: Extract version from tag | ||
| id: extract_version | ||
| run: | | ||
| # Extract version from tag (e.g., release-1.2.3 -> 1.2.3) | ||
| VERSION=${GITHUB_REF#refs/tags/release-} | ||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
| 
     | 
||
| - name: Build and Push | ||
| run: | | ||
| beeai build ./ --tag ghcr.io/${{ github.repository }}/content-planner:${{ steps.extract_version.outputs.version }} --no-import --multi-platform --push --dockerfile ./samples/python/agents/content_planner/Dockerfile | 
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| FROM python:3.13-slim-trixie | ||
| 
     | 
||
| 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/* | ||
| 
     | 
||
| COPY --from=ghcr.io/astral-sh/uv:0.7.15 /uv /bin/ | ||
| 
     | 
||
| ENV UV_LINK_MODE=copy \ | ||
| PRODUCTION_MODE=true | ||
| 
         
      Comment on lines
    
      +10
     to 
      +11
    
   
  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. The environment variable   | 
||
| 
     | 
||
| COPY samples/python/agents/content_planner/ /app | ||
| WORKDIR /app | ||
| 
     | 
||
| RUN uv sync --no-cache --locked --link-mode copy | ||
| 
         
      Comment on lines
    
      +13
     to 
      +16
    
   
  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. To better leverage Docker's layer caching, you should first copy only the dependency-related files (  | 
||
| 
     | 
||
| ENV PRODUCTION_MODE=True \ | ||
| PATH="/app/.venv/bin:$PATH" \ | ||
| HOME=/tmp | ||
| 
     | 
||
| # 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 commentThe reason will be displayed to describe this comment to others. Learn more. The  You can achieve this by: 
  | 
||
| echo 'wait' >> /app/start.sh && \ | ||
| chmod +x /app/start.sh | ||
| 
     | 
||
| EXPOSE 8000 | ||
| 
     | 
||
| CMD ["/bin/bash", "/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.
To minimize the Docker image size, it's a good practice to use the
--no-install-recommendsflag withapt-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.