Skip to content
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

Add vulkan image and show size #353

Merged
merged 1 commit into from
Oct 23, 2024
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
23 changes: 23 additions & 0 deletions container-images/vulkan/Containerfile
Original file line number Diff line number Diff line change
@@ -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} && \
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rhatdan do you know if ARGS like LLAMA_CPP_SHA and WHISPER_CPP_SHA get inherited from parent container images?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm assuming they don't, but I don't know

Copy link
Member

Choose a reason for hiding this comment

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

Only if they are set as Environment variables, which currently they are not. If we want this to be set we could do it via environment in ramalama Containerfile

env LLAMA_CPP_SHA=${LLAMA_CPP_SHA}

Copy link
Member

Choose a reason for hiding this comment

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

Trying it out now.

Copy link
Member

Choose a reason for hiding this comment

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

Works: #355

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cool that's better, I'll merge yours

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

4 changes: 4 additions & 0 deletions container_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
Loading