From 224b09f8fd83b394ffa060a31124099304dd7d9f Mon Sep 17 00:00:00 2001 From: Eugene Brodsky Date: Mon, 30 Oct 2023 12:34:30 -0400 Subject: [PATCH] Enforce Unix line endings in container (#4990) * (fix) enforce Unix (LF) line endings in docker/ directory * (fix) update docker docs wrt line endings on Windows * (fix) static check fixes --- .gitattributes | 1 + docs/installation/040_INSTALL_DOCKER.md | 11 +++++++++++ invokeai/frontend/install/invokeai_update.py | 2 +- pyproject.toml | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 23dfb4efbd..4c9fc0120e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,4 @@ # Only affects text files and ignores other file types. # For more info see: https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/ * text=auto +docker/** text eol=lf \ No newline at end of file diff --git a/docs/installation/040_INSTALL_DOCKER.md b/docs/installation/040_INSTALL_DOCKER.md index a672f71ba8..a550056ce1 100644 --- a/docs/installation/040_INSTALL_DOCKER.md +++ b/docs/installation/040_INSTALL_DOCKER.md @@ -99,3 +99,14 @@ If using an AMD GPU: Use the standard `docker compose up` command, and generally the `docker compose` [CLI](https://docs.docker.com/compose/reference/) as usual. Once the container starts up (and configures the InvokeAI root directory if this is a new installation), you can access InvokeAI at [http://localhost:9090](http://localhost:9090) + +## Troubleshooting / FAQ + +- Q: I am running on Windows under WSL2, and am seeing a "no such file or directory" error. +- A: Your `docker-entrypoint.sh` file likely has Windows (CRLF) as opposed to Unix (LF) line endings, + and you may have cloned this repository before the issue was fixed. To solve this, please change + the line endings in the `docker-entrypoint.sh` file to `LF`. You can do this in VSCode + (`Ctrl+P` and search for "line endings"), or by using the `dos2unix` utility in WSL. + Finally, you may delete `docker-entrypoint.sh` followed by `git pull; git checkout docker/docker-entrypoint.sh` + to reset the file to its most recent version. + For more information on this issue, please see the [Docker Desktop documentation](https://docs.docker.com/desktop/troubleshoot/topics/#avoid-unexpected-syntax-errors-use-unix-style-line-endings-for-files-in-containers) diff --git a/invokeai/frontend/install/invokeai_update.py b/invokeai/frontend/install/invokeai_update.py index cf017dcfeb..ed54a8f10b 100644 --- a/invokeai/frontend/install/invokeai_update.py +++ b/invokeai/frontend/install/invokeai_update.py @@ -91,7 +91,7 @@ def get_extras(): def main(): - versions = [x for x in get_versions() if not (x['draft'] or x['prerelease'])] + versions = [x for x in get_versions() if not (x["draft"] or x["prerelease"])] if invokeai_is_running(): print(":exclamation: [bold red]Please terminate all running instances of InvokeAI before updating.[/red bold]") input("Press any key to continue...") diff --git a/pyproject.toml b/pyproject.toml index d67b096ddc..c0d91cf330 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -206,6 +206,7 @@ exclude = [ "build", "dist", "invokeai/frontend/web/node_modules/", + ".venv*", ] [tool.black]