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

Allow users to build RAG versus Docling images #744

Merged
merged 1 commit into from
Feb 6, 2025
Merged
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
14 changes: 10 additions & 4 deletions container-images/pragmatic/build_pragmatic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,20 @@ install_pytorch() {
}

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
if [ "$2" == "docling" ]; then
${PYTHON_VERSION} pip install docling --extra-index-url https://download.pytorch.org/whl/$1
${PYTHON_VERSION} pip install -r requirements.txt --prefix=/usr
else
${PYTHON_VERSION} pip install torch --extra-index-url https://download.pytorch.org/whl/$1
tmpfile=$(mktemp)
grep -v docling requirements.txt > ${tmpfile}
${PYTHON_VERSION} pip install -r /tmp/nodocling.txt --prefix=/usr
Copy link
Collaborator

Choose a reason for hiding this comment

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

@rhatdan when this code is executed:

https://github.com/containers/ramalama/actions/runs/13356993323/job/37301130079?pr=831

it complains with this:

  • grep -v docling requirements.txt
  • python3 -m pip install -r /tmp/nodocling.txt --prefix=/usr
    ERROR: Could not open requirements file: [Errno 2] No such file or directory: '/tmp/nodocling.txt'
    Error: building at STEP "RUN sh /tmp/build_pragmatic.sh ${GPU} ${CONTENT}": while running runtime: exit status 1
    Error: Process completed with exit code 1.

rm ${tmpfile}
fi
${PYTHON_VERSION} pip install --prefix=/usr .
cd ..
}
Expand Down
Loading