Skip to content
Merged
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
35 changes: 35 additions & 0 deletions .github/workflows/check-in-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Check BeeAI agents in container

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
check-in-container:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: check-agents-in-container
- target: check-mcp-server-in-container
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Podman
run: |
sudo apt-get update
sudo apt-get install -y podman
podman --version
- name: Build test image from Containerfile.tests
run: |
podman build --rm --tag beeai-tests -f Containerfile.tests ./beeai
- name: Run ${{ matrix.target }} target
env:
CONTAINER_ENGINE: podman
TEST_IMAGE: beeai-tests
working-directory: beeai/
run: make ${{ matrix.target }}
5 changes: 4 additions & 1 deletion beeai/Containerfile.tests
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ RUN dnf -y install \
python3-specfile \
&& dnf clean all

RUN git config --global user.email "jotnar-tests@example.com" \
&& git config --global user.name "Jotnar Tests"
Comment on lines +16 to +17
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

These git config commands will fail because the git command-line tool is not installed in the container. The dnf install command on lines 4-14 is missing the git-core package. This will cause the container build to fail. Please add git-core to the list of packages to be installed.

Copy link
Member Author

Choose a reason for hiding this comment

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

you are partially right but one of the packages brings it as a dep


# Install BeeAI Framework and FastMCP
RUN pip3 install --no-cache-dir beeai-framework fastmcp
RUN pip3 install --no-cache-dir beeai-framework fastmcp redis

WORKDIR /src
6 changes: 5 additions & 1 deletion beeai/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ clean:
build-test-image:
$(MAKE) -f Makefile.tests build-test-image

.PHONY: check-in-container
.PHONY: check-in-container check-agents-in-container check-mcp-server-in-container
check-in-container:
$(MAKE) -f Makefile.tests check-in-container
check-agents-in-container:
$(MAKE) -f Makefile.tests check-agents-in-container
check-mcp-server-in-container:
$(MAKE) -f Makefile.tests check-mcp-server-in-container
16 changes: 10 additions & 6 deletions beeai/Makefile.tests
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ CONTAINER_ENGINE ?= $(shell command -v podman 2>/dev/null || echo "docker")
build-test-image:
$(CONTAINER_ENGINE) build --rm --tag $(TEST_IMAGE) -f Containerfile.tests

.PHONY: check
check:
.PHONY: check check-agents check-mcp-server check-in-container check-agents-in-container check-mcp-server-in-container
check-agents:
cd ./agents && \
PYTHONPATH=$(CURDIR) PYTHONDONTWRITEBYTECODE=1 python3 -m pytest --verbose --showlocals $(TEST_TARGET) || true
PYTHONPATH=$(CURDIR) PYTHONDONTWRITEBYTECODE=1 python3 -m pytest --verbose --showlocals $(TEST_TARGET)
check-mcp-server:
cd ./mcp_server && \
PYTHONPATH=$(CURDIR) PYTHONDONTWRITEBYTECODE=1 python3 -m pytest --verbose --showlocals $(TEST_TARGET)
check: check-agents check-mcp-server

.PHONY: check-in-container
check-in-container:
$(CONTAINER_ENGINE) run --rm -it -v $(CURDIR):/src:z --env TEST_TARGET $(TEST_IMAGE) make -f Makefile.tests check
check-agents-in-container:
$(CONTAINER_ENGINE) run --rm -it -v $(CURDIR):/src:z --env TEST_TARGET $(TEST_IMAGE) make -f Makefile.tests check-agents
check-mcp-server-in-container:
$(CONTAINER_ENGINE) run --rm -it -v $(CURDIR):/src:z --env TEST_TARGET $(TEST_IMAGE) make -f Makefile.tests check-mcp-server
Comment on lines +20 to +22
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The -it flags for $(CONTAINER_ENGINE) run are intended for interactive sessions that require a TTY. In a non-interactive CI environment, these flags are unnecessary and can cause issues or warnings. It's recommended to remove them for CI jobs.

	$(CONTAINER_ENGINE) run --rm -v $(CURDIR):/src:z --env TEST_TARGET $(TEST_IMAGE) make -f Makefile.tests check-agents
check-mcp-server-in-container:
	$(CONTAINER_ENGINE) run --rm -v $(CURDIR):/src:z --env TEST_TARGET $(TEST_IMAGE) make -f Makefile.tests check-mcp-server

Copy link
Member Author

Choose a reason for hiding this comment

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

nah, we get colors with these flags

check-in-container: check-agents-in-container check-mcp-server-in-container