Spaces:
Running
Running
BioNemo demo (#84)
Browse files* Add BioNeMo integration, single demo for now
---------
Co-authored-by: JMLizano <[email protected]>
Co-authored-by: Daniel Darabos <[email protected]>
lynxkite-app/src/lynxkite_app/__main__.py
CHANGED
|
@@ -6,7 +6,13 @@ import os
|
|
| 6 |
def main():
|
| 7 |
port = int(os.environ.get("PORT", "8000"))
|
| 8 |
reload = bool(os.environ.get("LYNXKITE_RELOAD", ""))
|
| 9 |
-
uvicorn.run(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
if __name__ == "__main__":
|
|
|
|
| 6 |
def main():
|
| 7 |
port = int(os.environ.get("PORT", "8000"))
|
| 8 |
reload = bool(os.environ.get("LYNXKITE_RELOAD", ""))
|
| 9 |
+
uvicorn.run(
|
| 10 |
+
"lynxkite_app.main:app",
|
| 11 |
+
host="0.0.0.0",
|
| 12 |
+
port=port,
|
| 13 |
+
reload=reload,
|
| 14 |
+
loop="asyncio",
|
| 15 |
+
)
|
| 16 |
|
| 17 |
|
| 18 |
if __name__ == "__main__":
|
lynxkite-app/web/src/workspace/nodes/NodeWithVisualization.tsx
CHANGED
|
@@ -10,8 +10,8 @@ const NodeWithVisualization = (props: any) => {
|
|
| 10 |
if (!opts || !chartsRef.current) return;
|
| 11 |
chartsInstanceRef.current = echarts.init(chartsRef.current, null, {
|
| 12 |
renderer: "canvas",
|
| 13 |
-
width:
|
| 14 |
-
height:
|
| 15 |
});
|
| 16 |
chartsInstanceRef.current.setOption(opts);
|
| 17 |
const onResize = () => chartsInstanceRef.current?.resize();
|
|
|
|
| 10 |
if (!opts || !chartsRef.current) return;
|
| 11 |
chartsInstanceRef.current = echarts.init(chartsRef.current, null, {
|
| 12 |
renderer: "canvas",
|
| 13 |
+
width: 800,
|
| 14 |
+
height: 800,
|
| 15 |
});
|
| 16 |
chartsInstanceRef.current.setOption(opts);
|
| 17 |
const onResize = () => chartsInstanceRef.current?.resize();
|
lynxkite-graph-analytics/README.md
CHANGED
|
@@ -11,3 +11,44 @@ pip install lynxkite lynxkite-graph-analytics
|
|
| 11 |
```
|
| 12 |
|
| 13 |
Run LynxKite with `NX_CUGRAPH_AUTOCONFIG=True` to enable GPU-accelerated graph data science operations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
```
|
| 12 |
|
| 13 |
Run LynxKite with `NX_CUGRAPH_AUTOCONFIG=True` to enable GPU-accelerated graph data science operations.
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
## BioNemo
|
| 17 |
+
|
| 18 |
+
If you want to use BioNemo operations, then you will have to use the provided Docker image, or
|
| 19 |
+
install BioNemo manually in your environment.
|
| 20 |
+
Take into account that BioNemo needs a GPU to work, you can find the specific requirements
|
| 21 |
+
[here](https://docs.nvidia.com/bionemo-framework/latest/user-guide/getting-started/pre-reqs/).
|
| 22 |
+
|
| 23 |
+
The import of BioNemo operations is gate keeped behing the `LYNXKITE_BIONEMO_INSTALLED` variable.
|
| 24 |
+
BioNemo operations will only be imported if this environment variable is set to true.
|
| 25 |
+
|
| 26 |
+
To build the image:
|
| 27 |
+
|
| 28 |
+
```bash
|
| 29 |
+
# in lynxkite-graph-analytics folder
|
| 30 |
+
$ docker build -f Dockerfile.bionemo -t lynxkite-bionemo ..
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
Take into account that this Dockerfile does not include the lynxkite-lynxscribe package. If you want to include it you will
|
| 34 |
+
need to set up git credentials inside the container.
|
| 35 |
+
|
| 36 |
+
Then, inside the image you can start LynxKite as usual.
|
| 37 |
+
|
| 38 |
+
If you want to do some development, then it is recommend to use the [devcontainers](https://code.visualstudio.com/docs/devcontainers/containers)
|
| 39 |
+
vscode extension. The following is a basic configuration to get started:
|
| 40 |
+
|
| 41 |
+
```json
|
| 42 |
+
// .devcontainer/devcontainer.json
|
| 43 |
+
{
|
| 44 |
+
"name": "Existing Dockerfile",
|
| 45 |
+
"runArgs": [
|
| 46 |
+
"--gpus=all",
|
| 47 |
+
"--shm-size=4g"
|
| 48 |
+
],
|
| 49 |
+
"build": {
|
| 50 |
+
"context": "..",
|
| 51 |
+
"dockerfile": "../lynxkite-graph-analytics/Dockerfile.bionemo"
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
```
|
lynxkite-graph-analytics/src/lynxkite_graph_analytics/__init__.py
CHANGED
|
@@ -14,3 +14,6 @@ from .core import * # noqa (easier access for core classes)
|
|
| 14 |
from . import lynxkite_ops # noqa (imported to trigger registration)
|
| 15 |
from . import networkx_ops # noqa (imported to trigger registration)
|
| 16 |
from . import pytorch_model_ops # noqa (imported to trigger registration)
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
from . import lynxkite_ops # noqa (imported to trigger registration)
|
| 15 |
from . import networkx_ops # noqa (imported to trigger registration)
|
| 16 |
from . import pytorch_model_ops # noqa (imported to trigger registration)
|
| 17 |
+
|
| 18 |
+
if os.environ.get("LYNXKITE_BIONEMO_INSTALLED", "").strip().lower() == "true":
|
| 19 |
+
from . import bionemo_ops # noqa (imported to trigger registration)
|