Skip to content

Commit

Permalink
👌 IMPROVE: add aiida_kernel_name option (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell authored Dec 2, 2020
1 parent 6caa8af commit fea2f2b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The role:
- Installs and starts the PostgreSQL and RabbitMQ services
- Installs a designated Python version
- Creates an 'aiida' Python virtual environment and installs aiida-core and plugins into it
- Creates a 'jupyter' Python virtual environment and installs Jupyter and Jupyter Lab into it, then links the 'aiida' virtual environment as a kernel.
- Creates a 'jupyter' Python virtual environment and installs Jupyter and Jupyter Lab into it, then links the virtual environment as a kernel.
- Adds [virtualenwrapper](https://virtualenvwrapper.readthedocs.io) for managing the virtual environments.
- Creates an AiiDA profile and starts the daemon
- Starts the AiiDA REST API
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ aiida_pseudopotentials:
# start AiiDA REST API system service on boot?
aiida_rest_service_enabled: false

aiida_kernel_name: python3
# default port on which to start jupyter lab with aiida-jupyterlab exec
aiida_jupyter_port: 8890

Expand Down
6 changes: 3 additions & 3 deletions tasks/jupyter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
state: link

- name: Add {{ aiida_venv }} to jupyter kernels
shell: "{{ aiida_venv }}/bin/python -m ipykernel install --name aiida --user"
shell: "{{ aiida_venv }}/bin/python -m ipykernel install --name {{ aiida_kernel_name }} --user"
args:
creates: "${HOME}/.local/share/jupyter/kernels/aiida/kernel.json"
creates: "${HOME}/.local/share/jupyter/kernels/{{ aiida_kernel_name }}/kernel.json"

- name: Create ipython config folder
file:
Expand Down Expand Up @@ -79,4 +79,4 @@
option: "usage"
value: >-
Jupyter is installed in a Python {{ aiida_python_version }} venv: {{ aiida_jupyter_venv }}.
Type 'aiida-jupyterlab' to launch Jupyter Lab, and select the 'aiida' kernel.
Type 'aiida-jupyterlab' to launch Jupyter Lab, and select the '{{ aiida_kernel_name }}' kernel.
2 changes: 1 addition & 1 deletion templates/jupyterlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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' --port=${1:-{{ aiida_jupyter_port }}}
jupyter lab --MultiKernelManager.default_kernel_name='{{ aiida_kernel_name }}' --port=${1:-{{ aiida_jupyter_port }}}
fi

0 comments on commit fea2f2b

Please sign in to comment.