Skip to content

Commit

Permalink
Support different container registries
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleykleynhans committed Apr 17, 2024
1 parent b3b3f51 commit 3dc92c7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ COPY oobabooga/requirements* ./
RUN source /venv/bin/activate && \
pip3 install -r requirements.txt && \
bash -c 'for req in extensions/*/requirements.txt ; do pip3 install -r "$req" ; done' && \
mkdir -p repositories && \
cd repositories && \
git clone https://github.com/turboderp/exllamav2 && \
pip3 install -r exllamav2/requirements.txt && \
deactivate

# Fix safetensors module broken by above exllama repository installation
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ to launch it on RunPod.
## Building the Docker image

> [!NOTE]
> You will need to edit the `docker-bake.hcl` file and update `USERNAME`,
> You will need to edit the `docker-bake.hcl` file and update `REGISTRY_USER`,
> and `RELEASE`. You can obviously edit the other values too, but these
> are the most important ones.
Expand All @@ -57,6 +57,10 @@ docker login
# Build the image, tag the image, and push the image to Docker Hub
cd text-generation-docker
docker buildx bake -f docker-bake.hcl --push

# Same as above but customize registry/user/release:
REGISTRY=ghcr.io REGISTRY_USER=myuser RELEASE=my-release docker buildx \
bake -f docker-bake.hcl --push
```

## Running Locally
Expand Down
30 changes: 25 additions & 5 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
variable "USERNAME" {
variable "REGISTRY" {
default = "docker.io"
}

variable "REGISTRY_USER" {
default = "ashleykza"
}

Expand All @@ -7,21 +11,37 @@ variable "APP" {
}

variable "RELEASE" {
default = "1.17.1"
default = "1.17.2"
}

variable "CU_VERSION" {
default = "121"
}

variable "BASE_IMAGE_REPOSITORY" {
default = "ashleykza/runpod-base"
}

variable "BASE_IMAGE_VERSION" {
default = "1.0.2"
}

variable "CUDA_VERSION" {
default = "12.1.1"
}

variable "TORCH_VERSION" {
default = "2.2.1"
}

target "default" {
dockerfile = "Dockerfile"
tags = ["${USERNAME}/${APP}:${RELEASE}"]
tags = ["${REGISTRY}/${REGISTRY_USER}/${APP}:${RELEASE}"]
args = {
RELEASE = "${RELEASE}"
BASE_IMAGE = "ashleykza/runpod-base:1.0.1-cuda12.1.1-torch2.2.1"
BASE_IMAGE = "${BASE_IMAGE_REPOSITORY}:${BASE_IMAGE_VERSION}-cuda${CUDA_VERSION}-torch${TORCH_VERSION}"
INDEX_URL = "https://download.pytorch.org/whl/cu${CU_VERSION}"
TORCH_VERSION = "2.2.1+cu${CU_VERSION}"
TORCH_VERSION = "${TORCH_VERSION}+cu${CU_VERSION}"
OOBABOOGA_COMMIT = "26d822f64f2a029306b250b69dc58468662a4fc6"
VENV_PATH = "/workspace/venvs/text-generation-webui"
}
Expand Down

0 comments on commit 3dc92c7

Please sign in to comment.