Skip to content

Commit

Permalink
Fix training image dockerfile
Browse files Browse the repository at this point in the history
netcat is moved to one of traditional or openbsd
in ubuntu latest.
Openbsd variant is selected.
  • Loading branch information
testillano authored and Eduardo Ramos Testillano (eramedu) committed May 2, 2024
1 parent c840b7c commit 0528144
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Dockerfile.training
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ ARG enable_qa=true
RUN if [ "${base_os}" = "alpine" ] ; then apk update ; elif [ "${base_os}" = "ubuntu" ] ; then apt-get update ; fi

# Installation
RUN if [ "${base_os}" = "alpine" ] ; then apk add dos2unix ; elif [ "${base_os}" = "ubuntu" ] ; then apt-get install -y dos2unix netcat ; fi
RUN if [ "${base_os}" = "alpine" ] ; then apk add dos2unix ; elif [ "${base_os}" = "ubuntu" ] ; then apt-get install -y dos2unix netcat-openbsd ; fi

## Installation for questions & answers (langchain & OpenAI)
RUN if [ "${enable_qa}" = "true" -a "${base_os}" = "alpine" ] ; then apk add python3.9 py3-pip python3-dev ; fi
RUN if [ "${enable_qa}" = "true" -a "${base_os}" = "ubuntu" ] ; then apt-get install -y python3.9 python3-pip ; fi
RUN if [ "${enable_qa}" = "true" -a "${base_os}" = "alpine" ] ; then apk add python3 py3-pip python3-dev ; fi
RUN if [ "${enable_qa}" = "true" -a "${base_os}" = "ubuntu" ] ; then apt-get install -y python3 python3-pip python3-venv ; fi

RUN if [ "${enable_qa}" = "true" -a "${base_os}" = "alpine" ] ; then pip3 install torch -f https://download.pytorch.org/whl/torch_stable.html ; fi
RUN if [ "${enable_qa}" = "true" -a "${base_os}" = "alpine" ] ; then python3 -m venv /venv && source /venv/bin/activate && pip3 install torch -f https://download.pytorch.org/whl/torch_stable.html ; fi

# Why split pip3 installed modules: https://github.com/pypa/pip/issues/1386
RUN if [ "${enable_qa}" = "true" ] ; then pip3 install "langchain==0.0.138" "unstructured==0.5.12" && pip3 install "chromadb==0.3.21" "tiktoken==0.3.3" && pip3 install "openai==0.27.4" ; fi
RUN if [ "${enable_qa}" = "true" ] ; then python3 -m venv /venv && source /venv/bin/activate && pip3 install "langchain==0.0.138" "unstructured==0.5.12" && pip3 install "chromadb==0.3.21" "tiktoken==0.3.3" && pip3 install "openai==0.27.4" ; fi

# Cleanup
RUN if [ "${base_os}" = "alpine" ] ; then rm -rf /var/cache/apk/* ; elif [ "${base_os}" = "ubuntu" ] ; then apt-get clean ; fi
Expand Down

0 comments on commit 0528144

Please sign in to comment.