Spaces:
Sleeping
Sleeping
MVPilgrim
commited on
Commit
·
565f8a3
1
Parent(s):
2ea2391
debug
Browse files- Dockerfile +51 -9
- debugDelay.sh +2 -2
Dockerfile
CHANGED
|
@@ -28,18 +28,60 @@ RUN add-apt-repository ppa:deadsnakes/ppa && \
|
|
| 28 |
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
|
| 29 |
RUN update-alternatives --set python3 /usr/bin/python3.11
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
# Verify Python and musl installations
|
| 32 |
#RUN python3 --version && \
|
| 33 |
# ldd --version | grep musl
|
| 34 |
|
| 35 |
-
# Set up
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
# Copy your application files
|
| 39 |
-
COPY . /app
|
| 40 |
|
| 41 |
-
|
| 42 |
-
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 43 |
|
| 44 |
-
|
| 45 |
-
CMD ["
|
|
|
|
| 28 |
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
|
| 29 |
RUN update-alternatives --set python3 /usr/bin/python3.11
|
| 30 |
|
| 31 |
+
# Install requirements packages, semantic text splitter, llama_cpp.
|
| 32 |
+
COPY ./requirements.txt /app/requirements.txt
|
| 33 |
+
RUN pip3 install --break-system-packages --no-cache-dir --upgrade -r /app/requirements.txt
|
| 34 |
+
RUN pip3 install --break-system-packages https://files.pythonhosted.org/packages/13/87/e0cb08c2d4bd7d38ab63816b306c8b1e7cfdc0e59bd54462e8b0df069078/semantic_text_splitter-0.6.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
|
| 35 |
+
RUN pip3 install --break-system-packages llama_cpp_python
|
| 36 |
+
RUN FORCE_CMAKE=1 CMAKE_SYSTEM_PROCESSOR=AMD64 pip3 install --break-system-packages --verbose --no-cache-dir llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 37 |
+
|
| 38 |
+
# Install text2vec-transformers
|
| 39 |
+
WORKDIR /app/text2vec-transformers
|
| 40 |
+
COPY --from=semitechnologies/transformers-inference:sentence-transformers-multi-qa-MiniLM-L6-cos-v1 /app /app/text2vec-transformers
|
| 41 |
+
COPY --from=semitechnologies/transformers-inference:sentence-transformers-multi-qa-MiniLM-L6-cos-v1 /usr/local/bin /app/text2vec-transformers/bin
|
| 42 |
+
COPY ./multi-qa-MiniLM-L6-cos-v1 /app/text2vec-transformers
|
| 43 |
+
RUN ./custom_prerequisites.py
|
| 44 |
+
|
| 45 |
+
WORKDIR /app
|
| 46 |
+
|
| 47 |
+
# Copy application files
|
| 48 |
+
COPY ./semsearch.py /app/semsearch.py
|
| 49 |
+
COPY ./startup.sh /app/startup.sh
|
| 50 |
+
COPY ./.streamlit/main.css /app/.streamlit/main.css
|
| 51 |
+
COPY ./app.py /app/app.py
|
| 52 |
+
RUN chmod 755 /app/startup.sh
|
| 53 |
+
|
| 54 |
+
# Copy input documents
|
| 55 |
+
RUN mkdir -p /app/inputDocs
|
| 56 |
+
COPY ./inputDocs/* /app/inputDocs/
|
| 57 |
+
|
| 58 |
+
# Install Weaviate
|
| 59 |
+
WORKDIR /app/weaviate
|
| 60 |
+
RUN wget -qO- https://github.com/weaviate/weaviate/releases/download/v1.24.10/weaviate-v1.24.10-linux-amd64.tar.gz | tar -xzf -
|
| 61 |
+
|
| 62 |
+
# Download Llama model
|
| 63 |
+
WORKDIR /app
|
| 64 |
+
RUN wget -v https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGUF/resolve/main/llama-2-7b-chat.Q4_0.gguf
|
| 65 |
+
|
| 66 |
+
# Create a non-root user
|
| 67 |
+
RUN groupadd -g 1000 user && useradd -m -u 1000 -g user user
|
| 68 |
+
|
| 69 |
+
# Set permissions
|
| 70 |
+
RUN chown -R user:user /app
|
| 71 |
+
RUN chmod -R 755 /app
|
| 72 |
+
|
| 73 |
+
# Switch to non-root user
|
| 74 |
+
USER user
|
| 75 |
+
|
| 76 |
# Verify Python and musl installations
|
| 77 |
#RUN python3 --version && \
|
| 78 |
# ldd --version | grep musl
|
| 79 |
|
| 80 |
+
# Set up environment variables
|
| 81 |
+
ENV LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:/usr/local/cuda/lib64:$LD_LIBRARY_PATH"
|
| 82 |
+
ENV PATH="/app:/app/text2vec-transformers:/app/text2vec-transformers/bin:/usr/local/bin:$PATH"
|
|
|
|
|
|
|
| 83 |
|
| 84 |
+
EXPOSE 8080 8501
|
|
|
|
| 85 |
|
| 86 |
+
CMD ["streamlit", "run", "/app/app.py", "--server.headless", "true", "--server.enableCORS", "false", "--server.enableXsrfProtection", "false", "--server.fileWatcherType", "none"]
|
| 87 |
+
#CMD ["/app/delay.sh", "1200"]
|
debugDelay.sh
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
#! /bin/bash
|
| 2 |
|
| 3 |
-
echo "### debug delay:
|
| 4 |
-
sleep
|
|
|
|
| 1 |
#! /bin/bash
|
| 2 |
|
| 3 |
+
echo "### debug delay: 1200"
|
| 4 |
+
sleep 1200
|