From b8fcc785616b7a309c2355b14c9f6e633c867f3a Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Wed, 17 Mar 2021 18:39:08 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20Move=20symlinks=20to?= =?UTF-8?q?=20variable=20`aiida=5Fjupyter=5Fsymlink`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- defaults/main.yml | 5 +++++ tasks/jupyter.yml | 13 ++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 53cfd77..654e285 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -149,5 +149,10 @@ aiida_kernel_name: python3 # default port on which to start jupyter lab with aiida-jupyterlab exec aiida_jupyter_port: 8890 +# symlink executubles from the aiida environment into the jupyter one +aiida_jupyter_symlink: +- verdi +- reentry + root_user: root # add vm_headless=false to add a destop shortcut to start jupyter lab diff --git a/tasks/jupyter.yml b/tasks/jupyter.yml index 1edd6b6..f6a83e1 100644 --- a/tasks/jupyter.yml +++ b/tasks/jupyter.yml @@ -9,23 +9,18 @@ python_venv_packages: "{{ aiida_jupyter_packages }}" register: pip_install -- name: Symlink verdi to {{ aiida_jupyter_venv }}/bin +- name: "Symlink {{ item }} to {{ aiida_jupyter_venv }}/bin" file: - src: "{{ aiida_venv }}/bin/verdi" - dest: "{{ aiida_jupyter_venv }}/bin/verdi" + src: "{{ aiida_venv }}/bin/{{ item }}" + dest: "{{ aiida_jupyter_venv }}/bin/{{ item }}" state: link + loop: "{{ aiida_jupyter_symlink }}" - name: "Activate verdi TAB completion in jupyter virtualenv" lineinfile: path: "{{ aiida_jupyter_venv }}/bin/activate" line: 'eval "$(verdi completioncommand)"' -- name: Symlink reentry to {{ aiida_jupyter_venv }}/bin - file: - src: "{{ aiida_venv }}/bin/reentry" - dest: "{{ aiida_jupyter_venv }}/bin/reentry" - state: link - - name: Add {{ aiida_venv }} to jupyter kernels shell: "{{ aiida_venv }}/bin/python -m ipykernel install --name {{ aiida_kernel_name }} --user" args: