-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #597 from rhatdan/pragmatic
Begin process of packaging PRAGmatic
- Loading branch information
Showing
4 changed files
with
75 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,4 +69,4 @@ jobs: | |
- name: Build Images | ||
run: | | ||
make build_rm | ||
make build-rm |
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,8 @@ | ||
ARG IMAGE=quay.io/ramalama/ramalama:latest | ||
FROM $IMAGE | ||
|
||
ARG GPU=cpu | ||
ARG CONTENT=rag | ||
COPY ./build_pragmatic.sh /tmp/ | ||
RUN echo $CONTENT | ||
RUN sh /tmp/build_pragmatic.sh ${GPU} ${CONTENT} |
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,45 @@ | ||
#!/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 git | ||
export PYTHON_VERSION="/usr/bin/python3.11 -m" | ||
else | ||
dnf install -y python3-pip git | ||
fi | ||
|
||
cuda="cu124" | ||
|
||
rocm="rocm6.2" | ||
|
||
cpu="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() { | ||
if [ "$2" == "docling" ]; then | ||
${PYTHON_VERSION} pip install docling --extra-index-url https://download.pytorch.org/whl/$1 | ||
fi | ||
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 .. | ||
} | ||
|
||
clone_and_build_pragmatic ${!1} $2 | ||
rm -rf /var/cache/*dnf* /opt/rocm-*/lib/*/library/*gfx9* /root/.cache /root/buildinfo PRAGmatic | ||
dnf -y clean all | ||
ldconfig |