From ebc62d310ab60cc4d75e9c426fd96ae106ae1978 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Thu, 15 Apr 2021 03:37:30 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20Add=20`prepend=5Ftext?= =?UTF-8?q?`=20for=20codes=20(#71)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Optional key, to define additional `prepend_text`. This is in preparation for adding conda env activation. --- tasks/aiida-code.yml | 1 + templates/code.yml | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tasks/aiida-code.yml b/tasks/aiida-code.yml index 2955b26..c639842 100644 --- a/tasks/aiida-code.yml +++ b/tasks/aiida-code.yml @@ -8,6 +8,7 @@ folder: "{{ code_params.folder }}" plugin: "{{ code_params.plugin }}" description: "{{ plugin.key }} {{ code_params.name }}, original plugin version {{ plugin.value.version }}, executable version {{ code_params.version }}" + prepend_text: "{{ code_params.prepend_text | default('') }}" loop: "{{ lookup('vars', plugin.value.codes_var) }}" loop_control: loop_var: code_params diff --git a/templates/code.yml b/templates/code.yml index 3e59524..22f17bd 100644 --- a/templates/code.yml +++ b/templates/code.yml @@ -4,4 +4,6 @@ input_plugin: "{{ aiida_code.plugin }}" on_computer: true remote_abs_path: "{{ aiida_code.folder | regex_replace('\\$\\{HOME}', current_user_home) }}/{{ aiida_code.executable }}" computer: "{{ aiida_computer_name }}" -prepend_text: "ulimit -s unlimited" +prepend_text: | + ulimit -s unlimited + {{ aiida_code.prepend_text | indent(width=2) }}