Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Similar to #6215, add update logic that fetches and runs the latest installer.
The main difference is that most of the logic in here is in a python script:
The python script then ends and the
invoke
script picks up. All it needs to do is check if the install script exists, and if so, run it and exit.This works as expected for the macOS/linux
invoke.sh
script.I ported the logic to powershell and it mostly works, but there is some wonkiness when
invokeai-web
and the update helper exit. Powershell doesn't handle errors and exit codes (like when you Ctrl+C) for these non-.NET scripts nicely.Depending on the combination of
$ErrorActionPreference
and whether or not you redirect stderr to stdout, you either catch every raised python error (including handled ones, bc they end up in stderr...) or none, and have to use afinally
block to handle the signal from the python script. You cannot just catch the Ctrl+C and pass, letting theinvoke
script continue. If this sounds confusing, that's because it is.Anyways, I'll revisit the powershell script later, maybe just write it in the batch file instead. Won't be hard, I just really wanted the powershell script to work bc it's so much more intelligible than batch.
Related Issues / Discussions
#6215
QA Instructions
Testing this is a bit convoluted. Two options:
make installer-zip
).--wheel InvokeAI-4.2.0a3-py3-none-any.whl
to install from the wheel.invokeai-web
andinvokeai-update-helper
in your PATH, and the invoke launcher should work and updatepip install -e .
) into the normal install's venvinvoke.sh.in
toinvoke.sh
)invokeai-web
andinvokeai-update-helper
in your PATH, and the invoke launcher should work and updateOk, so then to make this more annoying, once you successfully use the updater to install, you will necessarily end up with a venv that no longer has the update functionality. So to test again, you need to repeat those steps to re-install from this branch, with update functionality...
Merge Plan
This needs testing on multiple platforms (once the windows portion is working), and some coordination for releasing.
Checklist