From 0528144e7c13729097b5a2e6d8f0534ef2283a6d Mon Sep 17 00:00:00 2001 From: "Eduardo Ramos Testillano (ert)" Date: Thu, 2 May 2024 23:12:28 +0200 Subject: [PATCH] Fix training image dockerfile netcat is moved to one of traditional or openbsd in ubuntu latest. Openbsd variant is selected. --- Dockerfile.training | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile.training b/Dockerfile.training index 0388859..5f5cfee 100644 --- a/Dockerfile.training +++ b/Dockerfile.training @@ -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