Page 1 of 2

Rules path setup

Posted: Mon Jan 23, 2017 10:01 am
by priel71
Hi,
I have a couple of questions regarding Rules, and how the various config files are interconnected. So far, this is my understanding:

- config_default.json is read by the main cgru system, and you place your own settings in config.json overwriting the default. It in turn, also pulls in:

- config_default.json also pulls in /afanasy/config_default.json and you own custom settings from /afanasy/config.json.

- rules get it's settings by reading rules.00_general.json, and any custom settings from rules.XX_general.json

With the above in mind, let's say you want to setup cgru in /opt and have rules maintain projects which are placed in /mnt/projects.

For the main cgru custom config, I overwrite the default value of "projects_root": ["/mnt/projects/"], and perhaps change my "rules_url": "http://localhost/#/" if I have Apache set up with it's main document folder to the cgru directory.

As for the afanasy settings, I guess we can leave them as they are for now, maybe change "-af_http_serve_dir": "/opt/cgru" ?

Next is the settings for rules, which has me quite confused. I imagine I only would need to put in "root":"/mnt/projects" ? What about "root_link", I see it's by default ignored?

Peter.

Re: Rules path setup

Posted: Mon Jan 23, 2017 12:00 pm
by timurhai
cgru global config:
cgru/config_default.json
this file should not be changed, all changes should be in
cgru/config.json

cgru/afanasy/config_default.json - afanasy only config, and this file should not be changed too.

rules/rules_00_general.json - rules only config, and this file should not be changed too.
You should setup rules in rules.XX_CUSTOM.json

Projects root should be linked in cgru root folder and this link should be described in config.
It is needed for Apache as it serves cgru root folder and not /mnt/projects.
"af_http_serve_dir" - is for afserver for a custom webgui location (for its developing).

Re: Rules path setup

Posted: Mon Jan 23, 2017 12:44 pm
by priel71
Ah, that makes sense. I will update this info in your dox. Thanks!

Re: Rules path setup

Posted: Mon Jan 30, 2017 3:37 pm
by priel71
going slightly insane here... working on setting up clarisse on a blade server, and figured I'd do a clean install of cgru & rules as well, since I'll be introducing it into the general population after Chinese new year. Anyway, tried to do a github straight from my forked repo, gave up as insanely enough rules refuses to work *unless* I symlink both the cgru and my main project folder (/mnt/projects) into the ROOT of the file system :?: I already made a symlink into the cgru folder, and haven't touched anything else apart from changing my projects_root to /mnt/projects (where we keep our stuff). In rules I changed my root:projects and as mentioned, symlinked in /mnt/projects into /mnt/cgru/.

After awhile I gave up on the github idea, and installed the pre-packaged rpms. But giving me the same issues, and whatever I seem to write in my pathsmap's in rules, I get a leading \ in my directory structure, which of course none of my other nodes likes so they fail to render their jobs.

I'm setting this up on a updated centos 7 machine, been working on this for almost 2 days and I'm out of ideas. Could my apache have some setting I overlooked? It seems to serve fine and does so via http and https, follows symlinks as well.. help!

Peter.

Re: Rules path setup

Posted: Mon Jan 30, 2017 3:45 pm
by priel71
I think trying to get this to work has probably escalated into a lot more issues than it originally was :lol:

In any case, at the moment this is what afanasy tells me:

{"cmdexec":[{"convert":[],"error":"\\mnt\/cgru\/projects\/J-REV\\SCENES\\SC006\\shot002\\SOURCE\\DPX not found."}]}

I shall keep you all updated and log my progress..

Peter.

Re: Rules path setup

Posted: Mon Jan 30, 2017 3:59 pm
by priel71
Ok, think I figured it out. Going to be a big update on the rules github dox soon. :idea:

Re: Rules path setup

Posted: Fri Feb 03, 2017 5:57 am
by priel71
Spoke to soon I guess... ;)

Still got a little issue that I'm struggling with...

Currently my setup is:

/mnt/cgru/ <- cgru folder on all machines, pushed out by nfs by rules server.

/mnt/projects/ <- main project folder, pushed out by one of our servers and mounted on all workstations and the rules server.

To get the dailies, movie_maker etc to work, I have to add these two into my rules path mapping:

["/cgru/", "/mnt/cgru"],
["/projects/", "/mnt/projects/"]

This works ok for afanasy, and whatever job or task I send out from rules web ui, gets translate correctly to cgru.

However, if I for instance double click on one of the folder icons in rules, to open up the location in a file browser, rules sends "/projects/xxxx..." which of course doesn't work as it's supposed to be /mnt/projects/.
So I look at your default rules configuration file, and see that you are reversing the path mapping, (adding a ["/mnt/projects/", "/projects/"]) and when I try that, rules folder path translation starts working, however it break cgru as any script or task now sent to a node is path mapped to /projects/xxx....

I have tried a lot of different combinations to get both working simultaneously, but none so far has been successful.

Any help or insight into what seems to be a fairly trivial task would be appreciated. I understand how the path mapping work for Linux / Windows mapping in cgru, but I don't get how rules uses them in relation to cgru.

Cheers,

Peter.

Re: Rules path setup

Posted: Fri Feb 03, 2017 6:48 am
by timurhai
Hi.
Assuming you have /mnt/cgru and /mnt/projects on all clients include Rules and Afanasy servers.
/data/cgru for Rules site on server.
You should link on Rules server "ln -s /mnt/projects /data/cgru/projects".
Paths map ["/data/cgru/", "/mnt/cgru"].
Rules config:
"root":"projects",
"root_link":"/mnt/projects"
( "root_link" - like a special path map for Rules root only, to not to affect cgru paths map )

Re: Rules path setup

Posted: Fri Feb 03, 2017 7:15 am
by priel71
Thank you for your quick reply, I feel really stupid asking about this path mapping constantly. Trying to understand the logic.

Where does /data/cgru come from? Is that a folder that is necessary for rules to work? At the moment I'm running afanasy and rules from the same /mnt/cgru/ folder, is that why my path mapping is over writing eachother?

Peter

Re: Rules path setup

Posted: Fri Feb 03, 2017 8:38 am
by timurhai
I just prefer to have a separated location for Rules https server directory.
So i have a 2 cgrus on a sever.
The same machine (virtual) servers and Rules and Afanasy but from various folders.
This way i can update-setup-test them separately.
But it is not a necessarily.

I also have cgru-afanasy installed from deb packages locally on each machine.
( packages are the same as from cgru downloads for all users, but put in a local linux distro repo )
And Rules as a github repo clone for a quick change-commit-pull.