PDG scheduler file ownership

Post Reply
keyframe
Posts: 57
Joined: Sat Jan 21, 2017 9:43 pm
Location: Toronto

PDG scheduler file ownership

Post by keyframe »

Is it possible for the file generated by the pdg scheduler to be owned by the same account that submitted the job instead of 'render'?

G
--
centOS 8.1, cgru 3.2.1
keyframe
Posts: 57
Joined: Sat Jan 21, 2017 9:43 pm
Location: Toronto

Re: PDG scheduler file ownership

Post by keyframe »

I was able to make that change by modifying a few lines of afanasyscheduler.py.
I'm making use of linux's ability to switch to a different UID/GID and a few security exceptions via sudo - i'm not sure whether this is something that's possible on other platforms.

In case this is useful to anyone else:

Code: Select all

[gene@tws12 types]$ diff afanasyscheduler.py afanasyscheduler.bak 
175,176c175
<         cmd = 'su -m {} -c "umask 022 && {}"'.format(cgruconfig.VARS['USERNAME'], self.expandCommandTokens(work_item.command, work_item))
<         task.setCommand(cmd)
---
>         task.setCommand(self.expandCommandTokens(work_item.command, work_item))
467,469d465
< 
<         # impersonate someone useful
<         cmd = 'su -m {} -c "umask 022 && {}"'.format(cgruconfig.VARS['USERNAME'],cmd)
--
centOS 8.1, cgru 3.2.1
User avatar
timurhai
Site Admin
Posts: 780
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: PDG scheduler file ownership

Post by timurhai »

Hi!
I think that user switching is a very "in-house depended" issue.
It should be implemented by admins/TDs/RNDs in place.
Also user, that service is running by, should have enough permissions for it.

Just may be Afanasy "out-of-the-box" submission plugins should have some ways for command customizing.
- this i can discuss/implement
Timur Hairulin
CGRU 3.2.1, Ubuntu 20.04 LTS, MS Windows 10 (clients only).
keyframe
Posts: 57
Joined: Sat Jan 21, 2017 9:43 pm
Location: Toronto

Re: PDG scheduler file ownership

Post by keyframe »

As you say - It might be useful for some users to have access to some prologue/epilogue code snippets of some sorts...

If one wanted to update an asset management tool for example... or clean up a cache folder...
We're running custom submit scripts that's very opinionated about how we work, but I reckon someone can benefit from it.

G
--
centOS 8.1, cgru 3.2.1
Post Reply