Skip to content

Commit

Permalink
feat(tgwui): Added CPU build (#76)
Browse files Browse the repository at this point in the history
* feat(tgwui): Added CPU build

* fix(tgwui): GH action build

* fi(ga-build-context): Removed echo

* Revert "fi(ga-build-context): Removed echo"

This reverts commit c6dff32.

* fix(tgwui-dockerfile): Added quotes

* fix(ga-build-engines): Added echo logs

* fix(tgwui): args on the top, fix echo log

* fix(ga-build-engine): Refactor build-args

* fix(tgwui-dockerfile): try to fix reading variable

* fx(ga-build-engine): Fix spaces

* fix(ga-build-engine): Removed loop

* fix(tgwui-dockerfile): Try to get build-arg

* fix(tgwui-dockerfile): Moved arg
  • Loading branch information
marchuk-vlad authored Dec 10, 2024
1 parent f90b273 commit 8448df9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/build-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
required: true
type: choice
options:
- text-generation-webui
- text-generation-webui-gpu
- text-generation-webui-cpu
- comfyui
target:
description: 'Target'
Expand Down Expand Up @@ -42,10 +43,17 @@ jobs:

- name: Prepare variables
run: |
if [ "$SOLUTION" == "text-generation-webui" ]; then
if [[ "$SOLUTION" == text-generation-webui* ]]; then
DOCKERFILE="./Text Generation WebUI/Dockerfile"
DOCKERFILE_CONTEXT="./Text Generation WebUI/"
SUBMODULE_PATH="Text\ Generation\ WebUI/text-generation-webui"
if [[ "$SOLUTION" == *cpu ]]; then
BUILD_ARGS="--build-arg GPU_CHOICE=N"
elif [[ "$SOLUTION" == *gpu ]]; then
BUILD_ARGS="--build-arg GPU_CHOICE=A"
fi
elif [ "$SOLUTION" == "comfyui" ]; then
DOCKERFILE="./ComfyUI/Dockerfile"
DOCKERFILE_CONTEXT="./ComfyUI/"
Expand All @@ -58,6 +66,7 @@ jobs:
echo "DOCKERFILE=$DOCKERFILE" >> $GITHUB_ENV
echo "DOCKERFILE_CONTEXT=$DOCKERFILE_CONTEXT" >> $GITHUB_ENV
echo "SUBMODULE_PATH=$SUBMODULE_PATH" >> $GITHUB_ENV
echo "BUILD_ARGS=$BUILD_ARGS" >> $GITHUB_ENV
- name: Checkout git submodules
run: |
Expand Down Expand Up @@ -88,7 +97,9 @@ jobs:
- name: Build Docker image and save to file
run: |
IMAGE_FILE="$SOLUTION-image-b${{ github.run_id }}.tar.gz"
docker build -t $SOLUTION:latest -f "$DOCKERFILE" "$DOCKERFILE_CONTEXT"
echo "docker build -t $SOLUTION:latest -f $DOCKERFILE $(echo $BUILD_ARGS) $DOCKERFILE_CONTEXT"
docker build -t $SOLUTION:latest -f "$DOCKERFILE" $(echo $BUILD_ARGS) "$DOCKERFILE_CONTEXT"
docker save $SOLUTION:latest | gzip > $IMAGE_FILE
echo "IMAGE_FILE=$IMAGE_FILE" >> $GITHUB_ENV
Expand Down
6 changes: 5 additions & 1 deletion Text Generation WebUI/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ RUN npm ci &&\

FROM node:20-bookworm

ARG GPU_CHOICE

WORKDIR /home/node/app

RUN mkdir -p /sp/inputs /sp/output /sp/run

COPY --from=builder /home/node/app/text-generation-webui ./text-generation-webui

ENV GPU_CHOICE=$GPU_CHOICE

RUN apt update && apt install -y git &&\
git config --global --add safe.directory /home/node/app/text-generation-webui &&\
chmod +x ./text-generation-webui/start_linux.sh &&\
GPU_CHOICE=A USE_CUDA118=FALSE LAUNCH_AFTER_INSTALL=FALSE INSTALL_EXTENSIONS=FALSE ./text-generation-webui/start_linux.sh &&\
USE_CUDA118=FALSE LAUNCH_AFTER_INSTALL=FALSE INSTALL_EXTENSIONS=FALSE ./text-generation-webui/start_linux.sh &&\
apt remove git -y &&\
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb &&\
dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb &&\
Expand Down

0 comments on commit 8448df9

Please sign in to comment.