Closed nuwang closed 1 year ago
I tried this putting it in one of my other tpv files, I get the following error:
galaxy.jobs.mapper ERROR 2023-04-17 19:27:44,338 [pN:job_handler_0,p:8,tN:JobHandlerQueue.monitor_thread] Caught unhandled exception while attempting to cache job destination:
Traceback (most recent call last):
File "/galaxy/server/lib/galaxy/jobs/mapper.py", line 236, in __cache_job_destination
self.cached_job_destination = self.__determine_job_destination(
File "/galaxy/server/lib/galaxy/jobs/mapper.py", line 224, in __determine_job_destination
job_destination = self.__handle_dynamic_job_destination(raw_job_destination)
File "/galaxy/server/lib/galaxy/jobs/mapper.py", line 204, in __handle_dynamic_job_destination
return self.__handle_rule(expand_function, destination)
File "/galaxy/server/lib/galaxy/jobs/mapper.py", line 207, in __handle_rule
job_destination = self.__invoke_expand_function(rule_function, destination)
File "/galaxy/server/lib/galaxy/jobs/mapper.py", line 124, in __invoke_expand_function
return expand_function(**actual_args)
File "/galaxy/server/.venv/lib/python3.10/site-packages/tpv/rules/gateway.py", line 50, in map_tool_to_destination
return ACTIVE_DESTINATION_MAPPER.map_to_destination(app, tool, user, job)
File "/galaxy/server/.venv/lib/python3.10/site-packages/tpv/core/mapper.py", line 143, in map_to_destination
context, late_evaluated_entity = self.match_combine_evaluate_entities(app, tool, user, job)
File "/galaxy/server/.venv/lib/python3.10/site-packages/tpv/core/mapper.py", line 133, in match_combine_evaluate_entities
late_evaluated_entity = combined_entity.evaluate_late(context)
File "/galaxy/server/.venv/lib/python3.10/site-packages/tpv/core/entities.py", line 457, in evaluate_late
return super(EntityWithRules, new_entity).evaluate_late(context)
File "/galaxy/server/.venv/lib/python3.10/site-packages/tpv/core/entities.py", line 365, in evaluate_late
new_entity.params = self.evaluate_complex_property(self.params, context)
File "/galaxy/server/.venv/lib/python3.10/site-packages/tpv/core/entities.py", line 223, in evaluate_complex_property
return self.process_complex_property(
File "/galaxy/server/.venv/lib/python3.10/site-packages/tpv/core/entities.py", line 208, in process_complex_property
evaluated_props = {key: self.process_complex_property(childprop, context, func)
File "/galaxy/server/.venv/lib/python3.10/site-packages/tpv/core/entities.py", line 208, in <dictcomp>
evaluated_props = {key: self.process_complex_property(childprop, context, func)
File "/galaxy/server/.venv/lib/python3.10/site-packages/tpv/core/entities.py", line 206, in process_complex_property
return func(prop, context)
File "/galaxy/server/.venv/lib/python3.10/site-packages/tpv/core/entities.py", line 224, in <lambda>
prop, context, lambda p, c: self.loader.eval_code_block(p, c, as_f_string=True))
File "/galaxy/server/.venv/lib/python3.10/site-packages/tpv/core/loader.py", line 53, in eval_code_block
return eval(eval_block, locals)
File "<string>", line 1, in <module>
NameError: name 'params' is not defined
is the "{params.get('docker_default_container_id')}"
resolved at the helm level or by tpv later on at the python level? Maybe my block is tpl: false
and should be true
? It sounds to me as it is python trying to get hold of values of the destination/environment, right?
Setting the container explicitly on the rule works though (avoiding the "{params...}" part), and the converters work as expected.
xref: https://github.com/galaxyproject/galaxy-helm/issues/425#issuecomment-1505606259