File tree Expand file tree Collapse file tree 5 files changed +68
-1
lines changed Expand file tree Collapse file tree 5 files changed +68
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ PATH := $(PATH):$(HOME)/.local/bin
10
10
IMAGE ?= ramalama
11
11
PYTHON_FILES := $(shell find . -path "./.venv" -prune -o -name "* .py" -print) $(shell find . -name ".venv" -prune -o -type f -perm +111 -exec grep -l "^\#!/usr/bin/env python3" {} \; 2>/dev/null || true)
12
12
PYTEST_COMMON_CMD ?= PYTHONPATH=. pytest test/unit/ -vv
13
+ BATS_IMAGE ?= localhost/bats:latest
13
14
14
15
default : help
15
16
@@ -161,6 +162,30 @@ bats-nocontainer:
161
162
bats-docker :
162
163
_RAMALAMA_TEST_OPTS=--engine=docker RAMALAMA=$(CURDIR ) /bin/ramalama bats -T test/system/
163
164
165
+ .PHONY : bats-image
166
+ bats-image :
167
+ podman inspect $(BATS_IMAGE ) & > /dev/null || \
168
+ podman build -t $(BATS_IMAGE ) container-images/bats
169
+
170
+ .PHONY : bats-in-container
171
+ bats-in-container : bats-image
172
+ podman run -it --rm \
173
+ --userns=keep-id:size=200000 \
174
+ --security-opt unmask=/proc/* \
175
+ --security-opt label=disable \
176
+ --security-opt=mask=/sys/bus/pci/drivers/i915 \
177
+ --device /dev/net/tun \
178
+ -v $(CURDIR ) :/src \
179
+ $(BATS_IMAGE ) make bats
180
+
181
+ .PHONY : bats-nocontainer-in-container
182
+ bats-nocontainer-in-container : bats-image
183
+ podman run -it --rm \
184
+ --userns=keep-id:size=200000 \
185
+ --security-opt=mask=/sys/bus/pci/drivers/i915 \
186
+ -v $(CURDIR ) :/src \
187
+ $(BATS_IMAGE ) make bats-nocontainer
188
+
164
189
.PHONY : ci
165
190
ci :
166
191
test/ci.sh
Original file line number Diff line number Diff line change
1
+ FROM quay.io/fedora/fedora:42
2
+
3
+ ENV HOME=/tmp \
4
+ XDG_RUNTIME_DIR=/tmp \
5
+ STORAGE_DRIVER=vfs
6
+ WORKDIR /src
7
+ ENTRYPOINT ["/usr/bin/entrypoint.sh" ]
8
+
9
+ RUN dnf -y install make bats jq iproute podman openssl httpd-tools \
10
+ ollama python3-huggingface-hub \
11
+ # for building llama-bench
12
+ git-core cmake gcc-c++ curl-devel && \
13
+ dnf -y clean all
14
+ RUN rpm --restore shadow-utils
15
+ RUN git clone --depth=1 https://github.com/ggml-org/llama.cpp && \
16
+ pushd llama.cpp && \
17
+ cmake -B build -DGGML_NATIVE=OFF -DGGML_RPC=ON -DGGML_CCACHE=OFF -DGGML_CMAKE_BUILD_TYPE=Release -DLLAMA_CURL=ON -DCMAKE_INSTALL_PREFIX=/usr && \
18
+ cmake --build build --config Release --parallel $(nproc) && \
19
+ cmake --install build && \
20
+ popd && rm -rf llama.cpp
21
+
22
+ COPY entrypoint.sh /usr/bin
23
+ COPY containers.conf /etc/containers
24
+ RUN chmod a+rw /etc/subuid /etc/subgid
Original file line number Diff line number Diff line change
1
+ [containers]
2
+ utsns="host"
3
+ cgroups="disabled"
4
+ log_driver="k8s-file"
5
+
6
+ [engine]
7
+ events_logger="file"
8
+ infra_image="quay.io/libpod/k8s-pause:3.5"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ echo $( id -u) :10000:100000 > /etc/subuid
4
+ echo $( id -g) :10000:100000 > /etc/subgid
5
+
6
+ if [ $# -gt 0 ]; then
7
+ exec " $@ "
8
+ else
9
+ exec /bin/bash
10
+ fi
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ build() {
116
116
echo " ${conman_show_size[@]} "
117
117
" ${conman_show_size[@]} "
118
118
case ${target} in
119
- ramalama-cli | llama-stack | openvino)
119
+ ramalama-cli | llama-stack | openvino | bats )
120
120
;;
121
121
* )
122
122
add_entrypoints " ${conman[@]} " " ${REGISTRY_PATH} " /" ${target} " " ${version} "
You can’t perform that action at this time.
0 commit comments