fractal-analytics-platform / fractal-web

Web client for Fractal
https://fractal-analytics-platform.github.io/fractal-web/
BSD 3-Clause "New" or "Revised" License
6 stars 0 forks source link

Expose link to viewer next to each image in dataset image-list page #527

Closed tcompa closed 2 months ago

tcompa commented 4 months ago

This is an experimental feature, not to be merged.

The button would link to our own vizarr/data service (e.g. on port 3000), and use the image URL (aka absolute path). Notice that we would need to map cluster paths into VM paths, but at the testing level we can work around this need in a few ways (e.g. by mounting the cluster share on the VM with the same absolute path, or using symlinks, ...).

zonia3000 commented 3 months ago

In the link-to-viewer branch I added the new experimental link. The branch has been created from summer_improvements, so it contains also those commits.

The dataset page has a new "View" button that opens a link (in a new tab) to the vizarr viewer:

Screenshot from 2024-08-07 18-26-05

The viewer link can be configured using the PUBLIC_FRACTAL_VIZARR_VIEWER_URL environment variable. If the variable is not present the link is not displayed.

jluethi commented 3 months ago

Neat! That will be great to add to the Science Cluster deployment!

How does the PUBLIC_FRACTAL_VIZARR_VIEWER_URL need to be set? How does it handle the fact that the base of the path is different on the VM that streams the data from the cluster?

zonia3000 commented 3 months ago

How does the PUBLIC_FRACTAL_VIZARR_VIEWER_URL need to be set?

It's like all the other variables that we are setting in the env file or via export when starting from the script. It's read at runtime, when the fractal-web app start.

For local testing we can use:

PUBLIC_FRACTAL_VIZARR_VIEWER_URL=http://localhost:3000/vizarr

How does it handle the fact that the base of the path is different on the VM that streams the data from the cluster?

I'm not sure if I have understood the question correctly.

If you are talking about the paths of the files on disk I suppose that, as suggested by @tcompa in the first comment of this issue, we can "mount the cluster share on the VM with the same absolute path". That has to be tested.

Notice that, from an external point of view, the URL of fractal-web must have the same main domain of the URL of vizarr-viewer, otherwise cookies authentication will not work (more details on fractal-vizarr-viewer readme), so we added some proxy configuration (that is already in place).

jluethi commented 3 months ago

If you are talking about the paths of the files on disk I suppose that, as suggested by @tcompa in the first comment of this issue, we can "mount the cluster share on the VM with the same absolute path". That has to be tested.

Ah, makes sense. We haven't set that up yet, but going that route makes sense.