preserve .so symlinks for docker container builds#17214
preserve .so symlinks for docker container builds#17214slaren merged 1 commit intoggml-org:masterfrom
Conversation
|
I've tested it locally - it works perfect. Thank you. @slaren, can you please review this PR? Thank you. |
|
@taronaeo Can you take a look at the s390x Dockerfile? |
| # Create a lib directory to store all .so files | ||
| RUN mkdir -p /app/lib && \ | ||
| find build -name "*.so" -exec cp {} /app/lib \; | ||
| find build -name "*.so*" -exec cp -P {} /app/lib \; |
There was a problem hiding this comment.
This is not great because it is creating multiple copies of the same shared libraries. At least the backends aren't duplicated, so it is not a huge problem, but we should switch to using cmake --install.
There was a problem hiding this comment.
@slaren The -P flag should preserve symlinks so they're not actually duplicated. That's one of the main reasons I didn't modify the s390x dockerfile because I'd need to alter the structure in order to get the symlinks functional.

There was a problem hiding this comment.
Are you performing the builds on WSL in a windows directory? I know that that can screw with symlinks. I'm doing my builds in Ubuntu.
There was a problem hiding this comment.
It's WSL but it's not on a windows directory.
|
Will look into the s390x docker this weekend :) |
Looks like no changes to the root@f8ece5d628e6:/llama.cpp/bin# ls -la /usr/lib/s390x-linux-gnu/ | grep libggml
lrwxrwxrwx 1 root root 17 Nov 14 16:29 libggml-base.so -> libggml-base.so.0
lrwxrwxrwx 1 root root 27 Nov 14 16:29 libggml-base.so.0 -> libggml-base.so.0.9.4-dirty
-rw-r--r-- 1 root root 832720 Nov 14 16:24 libggml-base.so.0.9.4-dirty
lrwxrwxrwx 1 root root 12 Nov 14 16:29 libggml.so -> libggml.so.0
lrwxrwxrwx 1 root root 22 Nov 14 16:29 libggml.so.0 -> libggml.so.0.9.4-dirty
-rw-r--r-- 1 root root 54440 Nov 14 16:25 libggml.so.0.9.4-dirtyroot@f8ece5d628e6:/llama.cpp/bin# ./llama-cli -m /models/granite-3.3-2b-instruct-be.Q4_K_M.gguf -p "Write me a dog walking business idea 1. " -no-cnv -n 100 2>/dev/null
Write me a dog walking business idea 1.
What is the business name?
2. What type of services will it offer?
3. What are the key features of this service?
4. What is the target market?
5. What is the unique selling proposition (USP)?
6. What are the potential challenges and solutions?
Please provide a detailed response for each point.
1. Business Name: Pawsitive Walks
- Explanation: The name "Pawsitive WalkAll working as intended. |

Previous PR #17091 broke the Dockerfiles because everything was previously linking against the unversioned so files. With the versioning added, links are now against the major version symlink for the so files, and copying only the unversion so files is no longer adequate.
This should fix: #17190, #17176, #17193
This PR preserves those symlinks and includes them in the container.
I have not included a fix for the s390x dockerfile in this PR for two reasons:
For that reason I think it's favorable to open a separate PR for strictly the s390x builds.