Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new rule to TPV to workaround wrong remote resource selected or recorded in Galaxy DB #955

Merged
merged 7 commits into from
Oct 19, 2023
20 changes: 19 additions & 1 deletion files/galaxy/tpv/tool_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tools:
env:
GALAXY_MEMORY_MB: "{int(mem * 1024)}" # set 5/2023 might be moved to runner or tool wrappers, related to Galaxy issue 15952
params:
metadata_strategy: 'extended'
metadata_strategy: "extended"
tmp_dir: true
request_cpus: "{cores}"
request_memory: "{mem}G"
Expand Down Expand Up @@ -42,6 +42,24 @@ tools:
entity.tpv_tags = entity.tpv_tags.combine(
TagSetManager(tags=[pulsar_tag])
)
- id: removed_remote_resources
# This rule displays a meaningful error message when users that have selected remote resources that are no longer available (e.g. because they have been removed) attempt to send jobs to them.
if: |
retval = False
remote_resource_tag = None
if user is not None:
try:
user_preferences = user.extra_preferences
remote_resource_tag = user_preferences.get("distributed_compute|remote_resources")
except AttributeError:
pass
remote_resource_destination = [d.dest_name for d in mapper.destinations.values() if any(d.tpv_dest_tags.filter(tag_value=remote_resource_tag))]

if not remote_resource_destination:
retval = True
retval
fail: |
Invalid 'Remote resources id' selected in the config menu under 'User -> Preferences -> Manage Information'. Please reselect either 'default' or an appropriate remote resource.

rank: |
final_destinations = helpers.weighted_random_sampling(candidate_destinations)
Expand Down
Loading