Skip to content

Commit

Permalink
initial checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
agt committed Oct 8, 2023
0 parents commit b40b7c7
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build image
on:
push:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Log in to registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Generate tags and labels
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Check Free Space 0
run: |
echo "Free space:"
df -h
- name: Prune builder
run: |
docker image prune -a -f
docker container prune -f
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Check Free Space 1
run: |
echo "Free space:"
df -h
- name: Build and push image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

FROM ubuntu:20.04

RUN apt-get update -y && \
apt-get -qq install -y --no-install-recommends \
git \
curl \
rsync \
unzip \
less \
vim \
gnupg \
htop \
openssh-client \
p7zip \
apt-utils \
jq \
p7zip-full \
ca-certificates \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
&& update-ca-certificates

# Install Miniforge3 (mamba-based open miniconda)
ARG MFURL="https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh"

RUN curl -L -o /tmp/Miniforge3.sh "${MFURL}" && \
bash /tmp/Miniforge3.sh -b -p /opt/conda && \
rm -f /tmp/Miniforge3.sh

COPY vllm-environment.yml /root/vllm-environment.yml

RUN . /opt/conda/bin/activate && \
mamba env create -p /opt/vllm -f /root/vllm-environment.yml

CMD echo 'Hint: /opt/conda/bin/conda run -p /opt/vllm python -m vllm.entrypoints.openai.api_server --host 0.0.0.0 --port 8000 --model gpt2'
33 changes: 33 additions & 0 deletions vllm-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: /opt/vllm
channels:
- xformers/label/dev
- pytorch
- nvidia/label/cuda-11.8.0
- conda-forge
dependencies:
- accelerate
- cuda-minimal-build=11.8.0=0
- cuda-toolkit=11.8.0=0
- cuda-version=11.8
- diskcache
- fastapi
- numpy
- pandas
- pip
- psutil
- pyarrow
- pydantic<2
- python=3.10.*
- pytorch=2.1.0
- pytorch-cuda=11.8
- sentencepiece
- torchvision
- transformers
- typing_extensions
- uvicorn
- xformers
- pip:
- fschat
- ninja
- ray
- vllm==0.2.0

0 comments on commit b40b7c7

Please sign in to comment.