cleanup: remove outdated deployment / development dirs (#193)
parent
2bf5bcd0cf
commit
63ca6225ba
|
|
@ -1,91 +0,0 @@
|
||||||
name: Create and publish docker image
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
branches: [ "main" ]
|
|
||||||
paths:
|
|
||||||
- 'poetry.lock'
|
|
||||||
- 'tabby/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
# This is used to complete the identity challenge
|
|
||||||
# with sigstore/fulcio when running outside of PRs.
|
|
||||||
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: true
|
|
||||||
|
|
||||||
# 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: false
|
|
||||||
swap-storage: true
|
|
||||||
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
# Workaround: https://github.com/docker/build-push-action/issues/461
|
|
||||||
- name: Setup Docker buildx
|
|
||||||
uses: docker/setup-buildx-action@v2.0.0
|
|
||||||
|
|
||||||
# Login against a Docker registry except on PR
|
|
||||||
# https://github.com/docker/login-action
|
|
||||||
- name: Log into GitHub Container registry
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v2.0.0
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Log into Docker Hub
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v2.0.0
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Generate image name
|
|
||||||
run: |
|
|
||||||
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
|
|
||||||
|
|
||||||
- uses: int128/docker-build-cache-config-action@v1
|
|
||||||
id: cache
|
|
||||||
with:
|
|
||||||
image: ghcr.io/${{ env.IMAGE_NAME }}/cache
|
|
||||||
|
|
||||||
# Build and push Docker image with Buildx (don't push on PR)
|
|
||||||
# https://github.com/docker/build-push-action
|
|
||||||
- name: Build and push Docker image
|
|
||||||
id: build-and-push
|
|
||||||
uses: docker/build-push-action@v3.1.1
|
|
||||||
with:
|
|
||||||
file: Dockerfile
|
|
||||||
context: .
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
|
||||||
tags: |
|
|
||||||
ghcr.io/${{ env.IMAGE_NAME }}:latest
|
|
||||||
${{ env.IMAGE_NAME }}:latest
|
|
||||||
cache-from: ${{ steps.cache.outputs.cache-from }}
|
|
||||||
cache-to: ${{ steps.cache.outputs.cache-to }}
|
|
||||||
|
|
||||||
- name: Docker Hub Description
|
|
||||||
uses: peter-evans/dockerhub-description@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
repository: tabbyml/tabby
|
|
||||||
73
Dockerfile
73
Dockerfile
|
|
@ -1,73 +0,0 @@
|
||||||
# syntax = docker/dockerfile:1.5
|
|
||||||
|
|
||||||
FROM tabbyml/fastertransformer_backend
|
|
||||||
|
|
||||||
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 <<EOF
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.vector.dev | bash -s -- -y
|
|
||||||
EOF
|
|
||||||
ENV PATH "$HOME/.vector/bin:$PATH"
|
|
||||||
|
|
||||||
# Supervisord
|
|
||||||
RUN --mount=type=cache,target=$HOME/.cache pip install -i $PYPI_INDEX_URL supervisor
|
|
||||||
|
|
||||||
RUN mkdir -p ~/.bin
|
|
||||||
ENV PATH "$HOME/.bin:$PATH"
|
|
||||||
|
|
||||||
# Install dagu
|
|
||||||
RUN <<EOF
|
|
||||||
curl -L https://github.com/yohamta/dagu/releases/download/v1.10.2/dagu_1.10.2_Linux_x86_64.tar.gz > dagu.tar.gz
|
|
||||||
tar zxvf dagu.tar.gz
|
|
||||||
mv dagu ~/.bin/
|
|
||||||
rm dagu.tar.gz LICENSE.md README.md
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
COPY tabby ./tabby
|
|
||||||
|
|
||||||
# Install caddy
|
|
||||||
RUN <<EOF
|
|
||||||
curl -L "https://github.com/caddyserver/caddy/releases/download/v2.6.4/caddy_2.6.4_linux_amd64.tar.gz" -o caddy.tar.gz
|
|
||||||
tar zxvf caddy.tar.gz
|
|
||||||
mv caddy ~/.bin/
|
|
||||||
rm caddy.tar.gz README.md LICENSE
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Setup file permissions
|
|
||||||
USER root
|
|
||||||
RUN mkdir -p /var/lib/vector
|
|
||||||
RUN chown 1000 /var/lib/vector
|
|
||||||
|
|
||||||
RUN mkdir -p $HOME/.cache
|
|
||||||
RUN chown 1000 $HOME/.cache
|
|
||||||
|
|
||||||
USER 1000
|
|
||||||
CMD ["./tabby/scripts/tabby.sh"]
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
MODEL_NAME=TabbyML/J-350M
|
|
||||||
|
|
||||||
# Volumes
|
|
||||||
DATA_VOLUME="../data:/data"
|
|
||||||
HF_VOLUME="../data/hf_cache:/home/app/.cache/huggingface"
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
version: '3.3'
|
|
||||||
|
|
||||||
services:
|
|
||||||
tabby:
|
|
||||||
shm_size: 1gb
|
|
||||||
environment:
|
|
||||||
MODEL_BACKEND: triton
|
|
||||||
MODEL_REPLICA: ${MODEL_REPLICA:-1}
|
|
||||||
deploy:
|
|
||||||
resources:
|
|
||||||
reservations:
|
|
||||||
devices:
|
|
||||||
- driver: nvidia
|
|
||||||
count: all
|
|
||||||
capabilities: [gpu]
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
version: '3.3'
|
|
||||||
|
|
||||||
services:
|
|
||||||
init:
|
|
||||||
image: tabbyml/tabby
|
|
||||||
container_name: init
|
|
||||||
user: root
|
|
||||||
volumes:
|
|
||||||
- ${DATA_VOLUME}
|
|
||||||
- ${HF_VOLUME}
|
|
||||||
command: chown -R 1000 /data
|
|
||||||
|
|
||||||
tabby:
|
|
||||||
image: tabbyml/tabby
|
|
||||||
container_name: tabby
|
|
||||||
environment:
|
|
||||||
MODEL_NAME: ${MODEL_NAME}
|
|
||||||
ports:
|
|
||||||
- "5000:5000"
|
|
||||||
volumes:
|
|
||||||
- ${DATA_VOLUME}
|
|
||||||
- ${HF_VOLUME}
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:5000"]
|
|
||||||
interval: 2s
|
|
||||||
timeout: 2s
|
|
||||||
start_period: 1200s
|
|
||||||
depends_on:
|
|
||||||
- init
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
# Run Tabby server on any cloud with one click
|
|
||||||
|
|
||||||
## Background
|
|
||||||
|
|
||||||
[**SkyPilot**](https://github.com/skypilot-org/skypilot) is an open-source framework for seamlessly running machine learning on any cloud. With a simple CLI, users can easily launch many clusters and jobs, while substantially lowering their cloud bills. Currently, [Lambda Labs](https://skypilot.readthedocs.io/en/latest/getting-started/installation.html#lambda-cloud) (low-cost GPU cloud), [AWS](https://skypilot.readthedocs.io/en/latest/getting-started/installation.html#aws), [GCP](https://skypilot.readthedocs.io/en/latest/getting-started/installation.html#gcp), and [Azure](https://skypilot.readthedocs.io/en/latest/getting-started/installation.html#azure) are supported. See [docs](https://skypilot.readthedocs.io/en/latest/) to learn more.
|
|
||||||
|
|
||||||
## Steps
|
|
||||||
|
|
||||||
1. Install SkyPilot and [check that cloud credentials exist](https://skypilot.readthedocs.io/en/latest/getting-started/installation.html#cloud-account-setup):
|
|
||||||
```bash
|
|
||||||
pip install "skypilot[aws,gcp,azure,lambda]" # pick your clouds
|
|
||||||
sky check
|
|
||||||
```
|
|
||||||
<img src="https://i.imgur.com/7BUci5n.png" width="485" alt="`sky check` output showing enabled clouds for SkyPilot"/>
|
|
||||||
|
|
||||||
2. Get the [deployment folder](./):
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/TabbyML/tabby
|
|
||||||
cd tabby/deployment/skypilot
|
|
||||||
```
|
|
||||||
|
|
||||||
3. run:
|
|
||||||
```bash
|
|
||||||
sky launch -c tabby default.yml
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Open another terminal and run:
|
|
||||||
```bash
|
|
||||||
ssh -L 5000:localhost:5000 tabby
|
|
||||||
```
|
|
||||||
|
|
||||||
5. Open http://localhost:5000 in your browser and start coding!
|
|
||||||

|
|
||||||
|
|
||||||
## Cleaning up
|
|
||||||
When you are done, you can stop or tear down the cluster:
|
|
||||||
|
|
||||||
- **To stop the cluster**, run
|
|
||||||
```bash
|
|
||||||
sky stop tabby # or pass your custom name if you used "-c <other name>"
|
|
||||||
```
|
|
||||||
You can restart a stopped cluster and relaunch the chatbot (the `run` section in YAML) with
|
|
||||||
```bash
|
|
||||||
sky launch default.yml -c tabby --no-setup
|
|
||||||
```
|
|
||||||
Note the `--no-setup` flag: a stopped cluster preserves its disk contents so we can skip redoing the setup.
|
|
||||||
- **To tear down the cluster** (non-restartable), run
|
|
||||||
```bash
|
|
||||||
sky down tabby # or pass your custom name if you used "-c <other name>"
|
|
||||||
```
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
resources:
|
|
||||||
accelerators: A100:1
|
|
||||||
disk_size: 1024
|
|
||||||
|
|
||||||
setup: |
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
# On some cloud providers, docker-compose is not installed by default.
|
|
||||||
sudo curl -L https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
|
|
||||||
sudo chmod a+x /usr/local/bin/docker-compose
|
|
||||||
|
|
||||||
# Pull tabby images.
|
|
||||||
git clone https://github.com/TabbyML/tabby.git || true
|
|
||||||
cd tabby/deployment
|
|
||||||
|
|
||||||
# On certain cloud providers (e.g lambda cloud), the default user is not added to docker group, so we need sudo here
|
|
||||||
sudo docker-compose pull
|
|
||||||
|
|
||||||
# Add current user to docker group, it won't take effect immediately as skypilot job is started by a long-running daemon.
|
|
||||||
sudo usermod -aG docker $USER
|
|
||||||
|
|
||||||
|
|
||||||
run: |
|
|
||||||
cd tabby/deployment
|
|
||||||
sudo MODEL_REPLICA=${MODEL_REPLICA:-8} docker-compose -f docker-compose.yml -f docker-compose.triton.yml up
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
data
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
FROM tabbyml/tabby
|
|
||||||
|
|
||||||
ARG PYPI_INDEX_URL=https://pypi.org/simple
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
DEFAULT :=
|
|
||||||
UP_FLAGS := up --remove-orphans
|
|
||||||
|
|
||||||
build:
|
|
||||||
docker-compose -f ../deployment/docker-compose.yml -f docker-compose.dev.yml build
|
|
||||||
|
|
||||||
dev:
|
|
||||||
docker-compose -f ../deployment/docker-compose.yml -f docker-compose.dev.yml $(UP_FLAGS)
|
|
||||||
|
|
||||||
dev-triton:
|
|
||||||
docker-compose -f ../deployment/docker-compose.yml -f ../deployment/docker-compose.triton.yml -f docker-compose.dev.yml $(UP_FLAGS)
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
version: '3.3'
|
|
||||||
|
|
||||||
services:
|
|
||||||
tabby:
|
|
||||||
image: tabbyml/tabby:dev
|
|
||||||
build:
|
|
||||||
context: ..
|
|
||||||
dockerfile: ./development/Dockerfile
|
|
||||||
args:
|
|
||||||
PYPI_INDEX_URL: https://mirrors.aliyun.com/pypi/simple
|
|
||||||
environment:
|
|
||||||
UVICORN_RELOAD: true
|
|
||||||
VECTOR_WATCH_CONFIG: true
|
|
||||||
STREAMLIT_RUN_ON_SAVE: true
|
|
||||||
CADDY_WATCH_CONFIG: true
|
|
||||||
STREAMLIT_HIDE_MENU: false
|
|
||||||
volumes:
|
|
||||||
- ../tabby:/home/app/tabby
|
|
||||||
ports:
|
|
||||||
- 8083:8083
|
|
||||||
- 8084:8084
|
|
||||||
Loading…
Reference in New Issue