Setting different environment for each user

Hi, I’m just wondering whether their is a way for setting ondemand variables for users separately and not globally. We have multiple shared storages and users might choose different ones as their working directory (path to their own /projects/default/… directory as created using Job composer), so accordingly we would need to set $OOD_DATAROOT path variable different for some users. Now I’m only able to set it globally so every user has the same settings and working directory on same shared storage.

I found /var/lib/ondemand-nginx/config/puns/$user.conf config files but I don’t know if and how Varaibles can be set in there?

Hello and welcome!

This can be done for the app by following directions here at the Customization Overivew page:
https://osc.github.io/ood-documentation/latest/customization_overview.html

But, are you trying to let the user set this path or is the admin going to set this for various users? I don’t think there is a way the user could set this, as it would cause potential problems allowing them to land a file anywhere they tried to choose.

Now, if you wanted an admin to set this for various users, you would have to do some work. One way might be to enable those users as developers:
https://osc.github.io/ood-documentation/latest/app-development/enabling-development-mode.html

Then have an app that is just a clone of myjobs but accessed from the developer menu with an environment variable set in the users own development version of the myjobs app to override the default location. Essentially the same as that system override, but here the app is just for this user and sitting in the dev location and not the sys.

This is more involved and seems hard to manage unfortunately, but is all I can think of at the moment. I’m wondering if there is a way to handle this at the PUN stage but I’m not sure, I’ll have to look more.

All of this hinges on the problem of providing an easy interface while protecting the user from landing files in the wrong location. We are currently working on a new job composer app, and shared spaces along with more granular control of dest and target locations is something that is high on that list of priorities to provide an easier way to do things like this.

I know that’s a lot, and if you need more help or clarity please post here and we will happily clear anything up.

After stepping away and walking for a moment I don’t like that response of using the dev setup as it still gives that user the ability to break things and set wrong locations.

I’d recommend cloning but doing an actual system app for this, and naming it something to clue the user into the correct shared storage being used by that myjobs app. Then, for each app setting a env and overriding that OOD_DATAROOT. That way you the admin maintains control of the file locations, while enabling some degree of granularity.

I don’t like that you need to clone and install these and then provide a semantic name for the user, so this is not all that much better.

I’ve opened an issue to track this type of use case in the New Job Composer to allow admins to choose various paths for OOD_DATAROOT or setting destination files in some way using a bit of logic around the user and group possibly, or by the admin outright.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.