1
0
mirror of https://github.com/containers/ramalama.git synced 2026-02-05 15:47:26 +01:00

support running all Makefile targets in the bats container

Signed-off-by: Mike Bonnet <mikeb@redhat.com>
This commit is contained in:
Mike Bonnet
2025-06-25 11:07:42 -07:00
parent a651be7832
commit 4f479484de
2 changed files with 9 additions and 13 deletions

View File

@@ -167,24 +167,16 @@ bats-image:
podman inspect $(BATS_IMAGE) &> /dev/null || \ podman inspect $(BATS_IMAGE) &> /dev/null || \
podman build -t $(BATS_IMAGE) -f container-images/bats/Containerfile . podman build -t $(BATS_IMAGE) -f container-images/bats/Containerfile .
.PHONY: bats-in-container bats-in-container: extra-opts = --security-opt unmask=/proc/* --device /dev/net/tun
bats-in-container: bats-image
%-in-container: bats-image
podman run -it --rm \ podman run -it --rm \
--userns=keep-id:size=200000 \ --userns=keep-id:size=200000 \
--security-opt unmask=/proc/* \
--security-opt label=disable \ --security-opt label=disable \
--security-opt=mask=/sys/bus/pci/drivers/i915 \ --security-opt=mask=/sys/bus/pci/drivers/i915 \
--device /dev/net/tun \ $(extra-opts) \
-v $(CURDIR):/src \ -v $(CURDIR):/src \
$(BATS_IMAGE) make bats $(BATS_IMAGE) make $*
.PHONY: bats-nocontainer-in-container
bats-nocontainer-in-container: bats-image
podman run -it --rm \
--userns=keep-id:size=200000 \
--security-opt=mask=/sys/bus/pci/drivers/i915 \
-v $(CURDIR):/src \
$(BATS_IMAGE) make bats-nocontainer
.PHONY: ci .PHONY: ci
ci: ci:

View File

@@ -8,6 +8,10 @@ ENTRYPOINT ["/usr/bin/entrypoint.sh"]
RUN dnf -y install make bats jq iproute podman openssl httpd-tools \ RUN dnf -y install make bats jq iproute podman openssl httpd-tools \
ollama python3-huggingface-hub \ ollama python3-huggingface-hub \
# for validate and unit-tests
black codespell shellcheck \
python3-flake8 python3-isort python3-pip python3-pytest \
perl-Clone perl-FindBin \
# for building llama-bench # for building llama-bench
git-core cmake gcc-c++ curl-devel && \ git-core cmake gcc-c++ curl-devel && \
dnf -y clean all dnf -y clean all