pepkit / looper

A job submitter for Portable Encapsulated Projects
http://looper.databio.org
BSD 2-Clause "Simplified" License
20 stars 7 forks source link

Error reading dynamic variables #318

Closed nsheff closed 4 months ago

nsheff commented 3 years ago

`` Is the json string supposed to be:

{'bulker_crate': 'databio/refgenie:0.7.6', 'mem': '6000', 'cores': '1', 'partition': 'standard', 'time': '00:30:00'} 

or have namespaces, like:

{'compute': { 'bulker_crate': 'databio/refgenie:0.7.6', 'mem': '6000', 'cores': '1', 'partition': 'standard', 'time': '00:30:00'} }

Docs say this should work as in the first example:

http://looper.databio.org/en/latest/pre-submission-hooks/

But it doesn't... what's wrong?


DEBU 17:38:41 | looper.conductor:conductor:683 > Updating namespaces with:
{'bulker_crate': 'databio/refgenie:0.7.6', 'mem': '6000', 'cores': '1', 'partition': 'standard', 'time': '00:30:00'} 
Traceback (most recent call last):
  File "/home/nsheff/.local/bin/looper", line 8, in <module>
    sys.exit(main())
  File "/home/nsheff/.local/lib/python3.8/site-packages/looper/looper.py", line 987, in main
    run(args, rerun=(args.command == "rerun"), **compute_kwargs)
  File "/home/nsheff/.local/lib/python3.8/site-packages/looper/looper.py", line 443, in __call__
    curr_pl_fails = cndtr.add_sample(sample, rerun=rerun)
  File "/home/nsheff/.local/lib/python3.8/site-packages/looper/conductor.py", line 366, in add_sample
    self.submit()
  File "/home/nsheff/.local/lib/python3.8/site-packages/looper/conductor.py", line 403, in submit
    script = self.write_script(self._pool, self._curr_size)
  File "/home/nsheff/.local/lib/python3.8/site-packages/looper/conductor.py", line 591, in write_script
    namespaces = _exec_pre_submit(self.pl_iface, namespaces)
  File "/home/nsheff/.local/lib/python3.8/site-packages/looper/conductor.py", line 713, in _exec_pre_submit
    _update_namespaces(namespaces, json, cmd=True)
  File "/home/nsheff/.local/lib/python3.8/site-packages/looper/conductor.py", line 685, in _update_namespaces
    for attr, val in list(mapping.items()):
AttributeError: 'str' object has no attribute 'items'
`
nsheff commented 3 years ago

It works with the namespace specified.

So I think we need to update the docs.

{'compute': { 'bulker_crate': 'databio/refgenie:0.7.6', 'mem': '6000', 'cores': '1', 'partition': 'standard', 'time': '00:30:00'} }
nsheff commented 3 years ago

Yes, can confirm; in the later refgenieserver instance repos, it was indeed using the namespaces:

https://github.com/refgenie/rg.databio.org/blob/eafdafa60ca3c88fbc92eebe0fa4f8ee5bf635e6/pipeline_interfaces/build-compute-params.py#L66

I just hadn't updated the older ones to the new system yet.

stolarczyk commented 3 years ago

I think we should also validate the output of the pre-submission hooks. I think it only checks if the class is dict now.

donaldcampbelljr commented 4 months ago

Reading through the current docs, this issue appears to have been solved. Closing.