Skip to content

Commit

Permalink
bento replacement.
Browse files Browse the repository at this point in the history
  • Loading branch information
boocmp committed Sep 29, 2024
1 parent b8bdd8b commit 751908c
Show file tree
Hide file tree
Showing 33 changed files with 1,155 additions and 744 deletions.
1 change: 1 addition & 0 deletions .github/workflows/generalized-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
- main
- dev
- bentoml
- replace-bentoml

name: stt deployments
jobs:
Expand Down
81 changes: 10 additions & 71 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,81 +1,20 @@
# ===========================================
#
# THIS IS A GENERATED DOCKERFILE. DO NOT EDIT
#
# ===========================================

# Block SETUP_BENTO_BASE_IMAGE
FROM nvidia/cuda:12.2.2-cudnn8-runtime-ubuntu22.04 as base-container

ENV LANG=C.UTF-8

ENV LC_ALL=C.UTF-8

ENV PYTHONIOENCODING=UTF-8

ENV PYTHONUNBUFFERED=1
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04

ENV NVIDIA_VISIBLE_DEVICES=all

RUN apt update && apt install -y python3-pip

USER root

ENV DEBIAN_FRONTEND=noninteractive
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN set -eux && \
apt-get update -y && \
apt-get install -q -y --no-install-recommends --allow-remove-essential \
ca-certificates gnupg2 bash build-essential libsndfile1 ffmpeg

RUN \
set -eux && \
apt-get install -y --no-install-recommends --allow-remove-essential software-properties-common && \
# add deadsnakes ppa to install python
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update -y && \
apt-get install -y --no-install-recommends --allow-remove-essential curl python3.11 python3.11-dev python3.11-distutils
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools

RUN ln -sf /usr/bin/python3.11 /usr/bin/python3 && \
ln -sf /usr/bin/pip3.11 /usr/bin/pip3
COPY ./requirements.txt ./requirements.txt

RUN curl -O https://bootstrap.pypa.io/get-pip.py && \
python3 get-pip.py && \
rm -rf get-pip.py
RUN pip install -r requirements.txt

# Block SETUP_BENTO_USER
ARG BENTO_USER=bentoml
ARG BENTO_USER_UID=1034
ARG BENTO_USER_GID=1034
RUN groupadd -g $BENTO_USER_GID -o $BENTO_USER && useradd -m -u $BENTO_USER_UID -g $BENTO_USER_GID -o -r $BENTO_USER
COPY . /app
WORKDIR /app
RUN pip install .

ENV BENTOML_CONFIG=src/configuration.yaml
ARG BENTO_PATH=/home/bentoml/bento
ENV BENTO_PATH=$BENTO_PATH
ENV BENTOML_HOME=/home/bentoml/
ENV BENTOML_DO_NOT_TRACK=True

RUN mkdir $BENTO_PATH && chown bentoml:bentoml $BENTO_PATH -R
WORKDIR $BENTO_PATH

# Block SETUP_BENTO_COMPONENTS
COPY --chown=bentoml:bentoml ./env/python ./env/python/
# install python packages with install.sh
RUN bash -euxo pipefail /home/bentoml/bento/env/python/install.sh
COPY --chown=bentoml:bentoml . ./

# Block SETUP_BENTO_ENTRYPOINT
RUN rm -rf /var/lib/{apt,cache,log}
# Default port for BentoServer
EXPOSE 3000

# Expose Prometheus port
EXPOSE 3001

RUN chmod +x /home/bentoml/bento/env/docker/entrypoint.sh

USER bentoml

RUN mkdir /home/bentoml/.cache
RUN mkdir /home/bentoml/.cache/torch

ENTRYPOINT [ "/home/bentoml/bento/env/docker/entrypoint.sh" ]
CMD [ "python3", "-m", "gunicorn", "-k", "uvicorn.workers.UvicornWorker", "stt:app", "--workers", "1", "-b", "0.0.0.0:3000"]
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
.PHONY: all build docker serve-docker
all: serve-docker

build:
python -m bentoml delete -y stt:git || true
python -m bentoml build --version git src
cp -R ~/bentoml/bentos/stt/git/* .

docker: build
docker build -t stt:latest .

serve-docker: docker
sudo chown -R 1034:1043 models
docker run -it --rm -p 3000:3000 -v ./models/huggingface:/home/bentoml/.cache/huggingface stt:latest
144 changes: 0 additions & 144 deletions apis/openapi.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions bento.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions bentofile.yaml

This file was deleted.

56 changes: 0 additions & 56 deletions env/docker/entrypoint.sh

This file was deleted.

Loading

0 comments on commit 751908c

Please sign in to comment.