Skip to content

Commit a59189b

Browse files
committed
Update docs to include websockets mode as per discussion
1 parent d51e45a commit a59189b

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

docs/source/getting-started.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ req = json.loads(REQUEST)
4242
res = dict(data=np.random.randn(5, 4).tolist(), request=req)
4343
print(json.dumps(res))
4444
```
45-
and then run the gateway and point specifically at that notebook, we should see some information printed in the logs:
45+
and then run the gateway in [http-mode](http-mode.md) and point specifically at that notebook, we should see some information printed in the logs:
4646
```bash
4747
jupyter kernelgateway --KernelGatewayApp.api=kernel_gateway.notebook_http --KernelGatewayApp.seed_uri=./my_example.ipynb --port=10100
4848
[KernelGatewayApp] Kernel started: 12ac2daa-c62a-47e4-964a-336734557656
@@ -61,6 +61,19 @@ curl http://127.0.0.1:10100/_api/spec/swagger.json
6161
{"swagger": "2.0", "paths": {"/hello/world": {"get": {"responses": {"200": {"description": "Success"}}}}}, "info": {"version": "0.0.0", "title": "my_example"}}
6262
```
6363

64+
You can also run in the default [websocket-mode](websocket-mode.md):
65+
```bash
66+
jupyter kernelgateway --KernelGatewayApp.api=kernel_gateway.jupyter_websocket --port=10100
67+
[KernelGatewayApp] Jupyter Kernel Gateway at http://127.0.0.1:10100
68+
```
69+
and again notice the output in the logs. This time we didn't point to a specific notebook but you can test against the kernelspecs endpoint or the swagger endpoint:
70+
```bash
71+
curl http://127.0.0.1:10100/api/kernelspecs
72+
{"default": "python3", "kernelspecs": {"python38364bit38conda21f48c44b19044fba5c7aa244072a647": {"name": "python38364bit38conda21f48c44b19044fba5c7aa244072a647", ...
73+
```
74+
75+
For more details running-mode sections [websocket-mode](websocket-mode.md) and [http-mode](http-mode.md).
76+
6477
**NOTE: Watch out for notebooks that run things on import as this might cause the gateway server to crash immediately and the log messages are not always obvious.**
6578

6679
## Running using a docker-stacks image

0 commit comments

Comments
 (0)