From 656cc9d91c345d3a287909500deb3a0dd2d38600 Mon Sep 17 00:00:00 2001 From: Mira <86979912+mira-miracoli@users.noreply.github.com> Date: Mon, 9 Sep 2024 13:46:53 +0200 Subject: [PATCH] allow interactive tools on normal workers for oubb training --- files/galaxy/tpv/interactive_tools.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/files/galaxy/tpv/interactive_tools.yml b/files/galaxy/tpv/interactive_tools.yml index 6143c51fc..3530c22a7 100644 --- a/files/galaxy/tpv/interactive_tools.yml +++ b/files/galaxy/tpv/interactive_tools.yml @@ -15,6 +15,14 @@ tools: - if: not user fail: | Interactive tools require registration. Please log-in or register on https://usegalaxy.eu/login + - if: user is not None + execute: | + training_roles = [r.name for r in user.all_roles() if not r.deleted and "training" in r.name] + training_expr = " || ".join(['(GalaxyGroup == "%s")' % role for role in training_roles]) + training_labels = '"' + ", ".join(training_roles) + '"' + entity.params['requirements'] = '(GalaxyGroup == "compute") || (%s)' % training_expr if oubb in training_expr else '(GalaxyGroup == "interactive")' + entity.params['+Group'] = training_labels + entity.params['accounting_group_user'] = str(user.id) interactive_tool_gpu: cores: 1