diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e05d6f0..2c6b955 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -21,6 +21,20 @@ jobs: id-token: write steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: true + - name: Checkout repository uses: actions/checkout@v3 diff --git a/Dockerfile b/Dockerfile index 7c307ac..f61b18d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,47 +1,68 @@ # syntax = docker/dockerfile:1.5 -FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-runtime +FROM tabbyml/fastertransformer_backend -# Install utilities +RUN apt update && apt -y install build-essential libssl-dev zlib1g-dev \ + libbz2-dev libreadline-dev libsqlite3-dev curl \ + libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev + +RUN mkdir -p /home/app +RUN chown 1000 /home/app + +USER 1000 +WORKDIR /home/app +ENV HOME /home/app + +# Setup pyenv +RUN git clone --depth=1 https://github.com/pyenv/pyenv.git .pyenv +ENV PATH="$HOME/.pyenv/shims:/home/app/.pyenv/bin:$PATH" + +ARG PYTHON_VERSION=3.10.10 +RUN pyenv install ${PYTHON_VERSION} +RUN pyenv global ${PYTHON_VERSION} + +ARG PYPI_INDEX_URL=https://pypi.org/simple +ARG POETRY_VERSION=1.4.0 + +RUN --mount=type=cache,target=$HOME/.cache pip install -i $PYPI_INDEX_URL "poetry==$POETRY_VERSION" + +# vector RUN < dagu.tar.gz tar zxvf dagu.tar.gz - mv dagu /usr/local/bin + mv dagu ~/.bin/ rm dagu.tar.gz LICENSE.md README.md EOF -ARG PYPI_INDEX_URL=https://pypi.org/simple -ARG POETRY_VERSION=1.4.0 +# Install tabby dependencies +COPY poetry.lock pyproject.toml ./ +RUN poetry export --without-hashes > requirements.txt +RUN --mount=type=cache,target=$HOME/.cache pip install -i $PYPI_INDEX_URL --no-dependencies -r requirements.txt -WORKDIR /app - -RUN --mount=type=cache,target=/root/.cache pip install -i $PYPI_INDEX_URL "poetry==$POETRY_VERSION" - -COPY poetry.lock pyproject.toml /app/ -RUN poetry export --without-hashes -o requirements.txt - -RUN --mount=type=cache,target=/root/.cache pip install -i $PYPI_INDEX_URL --extra-index-url https://pypi.org/simple --no-dependencies -r requirements.txt - -## FIX bitandsands -ENV LD_LIBRARY_PATH "$LD_LIBRARY_PATH:/opt/conda/lib" -RUN ln -s /opt/conda/lib/libcudart.so.11.7.99 /opt/conda/lib/libcudart.so - -# vector -RUN <