Starting with rez-2.0

369 views
Skip to first unread message

Jack Straw

unread,
Oct 28, 2014, 6:30:22 AM10/28/14
to rez-c...@googlegroups.com
Hi,

I am looking to use rez in the small production studio and I am looking for some pointers on getting started. First though I'll just describe the system environment and what I am wanting to get out of rez.

Env; 10 users on Windows 7, 15+ on OSX, Servers + some dual booting users running Centos 7. (All users are fairly non technical so no launching from cmdline)
Aim;  Environments per project, environment serialisation, Desktop GUI for launching available tools, administration though a Web Service (creating environments per project, building and releasing packages).

I have read though the manual for version 1 and had a dig though the source code but it would be good to know how rez-2.0 is looking overall? Has it got all of the major components for production? How is the python API, will it stay somewhat consistent?

From what I have seen it all looks good and ready for use in production with a bit of dev (i.e. no out the box support for windows.).

Thanks,

Jack.

Allan Johns

unread,
Oct 28, 2014, 11:48:51 AM10/28/14
to rez-c...@googlegroups.com
Hi Jack,

Rez-2 is a total rewrite of Rez-1 and is much improved, especially in terms of the API. Rez-1 grew quickly, but Rez-2 has been engineered from the ground up. The 2.0 branch is usable right now, just follow the README to install it. The API is quite different, but I would say that from here on it will not change much. Even though it's a rewrite, conceptually it is much the same as Rez-1 so reading the user manual is still useful (although a lot of the finer details will have changed). I have not been able to replace the docs for Rez-2 yet, but they are coming (one day!) In the meantime feel free to contact me if you have any questions.

All the major components you need are there (it is very easy to create an environment via the API - have a look at the README). What is missing is managing environments across projects, providing overrides at the show/shot/etc level, that kind of thing. Having said that, I'm working on that as we speak, and intend to have something available within the next few weeks.

Rez-2 has only been tested a little on Osx and Windows and will certainly need work to get running on both. But, especially on Osx I don't think the work needed is significant. Rez-1 was working on osx for a time. Windows is worthy of note though. In Rez-2 you will see that there are various "shell" plugins, and an unfinished one for Windows. Rez is unique to a lot of management systems, in that it is not restricted to only altering environment variables to configure environments - it also allows you to create aliases, shell functions, source scripts and such (and that's why the shell plugins are there). However, if all you want to do is alter environment variables, you may not need to implement a Windows 'shell' plugin at all. The API will let you extract the environment dict from a resolved environment, so you can use that to configure the environment yourself (and this might be all you want to do if you're launching all tools from a GUI).

Rez-2 also has a GUI. It may not be geared exactly around what you want, however there are a lot of widgets there that have been written with reuse in mind. And yes the GUI contains a tool launcher. The main GUI provided is a "context manager". A "context" (short for ResolvedContext) is one of the most important objects in Rez-2. It encapsulates the result of a resolve - what was asked for (the 'request'), what packages the solver chose (the 'resolve'), and the "resolve graph", which shows you how the resolve occurred, or shows the cause(s) of conflict if it didn't (very useful for debugging). You can write a context to disk, and use it later on to recreate the same environment.

To get started I would suggest installing Rez from the 2.0 branch (the install procedure is drastically simpler than rez-1). Then I would create some rez packages so you can do some basic testing. There is a 'rez-bind' tool that can automatically create some packages for you (this feature is going to be improved over time). Try this:

```
]$ rez-bind platform
]$ rez-bind arch
]$ rez-bind os
]$ rez-bind python
then
]$ rez-env python
]$ rez-context
]$ rez-context -g
```

In Rez, the platform/arch/os are modelled as packages.
After that, you could try adding more packages, just by hand - you just need to create package.yamls and put everything in a package in the expected structure. Simple 3rd party python modules are a good place to start. Rez-1 had a "rez-egg-install" tool which does this for you (it downloaded the package from Pypi). This feature isn't in Rez-2 just yet but is definitely on the list.

I would also just check out all the command line tools available - rez cli is git-like, all the tools like "rez-env" are equivalent to "rez env" (the hyphenated form is just there for rez-1 backwards compatibility). They all have fairly extensive help via -h (although no man entries yet - would like to add this).

The code itself is well documented - you might want to look at resolved_context.py, it's what I might call the main entry point in the code (it contains the ResolvedContext class).

hth!
Allan







--
You received this message because you are subscribed to the Google Groups "rez-config" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rez-config+...@googlegroups.com.
To post to this group, send email to rez-c...@googlegroups.com.
Visit this group at http://groups.google.com/group/rez-config.
For more options, visit https://groups.google.com/d/optout.

Jack Straw

unread,
Dec 16, 2014, 12:53:42 PM12/16/14
to rez-c...@googlegroups.com
Hi Allan

I just want to say thanks for the help, I am using rez but unfortunately I am the only developer at my current place so I keep getting pulled away from it. 

So far I have got it creating contexts and executing commands but not in the shell. I am investigating which of the windows ports of expect is the most stable and will allow me to use the full shell (this gist seems like the most up to date, from a issue discussion on pexpect).

Bez looks good for most of the building, as the majority of the builds will be simply editing files depending on the variant and placing resource and src files. Or would cmake work well in your opinion? I don't have much experience in setting up these kinds of systems.

Now that I have got my teeth in to the code I think I can have a good go at enabling full Windows support in the shell and fixing some cross compatibility TODO's. I'll try to keep you updated on the progress and clean my code up into some pull requests.

Thanks again!

Jack.

allan.johns

unread,
Dec 16, 2014, 7:05:17 PM12/16/14
to rez-c...@googlegroups.com
Hi Jack, see below.



On Tuesday, December 16, 2014 9:53:42 AM UTC-8, Jack Straw wrote:
Hi Allan

I just want to say thanks for the help, I am using rez but unfortunately I am the only developer at my current place so I keep getting pulled away from it. 

So far I have got it creating contexts and executing commands but not in the shell. I am investigating which of the windows ports of expect is the most stable and will allow me to use the full shell (this gist seems like the most up to date, from a issue discussion on pexpect).

That's great news!
 

Bez looks good for most of the building, as the majority of the builds will be simply editing files depending on the variant and placing resource and src files. Or would cmake work well in your opinion? I don't have much experience in setting up these kinds of systems.

I would suggest CMake but that's only because it does the file dependency side of things for you, meaning it'll scale up to more complex builds without your build code getting overly complex. But, if you think that isn't going to happen, then Bez will work - at least one other studio is actually using bez this way. Bez is currently limited in what options you can pass it (because I didn't foresee people using it this way) but it would be fairly easy to update it - I have some ideas on this, we should touch base if you end up having time to look into this.

 

Now that I have got my teeth in to the code I think I can have a good go at enabling full Windows support in the shell and fixing some cross compatibility TODO's. I'll try to keep you updated on the progress and clean my code up into some pull requests.

That would be spectacular. One of the more important TODOs is the one in system.py ("move shell detection into shell plugins"), it's pretty obvious looking at that code that it's linux/osx dependent and should be moved, I just haven't gotten around to that. I would have liked to use the psutil project to do this, but it's a pretty big dependency that seems to have problems wrt pip - I haven't been able to get a clean working rez install that includes it (note: you may have noticed that all of rez's dependencies are embedded inside rez, this is deliberate as it simplifies things a lot).

Cheers,
Allan

 
Reply all
Reply to author
Forward
0 new messages