-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: no frontend build in repo #5253
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
psychedelicious
requested review from
blessedcoolant,
maryhipp,
hipsterusername,
lstein and
ebr
as code owners
December 9, 2023 02:35
psychedelicious
force-pushed
the
feat/no-frontend-build-in-repo
branch
from
December 9, 2023 02:36
adc4029
to
b2146a7
Compare
psychedelicious
requested review from
Kyle0654 and
brandonrising
as code owners
December 9, 2023 02:46
blessedcoolant
approved these changes
Dec 9, 2023
hipsterusername
approved these changes
Dec 9, 2023
psychedelicious
force-pushed
the
feat/ui/add-eslint-unused-imports
branch
from
December 9, 2023 05:10
7f3c9d0
to
bbd63a0
Compare
psychedelicious
force-pushed
the
feat/no-frontend-build-in-repo
branch
from
December 9, 2023 05:36
3bb20c0
to
84a9afa
Compare
blessedcoolant
approved these changes
Dec 9, 2023
In other words, build frontend when creating installer. Changes to `create_installer.sh` - If `python` is not in `PATH` but `python3` is, alias them (well, via function). This is needed on some machines to run the installer without symlinking to `python3`. - Make the messages about pushing tags clearer. The script force-pushes, so it's possible to accidentally take destructive action. I'm not sure how to otherwise prevent damage, so I just added a warning. - Print out `pwd` when prompting about being in the `installer` dir. - Rebuild the frontend - if there is already a frontend build, first checks if the user wants to rebuild it. - Checks for existence of `../build` dir before deleting - if the dir doesn't exist, the script errors and exits at this point. - Format and spell check. Other changes: - Ignore `dist/` folder. - Delete `dist/`. **Note: you may need to use `git rm --cached invokeai/app/frontend/web/dist/` if git still wants to track `dist/`.**
More accurate/clearer messages
Using `-f` is functionally equivalent to first checking if the dir exists before removing it. We just want to ensure the build dir doesn't exists.
psychedelicious
force-pushed
the
feat/no-frontend-build-in-repo
branch
from
December 9, 2023 13:09
3481b15
to
7572044
Compare
- Color outputs - Clarify messages - Do not offer to use existing frontend build (insurance - prevents accidentally using old build)
Potentially confusing and not useful
lstein
approved these changes
Dec 11, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
1 task
12 tasks
Bless you for your work on this one, thx so much @psychedelicious |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What type of PR is this? (check all applicable)
Description
I think it's time to remove the frontend build from the repo.
The intention was to allow contributors to work on the python side of things without needing to worry about the client.
While this is a nice sentiment, it is problematic:
main
, which means if you run onmain
, you have no guarantee that the frontend is compatible with the backendmain
, which is deeply unsafe for them -main
is inherently unstable, and it's possible their database could get borked with an over-eagergit pull
It is for reasons like these that including builds in a repo is not a common practice.
This PR does two things:
create_installer.sh
to build the frontend & makes some minor QoL improvements to the scriptImpact to contributors
If you want to run the app on
main
, you need to install the frontend toolchain. This currently consists ofnodejs
andpnpm
(a modern package manager with a terrible name that has replacedyarn
due to technical issues withyarn
):nodejs
via package manager, suggest LTS v20pnpm
vianpm
pnpm i
frominvokeai/frontend/web
With that installed, you have two options to run the app:
pnpm build
, run the server per usual, and access the app atlocalhost:9090
pnpm dev
, run the server per usual, and access the app atlocalhost:5173
create_installer.sh
changesSee the commit for details, but in briefly, this script now builds the frontend before creating the installer.
If there is already a frontend build but you still want to recreate the installer, say no when asked if you want to rebuild the frontend.
You must have
nodejs
andpnpm
installed to create an installer.Related Tickets & Documents
This has been a recurring discussion since the beginning of the project, so there may be tickets, but I don't know where.
QA Instructions, Screenshots, Recordings
.whl
withpip install path/to/wheel.whl
invokeai-web
I've done this a bunch of times and it works fine.