BCDA-APS / gemviz

Data visualization for tiled
https://bcda-aps.github.io/gemviz/
Other
4 stars 0 forks source link

tiled has new releases #53

Closed prjemian closed 1 year ago

prjemian commented 1 year ago

Keeping an eye on the tiled releases, note that there are several (at least 5) new releases in the last week.

At least one of them requires a minimum server and client pair that are newer than we use now. Might cause us to change our code, either on the server side or the client side.

prjemian commented 1 year ago

Started a tiled server (0.1.0a104) in a conda environment with newer tiled version (0.1.0a104). Then started this client. This exception was reported as status:

Error for server_uri='http://192.168.144.94:8000': 400: Python Tiled client reports version 0.1.0a96. Version 0.1.0a104 or higher is needed to communicate with this Tiled server. http://192.168.144.94:8000/api/v1/

prjemian commented 1 year ago

@jilavsky, @canismarko : At some point, I must upgrade the tiled server on otz for this change (both client and server have a new minimum version, stated above). If you run your own tiled server, then you may not see this problem. But if you upgrade your tiled server, your Python clients will need the new version. Non-Python users might some changes in the API, I'm not sure about that.

prjemian commented 1 year ago

Maybe the new version has Python client structure changes as well. This exception was raised (and the app crashed out) when double-clicking on a run in the QTableView:

(tiled-test) prjemian@arf:~/.../BCDA-APS/gemviz$ Traceback (most recent call last):
  File "/home/prjemian/.conda/envs/gemviz/lib/python3.11/site-packages/tiled/client/utils.py", line 18, in handle_error
    response.raise_for_status()
  File "/home/prjemian/.conda/envs/gemviz/lib/python3.11/site-packages/httpx/_models.py", line 749, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '404 Not Found' for url 'http://192.168.144.94:8000/api/v1/metadata/training/d94d2126-fd52-461c-9284-23e5f34b326b/baseline/data'
For more information check: https://httpstatuses.com/404

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/prjemian/.conda/envs/gemviz/lib/python3.11/site-packages/tiled/client/container.py", line 300, in __getitem__
    content = handle_error(
              ^^^^^^^^^^^^^
  File "/home/prjemian/.conda/envs/gemviz/lib/python3.11/site-packages/tiled/client/utils.py", line 33, in handle_error
    raise ClientError(message, exc.request, exc.response) from exc
tiled.client.utils.ClientError: 404: No such entry: ['training', 'd94d2126-fd52-461c-9284-23e5f34b326b', 'baseline', 'data'] http://192.168.144.94:8000/api/v1/metadata/training/d94d2126-fd52-461c-9284-23e5f34b326b/baseline/data

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/prjemian/Documents/projects/BCDA-APS/gemviz/gemviz/resultwindow.py", line 350, in doRunSelected
    self.mainwindow.viz.setData(model.getDataDescription(index))
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/prjemian/Documents/projects/BCDA-APS/gemviz/gemviz/resultwindow.py", line 234, in getDataDescription
    data = stream["data"].read()
           ~~~~~~^^^^^^^^
  File "/home/prjemian/.conda/envs/gemviz/lib/python3.11/site-packages/tiled/client/container.py", line 312, in __getitem__
    raise KeyError(err_arg)
KeyError: 'data'
prjemian commented 1 year ago

Wait for #128 before working on this issue.

prjemian commented 1 year ago

I will create the new version of the server on a different port. Possibly 8020 (if it is not already taken), so http://otz.xray.aps.anl.gov:8020. We can test with either version, then.

prjemian commented 1 year ago

If the current version of gemviz tries to access an older tiled server, this exception may be raised when trying to connect:

image

Can this be recognized and translated into a more useful message? Such as: tiled server not compatible with this application. Can the client identify what version the tiled server is using?

prjemian commented 1 year ago

Don't bother translating this message. It is dependent on an old tiled version. Since tiled is in alpha development, do not write code to explain such transients. The interface may change further at this stage.

prjemian commented 1 year ago

Note this important BUG report:

Since we have various files which follow this naming pattern:

something.txt, something.md, and something.dat

we'll need this BUG resolved for general use.

prjemian commented 1 year ago

And this PR

prjemian commented 1 year ago

in tiled/tiled/commandline/_catalog.py on line 155, change:

from ..adapters.files import identity

to:

from ..catalog.register import identity