From 4e2fcbe1e6af482fe91c16654b30037cfb2f62c9 Mon Sep 17 00:00:00 2001 From: Eric Curtin Date: Tue, 22 Oct 2024 14:21:48 +0100 Subject: [PATCH] Add vulkan image and show size Add this image, we also want to see the size of this image in the build. Co-authored-by: Steffen Roecker Signed-off-by: Eric Curtin --- container-images/vulkan/Containerfile | 23 +++++++++++++++++++++++ container_build.sh | 4 ++++ 2 files changed, 27 insertions(+) create mode 100644 container-images/vulkan/Containerfile diff --git a/container-images/vulkan/Containerfile b/container-images/vulkan/Containerfile new file mode 100644 index 00000000..96719007 --- /dev/null +++ b/container-images/vulkan/Containerfile @@ -0,0 +1,23 @@ +FROM quay.io/ramalama/ramalama:latest + +RUN /usr/bin/python3 --version + +RUN git clone https://github.com/ggerganov/llama.cpp && \ + cd llama.cpp && \ + git reset --hard ${LLAMA_CPP_SHA} && \ + cmake -B build -DCMAKE_INSTALL_PREFIX:PATH=/usr -DGGML_CCACHE=0 \ + -DGGML_VULKAN=1 && \ + cmake --build build --config Release -j $(nproc) && \ + cmake --install build && \ + cd / && \ + git clone https://github.com/ggerganov/whisper.cpp.git && \ + cd whisper.cpp && \ + git reset --hard ${WHISPER_CPP_SHA} && \ + cmake -B build -DCMAKE_INSTALL_PREFIX:PATH=/usr -DGGML_CCACHE=0 \ + -DGGML_VULKAN=1 && \ + cmake --build build --config Release -j $(nproc) && \ + mv build/bin/main /usr/bin/whisper-main && \ + mv build/bin/server /usr/bin/whisper-server && \ + cd / && \ + rm -rf llama.cpp whisper.cpp + diff --git a/container_build.sh b/container_build.sh index d2b8e596..fcf1e341 100755 --- a/container_build.sh +++ b/container_build.sh @@ -34,9 +34,11 @@ build() { local image_name image_name=$(echo "$1" | sed "s#container-images/##g") local conman_build=("${conman[@]}") + local conman_show_size=("${conman[@]}" "images" "--filter" "reference='quay.io/ramalama/$image_name'") if [ "$#" -lt 2 ]; then add_build_platform "${conman_build[@]}" + "${conman_show_size[@]}" rm_container_image elif [ "$2" = "-d" ]; then add_build_platform @@ -45,9 +47,11 @@ build() { "${conman[@]}" push "quay.io/ramalama/$image_name" elif [ "$2" = "log" ]; then "${conman_build[@]}" 2>&1 | tee container_build.log + "${conman_show_size[@]}" else add_build_platform "${conman_build[@]}" + "${conman_show_size[@]}" rm_container_image fi