-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Begin process of packaging PRAGmatic
Building Pragmatic into a container image is fairly easy. podman build --build-arg IMAGE=quay.io/ramalama/rocm -t quay.io/ramalama/rocm-rag container-images/pragmatic Signed-off-by: Daniel J Walsh <[email protected]>
- Loading branch information
Showing
3 changed files
with
60 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ARG IMAGE=quay.io/ramalama/ramalama:latest | ||
FROM $IMAGE | ||
|
||
ARG GPU=cpu | ||
COPY ./build_pragmatic.sh /tmp/ | ||
RUN sh /tmp/build_pragmatic.sh $GPU |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
set -exu -o pipefail | ||
|
||
export PYTHON_VERSION="python3 -m" | ||
if [ "$(python3 --version)" \< "Python 3.11" ]; then | ||
dnf install -y python3.11 python3.11-pip | ||
export PYTHON_VERSION="/usr/bin/python3.11 -m" | ||
fi | ||
|
||
cuda="2.3.1+cu121" | ||
|
||
rocm="2.3.1+rocm6.0" | ||
|
||
cpu="2.3.1+cpu" | ||
|
||
vulkan=$cpu | ||
|
||
asahi=$cpu | ||
|
||
install_pytorch() { | ||
version=${!1} | ||
echo ${PYTHON_VERSION} pip install torch==${version} -f https://download.pytorch.org/whl/torch_stable.html | ||
${PYTHON_VERSION} pip install torch==${version} -f https://download.pytorch.org/whl/torch_stable.html | ||
} | ||
|
||
clone_and_build_pragmatic() { | ||
git clone https://github.com/redhat-et/PRAGmatic | ||
cd PRAGmatic | ||
git submodule update --init --recursive | ||
|
||
${PYTHON_VERSION} pip install -r requirements.txt --prefix=/usr | ||
${PYTHON_VERSION} pip install --prefix=/usr . | ||
cd .. | ||
} | ||
|
||
echo ${!1} | ||
${PYTHON_VERSION} pip install docling --extra-index-url https://download.pytorch.org/whl/$1 | ||
|
||
clone_and_build_pragmatic | ||
rm -rf /var/cache/*dnf* /opt/rocm-*/lib/*/library/*gfx9* /root/.cache /root/buildinfo PRAGmatic | ||
dnf -y clean all | ||
ldconfig |