Skip to content

Commit 3b8ea53

Browse files
committed
Fix authentication token generation. Update Jupyter docs.
1 parent cc46332 commit 3b8ea53

File tree

3 files changed

+41
-5
lines changed

3 files changed

+41
-5
lines changed

JUPYTER.rst

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,46 @@ kernel::
104104
There is a sample `schwarzschild.ipynb` in the `examples` directory.
105105

106106

107+
107108
Setting up a Jupyterhub server for Cadabra
108109
------------------------------------------
109110

110-
First install miniconda as per the instructions above. Then do::
111+
The following instructions setup a JupyterHub installation using 'The
112+
Littlest JupyterHub' (TLJH). These instructions have been tested on a
113+
clean Ubuntu 18.04 installation.
114+
115+
First install TLJH as per the instructions at::
116+
117+
https://the-littlest-jupyterhub.readthedocs.io/en/latest/install/custom-server.html
118+
119+
(note that you *first* need to do a sudo command, otherwise the
120+
installer will ask for the password but you won't see that prompt,
121+
making it look like the installation process hangs).
122+
123+
Become root (you cannot write into `/opt/tljh` otherwise) and set the
124+
conda path using::
125+
126+
sudo su
127+
export PATH=/opt/tljh/user/bin:${PATH}
128+
129+
Install the prerequisites with::
130+
131+
conda install cmake pkg-config glibmm zeromq cppzmq xtl cryptopp \
132+
sqlite util-linux xeus nlohmann_json sympy \
133+
-c conda-forge
134+
135+
Build the Cadabra Jupyter kernel with::
136+
137+
cd cadabra2
138+
mkdir build
139+
cd build
140+
cmake -DENABLE_JUPYTER=ON -DENABLE_FRONTEND=OFF \
141+
-DCMAKE_INCLUDE_PATH=/opt/tljh/user/include \
142+
-DCMAKE_LIBRARY_PATH=/opt/tljh/user/lib \
143+
-DCMAKE_INSTALL_PREFIX=/opt/tljh/user/ \
144+
..
145+
make install
111146

112-
conda install jupyterhub
147+
The 'new' button in the Jupyterhub file browser should now offer you
148+
the option of creating a new Cadabra notebook.
113149

client_server/Server.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ using websocketpp::lib::bind;
3030
Server::Server()
3131
: return_cell_id(std::numeric_limits<uint64_t>::max()/2)
3232
{
33-
// FIXME: we do not actually do anything with this.
34-
auto gen = boost::uuids::random_generator();
35-
auto authentication_uuid = gen();
33+
boost::uuids::uuid authentication_uuid = boost::uuids::random_generator()();
3634
authentication_token = boost::uuids::to_string( authentication_uuid );
35+
// FIXME: we do not actually do anything with this.
3736
socket_name="tcp://localhost:5454";
3837
init();
3938
}

client_server/cadabra-jupyter-kernel.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#pragma once
33

44
#include "xeus/xinterpreter.hpp"
5+
#include "xeus/xjson.hpp"
56
#include "Server.hh"
67

78
using xeus::xinterpreter;

0 commit comments

Comments
 (0)