Skip to content

Commit 2e6b5f1

Browse files
committed
Sync docs and README and add deployment and launcher docs
1 parent 3800fe1 commit 2e6b5f1

File tree

14 files changed

+335
-124
lines changed

14 files changed

+335
-124
lines changed

README.md

Lines changed: 174 additions & 84 deletions
Large diffs are not rendered by default.

docs/source/credits.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Credits
22
=======
33

4-
Original author : Samuel Garcia, CNRS, Lyon, France
4+
Original author: Samuel Garcia, CNRS, Lyon, France
55

66
This work is a port of the old `tridesclous.gui` submodule on top of
77
`spikeinterface <https://github.com/SpikeInterface/spikeinterface>`_.

docs/source/custom_layout.rst

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,26 @@ You can create your own custom layout by specifying which views you'd like
55
to see, and where they go. The basic window layout supports eight "zones",
66
which are laid out as follows:
77

8+
.. code-block:: bash
89
9-
+---------------+--------------+
10-
| zone1 zone2 | zone3 zone4 |
11-
+ + +
12-
| zone5 zone6 | zone7 zone8 |
13-
+---------------+--------------+
10+
+---------------+--------------+
11+
| zone1 zone2 | zone3 zone4 |
12+
+ + +
13+
| zone5 zone6 | zone7 zone8 |
14+
+---------------+--------------+
1415
1516
If a zone has free space below it or to the right of it, it will try to use it.
1617
Stretching downwards takes precedence over stretching rightwards.
1718
E.g. suppose your layout is only non-empty in zones 1, 4, 5, 6 and 7:
1819

19-
+-------------+----------+
20-
| zone1 -- | -- zone4 |
21-
+-------------+----------+
22-
| zone5 zone6 | zone7 -- |
23-
+-------------+----------+
20+
.. code-block:: bash
21+
22+
+---------------+--------------+
23+
| zone1 | zone4 |
24+
+ + +
25+
| zone5 zone6 | zone7 |
26+
+---------------+--------------+
27+
2428
2529
Then zone1 will stretch right-wards to make a three-zone view. Zone4 will stretch
2630
downwards to make a long two-zone view.

docs/source/deployments.rst

Lines changed: 93 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,95 @@
1-
Deploy the GUI
2-
==============
1+
Deploy the GUI in web mode
2+
==========================
33

4-
TODO:
4+
The :ref:`launching` section showed how you can launch the GUI on a local workstation.
55

