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

Allow referencing body of a WDL workflow in the input #5003

Closed
stxue1 opened this issue Jul 1, 2024 · 2 comments
Closed

Allow referencing body of a WDL workflow in the input #5003

stxue1 opened this issue Jul 1, 2024 · 2 comments

Comments

@stxue1
Copy link
Contributor

stxue1 commented Jul 1, 2024

The WDL spec mentions the input section can reference the body of the workflow:

As with tasks, declarations can appear in the body of a workflow in any order. Expressions in workflows can reference the outputs of calls, including in input declarations.

This currently doesn't work as we compute bindings sequentially:

	[2024-07-01T13:06:00-0700] [MainThread] [C] [toil.worker] Worker crashed with traceback:
	Traceback (most recent call last):
	  File "/home/heaucques/Documents/toil/venv3.12/lib/python3.12/site-packages/WDL/Expr.py", line 124, in eval
	    ans = self._eval(env, stdlib)
	          ^^^^^^^^^^^^^^^^^^^^^^^
	  File "/home/heaucques/Documents/toil/venv3.12/lib/python3.12/site-packages/WDL/Expr.py", line 864, in _eval
	    return env[self.name]
	           ~~~^^^^^^^^^^^
	  File "/home/heaucques/Documents/toil/venv3.12/lib/python3.12/site-packages/WDL/Env.py", line 127, in __getitem__
	    return self.resolve(name)
	           ^^^^^^^^^^^^^^^^^^
	  File "/home/heaucques/Documents/toil/venv3.12/lib/python3.12/site-packages/WDL/Env.py", line 114, in resolve
	    return self.resolve_binding(name).value
	           ^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/home/heaucques/Documents/toil/venv3.12/lib/python3.12/site-packages/WDL/Env.py", line 106, in resolve_binding
	    raise KeyError()
	KeyError
	
	The above exception was the direct cause of the following exception:
	
	Traceback (most recent call last):
	  File "/home/heaucques/Documents/toil/src/toil/worker.py", line 440, in workerScript
	    job._runner(jobGraph=None, jobStore=job_store, fileStore=fileStore, defer=defer)
	  File "/home/heaucques/Documents/toil/src/toil/job.py", line 2984, in _runner
	    returnValues = self._run(jobGraph=None, fileStore=fileStore)
	                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/home/heaucques/Documents/toil/src/toil/job.py", line 2895, in _run
	    return self.run(fileStore)
	           ^^^^^^^^^^^^^^^^^^^
	  File "/home/heaucques/Documents/toil/src/toil/wdl/wdltoil.py", line 145, in decorated
	    return decoratee(*args, **kwargs)
	           ^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/home/heaucques/Documents/toil/src/toil/wdl/wdltoil.py", line 3259, in run
	    bindings = bindings.bind(input_decl.name, evaluate_defaultable_decl(input_decl, bindings, standard_library))
	                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/home/heaucques/Documents/toil/src/toil/wdl/wdltoil.py", line 1275, in evaluate_defaultable_decl
	    return evaluate_decl(node, environment, stdlib)
	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/home/heaucques/Documents/toil/src/toil/wdl/wdltoil.py", line 1235, in evaluate_decl
	    return evaluate_named_expression(node, node.name, node.type, node.expr, environment, stdlib)
	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/home/heaucques/Documents/toil/src/toil/wdl/wdltoil.py", line 1216, in evaluate_named_expression
	    value = expression.eval(environment, stdlib)
	            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/home/heaucques/Documents/toil/venv3.12/lib/python3.12/site-packages/WDL/Expr.py", line 124, in eval
	    ans = self._eval(env, stdlib)
	          ^^^^^^^^^^^^^^^^^^^^^^^
	  File "/home/heaucques/Documents/toil/venv3.12/lib/python3.12/site-packages/WDL/Expr.py", line 1019, in _eval
	    innard_value = self.expr.eval(env, stdlib)
	                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/home/heaucques/Documents/toil/venv3.12/lib/python3.12/site-packages/WDL/Expr.py", line 130, in eval
	    raise Error.EvalError(self, str(exn)) from exn
	WDL.Error.EvalError
	
	[2024-07-01T13:06:00-0700] [MainThread] [E] [toil.worker] Exiting the worker because of a failed job on host pop-os

┆Issue is synchronized with this Jira Story
┆Issue Number: TOIL-1608

@adamnovak
Copy link
Member

I think I already reported this as #4993.

@stxue1
Copy link
Contributor Author

stxue1 commented Jul 2, 2024

Closing as this is duplicated.

@stxue1 stxue1 closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants