File size: 1,919 Bytes
6025266
 
e31a4eb
6025266
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7cca7c3
6025266
 
 
 
 
 
 
 
c30045e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu18.04

ARG CTRANSFORMERS_VERSION="0.2.5"
ARG CMAKE_VERSION=3.26
ARG CMAKE_VERSION_PATCH=3.26.3
ARG CMAKE_OS=linux
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=UTC

RUN apt-get update && \
    apt-get install --no-install-recommends -y \
      curl git vim build-essential software-properties-common python3 python3-pip python3-dev python3-venv \
      libffi-dev libncurses5-dev zlib1g zlib1g-dev libreadline-dev libbz2-dev libsqlite3-dev libssl-dev \
      libblas-dev liblapack-dev cmake && \
    add-apt-repository ppa:ubuntu-toolchain-r/test && \
    apt-get update && \
    apt install --no-install-recommends -y gcc-10 g++-10 && \
    update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10 && \
    rm -rf /var/lib/apt/lists/* && \
    pip3 install scikit-build
RUN curl -L https://cmake.org/files/v$CMAKE_VERSION/cmake-$CMAKE_VERSION_PATCH-$CMAKE_OS-x86_64.sh -o /tmp/cmake-$CMAKE_VERSION_PATCH-$CMAKE_OS-x86_64.sh && \
    mkdir /opt/cmake && \
    sh /tmp/cmake-$CMAKE_VERSION_PATCH-$CMAKE_OS-x86_64.sh --skip-license --prefix=/opt/cmake && \
    ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake

RUN useradd -m -u 1000 appuser

WORKDIR /build
RUN chown appuser:appuser /build
USER appuser

ENV HOME /home/appuser
ENV PYENV_ROOT $HOME/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH

RUN git clone --depth 1 --branch v$CTRANSFORMERS_VERSION https://github.com/marella/ctransformers.git /build
RUN curl https://pyenv.run | bash

RUN pyenv install 3.8.9 && \
    pyenv global 3.8.9 && \
    pyenv rehash && \
    pip install --no-cache-dir --upgrade pip==22.3.1 setuptools wheel && \
    pip install --no-cache-dir datasets "huggingface-hub>=0.12.1" "protobuf<4" "click<8.1" "scikit-build" && \
    CT_CUBLAS=1 python3 setup.py bdist_wheel && \
    ls -l /build/dist/