diff --git a/README.md b/README.md index 0e2e323..5f9d05d 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,12 @@ To start a jupyter lab server: ```console $ aiida-jupyterlab +... + To access the notebook, open this file in a browser: + file:///root/.local/share/jupyter/runtime/nbserver-14617-open.html + Or copy and paste one of these URLs: + http://localhost:8890/?token=a7086764cda7aba8488a767386d57121429958771a8bccb2 + or http://127.0.0.1:8890/?token=a7086764cda7aba8488a767386d57121429958771a8bccb2 ``` ## Development and testing @@ -98,6 +104,26 @@ pip install tox tox ``` +To manually test the created docker container, first run: + +```bash +tox converge +``` + +This will run the ansible role, leaving the container running. +The recommended way to interact with the container is then to use the [VS Code Docker extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker). +Using this you can then attach a visual studio code instance: + +![VS Code Docker extension](./vscode.png) + +Inside the container run `aiida-jupyterlab`, and you will be able to access the supplied URL from your local browser. + +When you are finished with the container, destroy the container with: + +```bash +tox destroy +``` + ## Code style Code style is formatted and linted with [pre-commit](https://pre-commit.com/). diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 2d33c5f..a17d546 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -34,3 +34,5 @@ provisioner: ansible_python_interpreter: /usr/bin/python3 aiida_python_version: "${MOLECULE_PYTHON_VERSION:-3.7}" install_node: "${MOLECULE_INSTALL_NODE:-no}" + # for testing in docker container + aiida_jupyter_extra_args: "--allow-root" diff --git a/templates/jupyterlab.sh b/templates/jupyterlab.sh index 3e76829..87a4c11 100644 --- a/templates/jupyterlab.sh +++ b/templates/jupyterlab.sh @@ -6,5 +6,5 @@ if jupyter notebook list | grep localhost:${1:-{{ aiida_jupyter_port }}}; then echo "already open at: $url" xdg-open $url else - jupyter lab --MultiKernelManager.default_kernel_name='{{ aiida_kernel_name }}' --port=${1:-{{ aiida_jupyter_port }}} + jupyter lab --MultiKernelManager.default_kernel_name='{{ aiida_kernel_name }}' --port=${1:-{{ aiida_jupyter_port }}} {{ aiida_jupyter_extra_args | default('') }} fi diff --git a/vscode.png b/vscode.png new file mode 100644 index 0000000..de2e9bd Binary files /dev/null and b/vscode.png differ