From 61920e2701c4a9cea94c03ab933c4482458215b7 Mon Sep 17 00:00:00 2001 From: mauwii Date: Tue, 1 Nov 2022 04:09:39 +0100 Subject: [PATCH] update action to use current branch also update build-args of dockerfile and build.sh --- .github/workflows/build-container.yml | 3 +++ docker-build/Dockerfile | 5 +++-- docker-build/build.sh | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index b67c4820d4..c68a40a97f 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -40,3 +40,6 @@ jobs: tags: ${{ env.dockertag }}:latest cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache + build-args: | + invokeai_git=${{ github.repository }} + invokeai_branch=${{ github.ref_name }} diff --git a/docker-build/Dockerfile b/docker-build/Dockerfile index 9b1e42f313..1de6f778bb 100644 --- a/docker-build/Dockerfile +++ b/docker-build/Dockerfile @@ -40,9 +40,10 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* # clone repository, create models.yaml and create symlinks -ARG invokeai_git=https://github.com/invoke-ai/InvokeAI.git +ARG invokeai_git=invoke-ai/InvokeAI +ARG invokeai_branch=main ARG project_name=invokeai -RUN git clone ${invokeai_git} /${project_name} \ +RUN git clone -b ${invokeai_branch} https://github.com/${invokeai_git}.git /${project_name} \ && cp /${project_name}/configs/models.yaml.example /${project_name}/configs/models.yaml \ && ln -s /data/models/v1-5-pruned-emaonly.ckpt /${project_name}/models/ldm/stable-diffusion-v1/v1-5-pruned-emaonly.ckpt \ && ln -s /data/outputs/ /${project_name}/outputs diff --git a/docker-build/build.sh b/docker-build/build.sh index a0e97ca87f..ebd1ca6a41 100755 --- a/docker-build/build.sh +++ b/docker-build/build.sh @@ -9,7 +9,8 @@ source ./docker-build/env.sh || echo "please run from repository root" || exit 1 invokeai_conda_version=${INVOKEAI_CONDA_VERSION:-py39_4.12.0-${platform/\//-}} invokeai_conda_prefix=${INVOKEAI_CONDA_PREFIX:-\/opt\/conda} invokeai_conda_env_file=${INVOKEAI_CONDA_ENV_FILE:-environment.yml} -invokeai_git=${INVOKEAI_GIT:-https://github.com/invoke-ai/InvokeAI.git} +invokeai_git=${INVOKEAI_GIT:-invoke-ai/InvokeAI} +invokeai_branch=${INVOKEAI_BRANCH:-main} huggingface_token=${HUGGINGFACE_TOKEN?} # print the settings @@ -78,5 +79,6 @@ docker build \ --build-arg conda_prefix="${invokeai_conda_prefix}" \ --build-arg conda_env_file="${invokeai_conda_env_file}" \ --build-arg invokeai_git="${invokeai_git}" \ + --build-arg invokeai_branch="${invokeai_branch}" \ --file ./docker-build/Dockerfile \ .