turbopilot/Dockerfile.default

51 lines
1.3 KiB
Docker
Raw Normal View History

2023-08-26 12:08:19 +00:00
ARG BUILD_BASE="ubuntu:22.04"
ARG RUNTIME_BASE="ubuntu:22.04"
2023-08-26 11:43:52 +00:00
2023-08-26 12:08:19 +00:00
FROM ${BUILD_BASE} AS build
2023-04-10 07:51:48 +00:00
2023-08-26 12:51:50 +00:00
ARG EXTRA_DEPS=""
ARG CMAKE_ARGS=""
RUN echo "CMAKE_ARGS: ${CMAKE_ARGS}"
RUN echo "EXTRA_DEPS: ${EXTRA_DEPS}"
ENV DEBIAN_FRONTEND=noninteractive
2023-04-10 07:51:48 +00:00
# inlude kitware apt repo to allow us to grab latest cmake
RUN apt-get update && apt-get install -y ca-certificates gpg wget
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
2023-08-26 11:43:52 +00:00
RUN apt-get update && apt-get install -y build-essential cmake libboost-dev libboost-thread-dev ${EXTRA_DEPS}
ADD ./ /turbopilot
2023-04-10 07:51:48 +00:00
RUN mkdir /turbopilot/build
2023-04-10 07:51:48 +00:00
WORKDIR /turbopilot/build
2023-04-10 07:51:48 +00:00
2023-08-26 11:43:52 +00:00
RUN cmake .. ${CMAKE_ARGS}
RUN make turbopilot
2023-04-10 07:51:48 +00:00
2023-08-26 12:08:19 +00:00
FROM ${RUNTIME_BASE} AS runtime
2023-04-10 07:51:48 +00:00
ARG RUNTIME_DEPS=""
RUN if [[ -z "${RUNTIME_DEPS}" ]] ; then echo "No runtime libs required" ; else apt-get update && apt-get install -y ${RUNTIME_DEPS} ; fi
2023-04-10 07:51:48 +00:00
WORKDIR /app
2023-07-29 14:49:43 +00:00
COPY --from=build /turbopilot/build/bin/turbopilot /app/turbopilot
2023-04-10 07:51:48 +00:00
ENV THREADS=4
2023-04-10 08:18:04 +00:00
ENV MODEL="/models/codegen-2B-multi-ggml-4bit-quant.bin"
2023-04-10 07:51:48 +00:00
2023-05-08 13:24:49 +00:00
ENV BATCHSIZE=8
2023-04-10 07:51:48 +00:00
COPY ./run.sh /app/
EXPOSE 18080
CMD /app/run.sh