6-
local, central server, cloud
6+
To recap, you can launch the GUI in web mode by running:
7+
8+
.. code-block:: bash
9+
10+
sigui --mode=web /path/for/my/sorting_analyzer
11+
12+
which will start a server on your localhost:
13+
14+
.. code-block:: bash
15+
16+
Launching server at http://localhost:43957
17+
18+
19+
However, the GUI can also be deployed on a remote server, and accessed through a web
20+
browser or directly in the cloud, thanks to its web mode.
21+
22+
Deploying on a remote lab server
23+
--------------------------------
24+
25+
If you want to deploy the GUI on a remote lab server, the GUI can be used by multiple users
26+
with VPN access to the server.
27+
28+
To setup the web GUI on a remote server, follow these steps:
29+
30+
1. Choose a server machine in your lab network (e.g. "my-lab-server") that is accessible
31+
through VPN by all lab members.
32+
33+
2. Install spikeinterface-gui and its dependencies on the server machine.
34+
35+
3. Launch the GUI launcher on the server machine with the following command:
36+
37+
.. code-block:: bash
38+
39+
sigui --mode=web --address=auto-ip
40+
41+
If all your analyzers will be in the same root folder (or in subfolders), you can also specify the ``--root-folder`` option:
42+
43+
.. code-block:: bash
44+
45+
sigui --mode=web --address=auto-ip --root-folder=/path/to/my/analyzers
46+
47+
4. The server will start and display the IP address to access the GUI launcher, e.g.:
48+
49+
.. code-block:: bash
50+
51+
Launching server at http://SERVER.IP.ADDRESS:43957/launcher
52+
53+
5. Share the displayed IP address with all lab members, so they can connect to the GUI launcher
54+
from their local machines.
55+
56+
57+
Deploying on cloud platforms
58+
----------------------------
59+
60+
The ``spikeinterface-gui`` web mode can also be deployed on cloud platforms such as AWS, GCP, or Azure.
61+
62+
This type of deployment is recommended if all your raw and sorted data are already stored
63+
in the cloud.
64+
65+
You will need a simple wrapper python script that ``Panel`` can serve.
66+
67+
For example, create a file named ``si_launcher.py`` with the following content:
68+
69+
.. code-block:: python
70+
71+
from spikeinterface_gui.launcher import Launcher
72+
73+
launcher = Launcher(backend="panel")
74+
launcher.layout.servable()
75+
76+
Then, you need a ``Dockerfile`` which installs the GUI and serves the panel app as entry point.
77+
Here is a minimal example of a ``Dockerfile``:
78+
79+
.. code-block:: docker
80+
81+
FROM python:3.9-slim
82+
83+
RUN pip install spikeinterface-gui[web]
84+
85+
COPY si_launcher.py /si_launcher.py
86+
87+
EXPOSE 8000
88+
89+
ENTRYPOINT ["sh", "-c", "panel serve /si_launcher.py --address 0.0.0.0 --port 8000 --allow-websocket-origin ${ALLOW_WEBSOCKET_ORIGIN} --keep-alive 10000 --warm"]
90+
91+
92+
You can then build and run the Docker image on your cloud platform of choice, making sure to set the
93+
``ALLOW_WEBSOCKET_ORIGIN`` environment variable to the domain name or IP address of your server.
94+
95+
Note that you can also customize the launcher script to pre-load specific sorting analyzers or set a root folder.

docs/source/developers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ For developers
44
Message from dictator (Samuel)
55
------------------------------
66

7-
Contrary to the spikeinterface package, for the development of this viewer
8-
all good practices of coding are deliberately put aside: no test, no CI, no auto formatting, no doc, ...
7+
Contrary to the spikeinterface package, for the development of this viewer
8+
all good practices of coding are deliberately put aside: no test, no CI, no auto formatting, no doc, ...
99
Feel free to contribute, it is an open wild zone. Code anarchists are very welcome.
10-
So in this mess, persona non grata: pre-commit, black, pytest fixture, ...
10+
So in this mess, persona non grata : pre-commit, black, pytest fixture, ...
File renamed without changes.
File renamed without changes.
38.2 KB
Loading
30.4 KB
Loading

docs/source/index.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ SpikeInterface-GUI documentation
1010
GUI for the ``SortingAnalyzer`` object from SpikeInterface.
1111

1212
This is a cross platform interactive viewer to inspect the final results
13-
and quality of any spike sorter supported by spikeinterface
14-
(kilosort, spykingcircus, tridesclous, mountainssort, yass, ironclust, herdingspikes, hdsort, klusta...)
13+
and quality of any spike sorter supported by ``spikeinterface``.
1514

1615
This interactive GUI offers several views that dynamically refresh other views.
17-
This allows us to very quickly check the strengths and weaknesses of any sorter output.
16+
This allows us to very quickly check the strengths and weaknesses of any sorter output
17+
and to perform manual curation.
1818

1919
This can be used as a replacement of `phy <https://github.com/cortex-lab/phy>`_.
2020

@@ -25,7 +25,7 @@ Desktop
2525

2626
This a local desktop app using internally Qt, fast and easy when the data is local
2727

28-
.. image:: images/desktop.png
28+
.. image:: images/gui_desktop.png
2929
:alt: desktop
3030
:width: 600px
3131
:align: center
@@ -36,7 +36,7 @@ Web
3636
This is a web app internally using Panel, useful when the data is remote
3737

3838

39-
.. image:: images/web.png
39+
.. image:: images/gui_web.png
4040
:alt: web
4141
:width: 600px
4242
:align: center

0 commit comments

Comments
 (0)