update .dockerignore and scripts

This commit is contained in:
mauwii 2023-02-07 02:07:40 +01:00 committed by Matthias Wild
parent cdb3e18b80
commit 07a9062e1f
4 changed files with 18 additions and 11 deletions

View File

@ -11,13 +11,13 @@
# ignore frontend but whitelist dist # ignore frontend but whitelist dist
invokeai/frontend/** invokeai/frontend/**
!invokeai/frontend/dist !invokeai/frontend/dist/**
# ignore invokeai/assets but whitelist invokeai/assets/web # ignore invokeai/assets but whitelist invokeai/assets/web
invokeai/assets invokeai/assets/**
!invokeai/assets/web !invokeai/assets/web/*.png
# ignore python cache # ignore python cache and build artifacts
**/__pycache__ **/__pycache__
**/*.py[cod] **/*.py[cod]
**/*.egg-info **/*.egg-info

View File

@ -8,12 +8,12 @@ set -e
# CPU: https://download.pytorch.org/whl/cpu # CPU: https://download.pytorch.org/whl/cpu
# as found on https://pytorch.org/get-started/locally/ # as found on https://pytorch.org/get-started/locally/
SCRIPTDIR=$(dirname "$0") SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
cd "$SCRIPTDIR" || exit 1 cd "$SCRIPTDIR" || exit 1
source ./env.sh source ./env.sh
DOCKERFILE=${INVOKE_DOCKERFILE:-Dockerfile} DOCKERFILE=${INVOKE_DOCKERFILE:-./Dockerfile}
# print the settings # print the settings
echo -e "You are using these values:\n" echo -e "You are using these values:\n"
@ -21,9 +21,10 @@ echo -e "Dockerfile:\t\t${DOCKERFILE}"
echo -e "index-url:\t\t${PIP_EXTRA_INDEX_URL:-none}" echo -e "index-url:\t\t${PIP_EXTRA_INDEX_URL:-none}"
echo -e "Volumename:\t\t${VOLUMENAME}" echo -e "Volumename:\t\t${VOLUMENAME}"
echo -e "Platform:\t\t${PLATFORM}" echo -e "Platform:\t\t${PLATFORM}"
echo -e "Registry:\t\t${CONTAINER_REGISTRY}" echo -e "Container Registry:\t${CONTAINER_REGISTRY}"
echo -e "Repository:\t\t${CONTAINER_REPOSITORY}" echo -e "Container Repository:\t${CONTAINER_REPOSITORY}"
echo -e "Container Tag:\t\t${CONTAINER_TAG}" echo -e "Container Tag:\t\t${CONTAINER_TAG}"
echo -e "Container Flavor:\t${CONTAINER_FLAVOR}"
echo -e "Container Image:\t${CONTAINER_IMAGE}\n" echo -e "Container Image:\t${CONTAINER_IMAGE}\n"
# Create docker volume # Create docker volume
@ -41,5 +42,5 @@ DOCKER_BUILDKIT=1 docker build \
${CONTAINER_FLAVOR:+--build-arg="CONTAINER_FLAVOR=${CONTAINER_FLAVOR}"} \ ${CONTAINER_FLAVOR:+--build-arg="CONTAINER_FLAVOR=${CONTAINER_FLAVOR}"} \
${PIP_EXTRA_INDEX_URL:+--build-arg="PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}"} \ ${PIP_EXTRA_INDEX_URL:+--build-arg="PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}"} \
${PIP_PACKAGE:+--build-arg="PIP_PACKAGE=${PIP_PACKAGE}"} \ ${PIP_PACKAGE:+--build-arg="PIP_PACKAGE=${PIP_PACKAGE}"} \
--file="${DOCKERFILE:-./Dockerfile}" \ --file="${DOCKERFILE}" \
.. ..

View File

@ -1,6 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [[ -z "$PIP_EXTRA_INDEX_URL" ]]; then if [[ -z "$PIP_EXTRA_INDEX_URL" ]]; then
# Activate virtual environment if not already activated
if [[ -z $VIRTUAL_ENV ]]; then
[[ -e "$(dirname "${BASH_SOURCE[0]}")/../.venv/bin/activate" ]] \
&& source "$(dirname "${BASH_SOURCE[0]}")/../.venv/bin/activate"
fi
# Decide which container flavor to build if not specified # Decide which container flavor to build if not specified
if [[ -z "$CONTAINER_FLAVOR" ]] && python -c "import torch" &>/dev/null; then if [[ -z "$CONTAINER_FLAVOR" ]] && python -c "import torch" &>/dev/null; then
# Check for CUDA and ROCm # Check for CUDA and ROCm
@ -26,7 +31,8 @@ fi
# Variables shared by build.sh and run.sh # Variables shared by build.sh and run.sh
REPOSITORY_NAME="${REPOSITORY_NAME-$(basename "$(git rev-parse --show-toplevel)")}" REPOSITORY_NAME="${REPOSITORY_NAME-$(basename "$(git rev-parse --show-toplevel)")}"
VOLUMENAME="${VOLUMENAME-"${REPOSITORY_NAME,,}_data"}" REPOSITORY_NAME="${REPOSITORY_NAME,,}"
VOLUMENAME="${VOLUMENAME-"${REPOSITORY_NAME}_data"}"
ARCH="${ARCH-$(uname -m)}" ARCH="${ARCH-$(uname -m)}"
PLATFORM="${PLATFORM-Linux/${ARCH}}" PLATFORM="${PLATFORM-Linux/${ARCH}}"
INVOKEAI_BRANCH="${INVOKEAI_BRANCH-$(git branch --show)}" INVOKEAI_BRANCH="${INVOKEAI_BRANCH-$(git branch --show)}"

View File

@ -4,7 +4,7 @@ set -e
# How to use: https://invoke-ai.github.io/InvokeAI/installation/INSTALL_DOCKER/#run-the-container # How to use: https://invoke-ai.github.io/InvokeAI/installation/INSTALL_DOCKER/#run-the-container
# IMPORTANT: You need to have a token on huggingface.co to be able to download the checkpoints!!! # IMPORTANT: You need to have a token on huggingface.co to be able to download the checkpoints!!!
SCRIPTDIR=$(dirname "$0") SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
cd "$SCRIPTDIR" || exit 1 cd "$SCRIPTDIR" || exit 1
source ./env.sh source ./env.sh