-
Notifications
You must be signed in to change notification settings - Fork 14.1k
preserve .so symlinks for docker container builds #17214
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
preserve .so symlinks for docker container builds #17214
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.