Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix running under Docker following 4.0.0rc4 config changes #6009

Merged
merged 5 commits into from
Mar 21, 2024

Conversation

ebr
Copy link
Member

@ebr ebr commented Mar 20, 2024

Summary

  • A new container without an existing root directory would fail to start due to permission issues and being unable to create the config file - this is fixed.

  • The --host CLI argument was removed as part of config optimization, and we were using it in the Dockerfile. Because the default bind host is 127.0.0.1, the app would not be accessible from outside the container (even from local host). Anyway, this PR adds INVOKEAI_HOST and INVOKEAI_PORT to the Dockerfile to provide working defaults that do not require additional intervention from the user.

A couple of other improvements to the dockerized experience:

  • INVOKEAI_ROOT can now be set to a relative path without using a dedicated env var pair for this purpose. The original (HOST_ and CONTAINER_) root dir environment variables are retained because we know some users have these special use cases. The env.sample file now explains their use more thoroughly.
  • No longer pre-install Torch in a separate Docker layer. Thich reduces the image size and removes the need to manually bump Torch/torchvision versions in the Dockerfile - we now just let pip do its thing. We do however still need to maintain the extra-index-url logic in the Dockerfile to ensure cross-GPU compatibility.

QA Instructions

  • on Linux (CUDA and/or ROCm), enter the docker dir, and either execute run.sh or docker compose up - this will run with all defaults.
  • terminate the container (docker compose down), then try to set INVOKEAI_ROOT to a new path on the filesystem, and run it again. In all cases, the container should start and the new 4.0 UI should be usable as expected.

Merge Plan

Merge at will

Checklist

  • The PR has a short but descriptive title
  • Tests added / updated - N/A
  • Documentation added / updated

@github-actions github-actions bot added docker python PRs that change python files services PRs that change app services labels Mar 20, 2024
@ebr ebr force-pushed the ebr/docker-fixes-4.0 branch 2 times, most recently from f7fd500 to 596326f Compare March 20, 2024 20:53
@ebr ebr enabled auto-merge (rebase) March 20, 2024 22:56
@ebr ebr merged commit a5771f6 into main Mar 21, 2024
14 checks passed
@ebr ebr deleted the ebr/docker-fixes-4.0 branch March 21, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker python PRs that change python files services PRs that change app services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants