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

Backend-defined Dependencies #1834

Merged
merged 68 commits into from
Jun 11, 2023
Merged

Backend-defined Dependencies #1834

merged 68 commits into from
Jun 11, 2023

Conversation

joeyballentine
Copy link
Member

@joeyballentine joeyballentine commented May 25, 2023

Mostly finished. I just need to review everything because I'm sure I left tons of commented-out code everywhere and probably just need to clean stuff up as well. But functionally its working.

This PR defines dependencies on the backend side. This means dependencies are linked directly to a package now.

The python process also installs all the core dependencies itself through pip commands in a subprocess. This allows someone to run the backend remotely and still have all the core deps be installed. The core deps just get auto-installed the way they did before.

run.py now contains some imports that are required to be in that order. Basically, it imports the stuff that checks and installs the dependencies before doing anything else. It also force installs sanic, sanic-cors, and semver before doing any others.

This also implements the nvml python package to check for an nvidia GPU on the backend side rather than on the frontend. this allows us to do the same GPU checks as before, only without needing to search for nvidia smi.

What this doesn't have is the ability to install optional dependencies through the backend. I'll do that in a separate PR.

Copy link
Member Author

@joeyballentine joeyballentine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TLDR: TODO is to clean up come comments and unused code. I also need to test what happens on a fresh start.

backend/src/packages/chaiNNer_standard/__init__.py Outdated Show resolved Hide resolved
backend/src/packages/chaiNNer_standard/__init__.py Outdated Show resolved Hide resolved
backend/src/setup_deps.py Outdated Show resolved Hide resolved
src/main/backend/setup.ts Outdated Show resolved Hide resolved
@joeyballentine
Copy link
Member Author

joeyballentine commented May 26, 2023

So this has an issue: Starting up the backend for the first time takes some time due to the deps being installed. I'm not really sure what to do about that, since we time out the backend if it doesn't respond within a certain time. gonna have to think about this a bit

src/common/dependencies.ts Show resolved Hide resolved
backend/src/api.py Outdated Show resolved Hide resolved
backend/src/api.py Outdated Show resolved Hide resolved
backend/src/api.py Show resolved Hide resolved
backend/src/gpu.py Outdated Show resolved Hide resolved
backend/src/gpu.py Show resolved Hide resolved
backend/src/server.py Outdated Show resolved Hide resolved
src/common/Backend.ts Outdated Show resolved Hide resolved
src/common/dependencies.ts Outdated Show resolved Hide resolved
src/common/dependencies.ts Outdated Show resolved Hide resolved
src/common/dependencies.ts Outdated Show resolved Hide resolved
src/renderer/splash.tsx Outdated Show resolved Hide resolved
src/main/gui/main-window.ts Show resolved Hide resolved
src/main/gui/main-window.ts Outdated Show resolved Hide resolved
backend/src/dependencies/store.py Outdated Show resolved Hide resolved
src/renderer/main.tsx Outdated Show resolved Hide resolved
src/renderer/splash.tsx Outdated Show resolved Hide resolved
@joeyballentine joeyballentine merged commit 5322d64 into main Jun 11, 2023
10 checks passed
@joeyballentine joeyballentine deleted the backend-deps-wip branch June 11, 2023 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants