Installer rewrite in Python#2338
Conversation
Task list (still to be done)TODO (some blocking):
debt (non-blockers):
known bugs:
future/feat:
decisions (fyi / to discuss):
WRITE TESTS 😭
Might spin these out into separate issues...... |
|
My experience with the installer on windows has been nothing short of pleasant. Extremely nice work. I haven’t tried latest version - what feedback/input do you need? |
|
I'm looking forward to testing this. Today I'm still ironing out bugs with
diffusers, but I'll be back to evaluating the installation process on
wednesday or Thursday, depending on how it goes.
…On Tue, Jan 17, 2023 at 7:31 AM Kent Keirsey ***@***.***> wrote:
My experience with the installer on windows has been nothing short of
pleasant. Extremely nice work.
I haven’t tried latest version - what feedback/input do you need?
—
Reply to this email directly, view it on GitHub
<#2338 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA3EVNRVY33WNFD33GU34DWS2GKLANCNFSM6AAAAAAT4ODDGE>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
fdb516b to
2264f9c
Compare
Thank you <3 I'm interested to know if any path aside from the "happy path" (i.e. "yes to all" on a brand-new runtime dir) breaks in any way. For example, does selection of paths on a different drive work? Destination with spaces in the path name? those kind of edge cases. I tested a lot of it on Linux, but my Windows VM is way too slow (and lacks GPU) for any meaningful testing. Thanks! |
Still patiently waiting for this one 😁 |
95b849a to
1044fc5
Compare
There is a race condition affecting the 'tempfile' module on Windows. A PermissionsError is raised when cleaning up the temp dir Python3.10 introduced a flag to suppress this error. Windows + Python3.9 users will receive an unpleasant stack trace for now
This allows reliable distribution of the initial 'configs' directory with the Python package, and enables the configuration script to be running from anywhere, as long as the virtual environment is available on the sys.path
the 'setup.py install' method is deprecated in favour of a build-system independent format: https://peps.python.org/pep-0517/ this is needed to install dependencies that don't have a pyproject.toml file (only setup.py) in a forward-compatible way
if the config directory is missing, initialize it using the standard process of copying it over, instead of failing to create the config file this can happen if the user is re-running the config script in a directory which already has the init file, but no configs dir
…h experience on Linux/Mac - install.sh is now a thin wrapper around the pythonized install script - install.bat not done yet - to follow - user messaging is tailored to the current platform (paste shortcuts, file paths, etc) - emit invoke.sh/invoke.bat scripts to the runtime dir - improve launch scripts (add help option, etc) - only emit the platform-specific scripts
- remove redundant options (unchanged from defaults) - don't test 3rd party code - omit fully covered files from coverage report - gitignore junit (xml) test output directory
- add torch MPS fallback directly to CLI.py - rename CLI scripts with `invoke-...` prefix - delete long-deprecated scripts - add a missing package dependency - delete setup.py as obsolete
…stalling from a downloaded release .zip
… the wheel reduces wheel size to 3MB from 27MB
…stall from bundled .whl by default
…new invokeai-configure command
…er after configuration
|
The commit log for this has gotten ridiculous. Opening a new PR for sanity. |
Summary
This PR rewrites the core of the installer in Python for cross-platform compatibility. Filesystem path manipulation, platform/arch decisions and various edge cases are handled in a more convenient fashion. The original
install.bat.in/install.sh.inscripts are kept as entrypoints for their respective OSs, but only serve as thin wrappers to the Python module.TL;DR
Test the "happy path":
$ python3 installer/main.py --root <path_to_somewhere> --yesRemove the
--yesfor interactive testing.Details
Downloading of specific .zip bundles (refs) from Github is not yet implemented; this right now functions as a more polished "source" installer. The
pip-based install and ability to place the virtualenv outside of the runtime dir are not yet implemented, may be added to this or a future PR.Introduces a new
ldm/invoke/configmodule and moves theconfigure_invokeaiscript into it. Note: this supports a separate set of changes I'm almost ready to push to theconfigmodule, which improve runtime directory management and validation. They are not a part of this PR yet, but will be soon™. Omitted for now for better testability and to keep rebasing to a minimum.more testing
Because the installer isn't yet standalone and doesn't pull the source tree from Github, it needs to be tested from a cloned copy of this repo, with this branch checked out.
See TODO checklist in a comment below for things that are known broken . The "happy path" should be very reliable. Changing filesystem paths should also be reliable. Please test "weird" scenarios (delete the
configsdir after installation? etc), in addition to the "happy path".Test the shell script wrappers as well:
installer/install.*.in(as appropriate for your OS) such that it doesn't have the.inextensioncdto somewhere else on your system. It should work regardless of your CWD.The install script accepts the
--root <path>argument to install in a location that is different from the default, and--yesfor a hands-off install (this does not yet work on Windows!!).The install script should go through the entire process of creating the venv, installing the dependencies and the app, and then handing over to the config script.
There are still many bugs! Checklist posted as a separate comment.