You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Spel and env variables allows to dynamically generate the content of a given string element.
We need more complex scenario such as :
Mount a volume depending on the result of a Spel
Mount variable list of volumes, depending on the result of a Spel
As for 2. We would mount one volume per group. Let's say user has groups [project1, project2] then we would mount both [/data/project1, /data/priject2]
This is already possible. When ShinyProxy parses a list that support SpEL, it will ignore any value that is either empty or is an empty list. For example, the following will be parsed to just a single value:
Activity
LEDfan commentedon Sep 17, 2024
This is already possible. When ShinyProxy parses a list that support SpEL, it will ignore any value that is either empty or is an empty list. For example, the following will be parsed to just a single value:
In addition, ShinyProxy allow to have nested lists (but only one level). Both parsing features make it possible to achieve your scenario:
have the SpEL expression return null or an empty list:
or
use multiple spel expressions
I'm aware that these specific features are not fully documented on the website, I'll update it soon.
parisni commentedon Sep 17, 2024
Thanks !
Definitely I understand this covers my first point.
Not sure on the second point which is about dealing with projects (ie:
users in same project to share volumes). Let me be more clear.
This one will produce at most 2 volumes:
I d'like to be able to generate a list of volume from a spel:
would expand into 0 to n volumes according to the groups spel result.
This would be fine for volumes, but also for any primitive list such as
app parameters - below would allow one to login a given project they
belong.
parisni commentedon Sep 19, 2024
I made a tiny hugly patch which allows to "flatmap" the volumes.
Now given this users and volumes:
I get those folders in jupyter (from two volume entries, 4 volumes are eventually bound):

The
listToCsvspel allows to join multiple volume into one, later it is flattened. This allows the support of dynamic volumes number, based on spel.LEDfan commentedon Oct 28, 2024
Hi, what you are trying to achieve is already possible. ShinyProxy already flattens nested lists and SpEL Collection Projection allows you to "loop" over a list (https://docs.spring.io/spring-framework/reference/core/expressions/language-ref/collection-projection.html), therefore you can do something like:
Once launches it will have the following volumes:
And as mentioned in my previous post, you can even have multiple of these lists:
parisni commentedon Nov 14, 2024
Many thanks. Sounds like a good example in your documentation !