-
Notifications
You must be signed in to change notification settings - Fork 121
Make RacksDB dependency optional #683
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
Make RacksDB dependency optional #683
Conversation
5712689 to
199312a
Compare
|
@rezib this one is ready for review. thank you! |
rezib
left a comment
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.
Thank you @faganihajizada for this PR! I have a few comments and a question: how do you manage to install Slurm-web without RacksDB in your case? You're not making RacksDB an optional dependency in pyproject.toml. RPM and deb packages have a strong dependency on RacksDB. What's your plan?
Thanks for review @rezib In our case, we're building Docker containers for Kubernetes deployments. In our Dockerfile, instead of This allows us to install the agent dependencies individually while excluding RacksDB from our container images. My goal here is to keep traditional installations with I am planning to contribute and help you with container images and helm charts for k8s deployments if you are interested. |
OK thanks for these explanations!
Oh yes, of course! |
663224c to
1fd8e89
Compare
1fd8e89 to
81ed32f
Compare
81ed32f to
7f1840a
Compare
Move RacksDB imports inside conditional blocks using lazy loading pattern, allowing the agent to run without RacksDB installed when racksdb.enabled is false. This enables minimal agent deployments where RacksDB features are not needed, reducing container image size and dependencies. Signed-off-by: Rémi Palancher <[email protected]>
7f1840a to
7406f7f
Compare
|
Thank you @faganihajizada for this contribution! |
Summary
RacksDB is marked as an optional dependency in
pyproject.tomlunder the[agent]extra, but the code has unconditional imports at the module level:This causes
ModuleNotFoundErrorwhen running the agent without RacksDB installed.Solution
This PR makes RacksDB imports conditional using the existing
werkzeugoptional import pattern found in the codebase (slurmweb/apps/agent.py):try/except ModuleNotFoundErrorblockTesting
racksdb.enabled=falseracksdb.enabled=truebut RacksDB not installed