diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index 66d827a5..00000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -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 diff --git a/docker-standalone/Dockerfile b/docker-standalone/Dockerfile index df375a3e..55e80b9f 100644 --- a/docker-standalone/Dockerfile +++ b/docker-standalone/Dockerfile @@ -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 diff --git a/docker-standalone/Dockerfile.base b/docker-standalone/Dockerfile.base deleted file mode 100644 index 049a76db..00000000 --- a/docker-standalone/Dockerfile.base +++ /dev/null @@ -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 diff --git a/docker-standalone/Dockerfile.koboldai b/docker-standalone/Dockerfile.koboldai deleted file mode 100644 index b54fe056..00000000 --- a/docker-standalone/Dockerfile.koboldai +++ /dev/null @@ -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 \ No newline at end of file diff --git a/docker-standalone/docker-helper.sh b/docker-standalone/docker-helper.sh index 5d738e6c..ae334938 100755 --- a/docker-standalone/docker-helper.sh +++ b/docker-standalone/docker-helper.sh @@ -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 diff --git a/docker-standalone/docker-helper_new.sh b/docker-standalone/docker-helper_new.sh deleted file mode 100755 index 1efdfffe..00000000 --- a/docker-standalone/docker-helper_new.sh +++ /dev/null @@ -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