radical-cybertools / radical.saga

A Light-Weight Access Layer for Distributed Computing Infrastructure and Reference Implementation of the SAGA Python Language Bindings.
http://radical-cybertools.github.io/saga-python/
Other
83 stars 34 forks source link

TypeError: '>' not supported between instances of 'float' and 'str' #746

Closed lee212 closed 4 years ago

lee212 commented 4 years ago

Found this error during py3 test. :

Traceback (most recent call last):
  File "00_getting_started.py", line 68, in <module>
    pilot = pmgr.submit_pilots(pdesc)
  File "/home/hrlee/venv3/entk/lib/python3.6/site-packages/radical/pilot/pilot_manager.py", line 502, in submit_pilots
    pilot = ComputePilot(pmgr=self, descr=pd)
  File "/home/hrlee/venv3/entk/lib/python3.6/site-packages/radical/pilot/compute_pilot.py", line 102, in __init__
    self._resource_sandbox = self._session._get_resource_sandbox(pilot)
  File "/home/hrlee/venv3/entk/lib/python3.6/site-packages/radical/pilot/session.py", line 1003, in _get_resource_sandbox
    shell = rsup.PTYShell(js_url, self)
  File "/home/hrlee/venv3/entk/lib/python3.6/site-packages/radical/saga/utils/pty_shell.py", line 244, in __init__
    interactive=self.interactive)
  File "/home/hrlee/venv3/entk/lib/python3.6/site-packages/radical/saga/utils/pty_shell_factory.py", line 199, in initialize
    self._initialize_pty(info['pty'], info)
  File "/home/hrlee/venv3/entk/lib/python3.6/site-packages/radical/saga/utils/pty_shell_factory.py", line 420, in _initialize_pty
    raise ptye.translate_exception (e)
  File "/home/hrlee/venv3/entk/lib/python3.6/site-packages/radical/saga/utils/pty_shell_factory.py", line 292, in _initialize_pty
    if time.time() - time_start > timeout:
TypeError: '>' not supported between instances of 'float' and 'str'

This is submitting rp.pilot to stampede2 with the stack:

hrlee ~/.github/radical-cybertools/radical.pilot/examples-->radical-stack 

  python               : 3.6.8
  pythonpath           : 
  virtualenv           : /home/hrlee/venv3/entk

  radical.pilot        : 0.90.1-v0.90.1-44-gbcf9a01@devel
  radical.saga         : 0.90.0
  radical.utils        : 0.90.3
lee212 commented 4 years ago

Comparing different types in python2 does not raise errors, for instance:

(py2)
>>> 3.2 > "10.0"
False

however, py3 removed this and raise like: TypeError: '>' not supported between instances of 'float' and 'str'

andre-merzky commented 4 years ago

Hi @lee212 ,

Many thanks for trying to fix this issue! I think the original problem is that Py3-related changes to the json parsing of our config files changed some type conversion. This actually should be fixed already via this PR: https://github.com/radical-cybertools/radical.utils/pull/187 which addressed the same problem raised in https://github.com/radical-cybertools/radical.saga/issues/739 . Can you give current RU devel a try, to see if the problem persists?

lee212 commented 4 years ago

I still see the error while I am using devel branch (if I remove the type casting ec05341c1e29eef57a7f6b38d0d2f6574f693630). I also wanted to point out that this problem exists in py2, but the if condition returns 'False' all the time and no error raised.


  python               : 3.6.8
  pythonpath           :
  virtualenv           : /home/hrlee/venv3/entk.copy

  radical.pilot        : 0.90.1-v0.90.1-47-g8eb152c@devel
  radical.saga         : 0.90.0-bv0.72.0-43-gad06a08@devel
  radical.utils        : 0.90.3
iparask commented 4 years ago

I think that it is resolved in the devel branch of radical.utils.

lee212 commented 4 years ago

@iparask , Indeed, it is. Since I already made a commit to attempt fixing this, I will reverse the type casting. Thanks both!