Docker changes

The .github folder was causing workflow errors for everyone who didn't configure this correctly. I have updated the docker with the latest ideas for flexibility. If a quick build is desirable people can build upon the official KoboldAI United image a seperate base image should not be needed.
This commit is contained in:
Henk
2023-01-05 19:57:46 +01:00
parent b80bad9c3d
commit 9b9ff307e7
6 changed files with 21 additions and 88 deletions

View File

@@ -1,30 +0,0 @@
name: Build Docker
on:
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./docker-standalone/Dockerfile.koboldai
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/koboldai:nightly

View File

@@ -1,8 +1,9 @@
FROM debian
RUN apt update && apt install wget aria2 git bzip2 -y
RUN git clone https://github.com/koboldai/koboldai-client /opt/koboldai
RUN git clone https://github.com/henk717/koboldai /opt/koboldai
WORKDIR /opt/koboldai
RUN ./install_requirements.sh cuda
COPY docker-helper.sh /opt/koboldai/docker-helper.sh
RUN chmod +x /opt/koboldai/docker-helper.sh
EXPOSE 5000/tcp
CMD /opt/koboldai/docker-helper.sh

View File

@@ -1,9 +0,0 @@
FROM debian
WORKDIR /opt/koboldai
COPY ./environments /opt/koboldai/environments
COPY ./install_requirements.sh /opt/koboldai
USER root
RUN apt update && apt install wget aria2 git bzip2 python3 python3-venv -y
RUN ./install_requirements.sh cuda;rm -rf ~/.cache/pip
RUN git clone https://github.com/db0/KoboldAI-Horde-Bridge /opt/koboldai/KoboldAI-Horde-Bridge
ENV PATH=/opt/conda/bin/:$PATH

View File

@@ -1,10 +0,0 @@
FROM ebolam/koboldai_base
EXPOSE 5000/tcp
ENV remote=true
ENV quiet=true
ENV override_delete=true
ENV override_rename=true
ENV update=true
WORKDIR /opt/koboldai
COPY . /opt/koboldai
CMD ./docker-standalone/docker-helper_new.sh

View File

@@ -1,47 +1,49 @@
#!/bin/bash
cd /opt/koboldai
git pull --recurse-submodules && ./install_requirements.sh cuda
if [[ -n update ]];then
git pull --recurse-submodules && ./install_requirements.sh cuda
fi
if [[ ! -v KOBOLDAI_DATADIR ]];then
mkdir /content
KOBOLDAI_DATADIR=/content
fi
mkdir $KOBOLDAI_DATADIR/stories
if [[ ! -v KOBOLDAI_MODELDIR ]];then
mkdir $KOBOLDAI_MODELDIR/models
mkdir $KOBOLDAI_MODELDIR/functional_models
fi
mkdir $KOBOLDAI_DATADIR/stories
mkdir $KOBOLDAI_DATADIR/settings
mkdir $KOBOLDAI_DATADIR/softprompts
mkdir $KOBOLDAI_DATADIR/userscripts
#mkdir $KOBOLDAI_MODELDIR/cache
mkdir $KOBOLDAI_DATADIR/presets
mkdir $KOBOLDAI_DATADIR/themes
cp -rn stories/* $KOBOLDAI_DATADIR/stories/
cp -rn userscripts/* $KOBOLDAI_DATADIR/userscripts/
cp -rn softprompts/* $KOBOLDAI_DATADIR/softprompts/
rm stories
rm -rf stories/
rm userscripts
rm -rf userscripts/
rm softprompts
rm -rf softprompts/
cp -rn presets/* $KOBOLDAI_DATADIR/presets/
cp -rn themes/* $KOBOLDAI_DATADIR/themes/
if [[ ! -v KOBOLDAI_MODELDIR ]];then
rm models
rm -rf models/
#rm cache
#rm -rf cache/
fi
ln -s $KOBOLDAI_DATADIR/stories/ stories
ln -s $KOBOLDAI_DATADIR/settings/ settings
ln -s $KOBOLDAI_DATADIR/softprompts/ softprompts
ln -s $KOBOLDAI_DATADIR/userscripts/ userscripts
if [[ ! -v KOBOLDAI_MODELDIR ]];then
ln -s $KOBOLDAI_MODELDIR/models/ models
#ln -s $KOBOLDAI_MODELDIR/cache/ cache
ln -s $KOBOLDAI_MODELDIR/functional_models/ functional_models
fi
for FILE in $KOBOLDAI_DATADIR*
do
FILENAME="$(basename $FILE)"
rm /opt/koboldai/$FILENAME
rm -rf /opt/koboldai/$FILENAME
ln -s $FILE /opt/koboldai/
done
PYTHONUNBUFFERED=1 ./play.sh --remote --quiet --override_delete --override_rename

View File

@@ -1,21 +0,0 @@
#!/bin/bash
cd /opt/koboldai
if [[ -n update ]];then
git pull --recurse-submodules
fi
#The goal here is to allow any directory in /content to be mapped to the appropriate dir in the koboldai dir
if [[ ! -d "/content" ]];then
mkdir /content
fi
for FILE in /content/*
do
FILENAME="$(basename $FILE)"
rm -rf /opt/koboldai/$FILENAME
ln -s $FILE /opt/koboldai/
done
#Previous parameters are now env vars in the docker container so they can be overwritten as desired
PYTHONUNBUFFERED=1 ./play.sh