Package localisation for Rez.
See also
Localise - To make something remote local
Once local, access to a given package no longer requires access to the original (e.g. network) location and yields performance equivalent to that of local access, such as from your SSD. SSDs typically read at 100-500mb/sec, with some capable of 1GB+/sec. NVRAM disks are even quicker, making network access akin to sending physical letters compared to email.
Localisation is already possible with Rez like this.
$ export REZ_LOCAL_PACKAGES_PATH=~/packages
$ rez cp packageA-1.0.0 --dest-path=$REZ_LOCAL_PACKAGES_PATHNow version packageA-1.0.0 is "localised", in that it is accessible from a local directory, as opposed to wherever it came from. Assuming REZ_LOCAL_PACKAGES_PATH is first in REZ_PACKAGES_PATH, this package would get picked up first.
This project is an extension of this, with additional features such as:
- Full Context Localisation Take an entire context into account, with any number of requests, for maximum performance.
- Solved Request Localisation Unlike
rez cp, requests made tolocalisedare resolved prior to being copied - Multiple Package Localisation That each resolve into the same context prior to localising, without taking dependencies with them
- Respects
is_relocatableflag Packages have ais_relocatablevariable that is respected by this mechanism, overridden with--force - Filtered Requests Localise some packages in the context of other packages, for fine-grained control over what stays remote and what goes along for the ride.
- Multi Variant Localisation Localise relevant or all variants for a package with the
--all-variantsflag, such that e.g. bothmaya-2018andmaya-2019variants of a given plug-in is made available locally. - Tagged Localisation Localised packages carry a special variable that identify them as having been localised, for future flags such as
rez env --no-localised - Automatic Localisation Based on various criteria
- Software Provisioning Replace your Ansible/Salt/Puppet stack with Rez for provisioning of large-scale software like Maya and Nuke, with the same familiar interface, version control and dependency resolution as any other Rez package
- Distributed Asset Collaboration Share and collaborate on assets with a remote workforce without the drag of VPNs or remote desktops
- Secure Distributions Collaborate with others using the same proprietary software, without risking your IPs or competitive advantage
Prerequisities
rez-2.29+python-2.7,<4
Used as a Rez package.
$ git clone https://github.com/mottosso/rez-localz.git
$ cd rez-localz
$ rez build --installOnce installed, you can start localising packages like this.
$ rez env localz -- localise mypackageThe package mypackage would then be localised to ~/.packages.
Localised packages default to ~/.packages, which resides next to your "local" a.k.a. "development" package path, ~/packages. Customise the destination path using either an environment variable or command-line argument.
$ export REZ_LOCALISED_PACKAGES_PATH=~/localised_packages
$ rez env localz -- localise Qt.py --prefix "~/localised_packages"The argument takes precedence over the environment variable.
Localise multiple packages at once, that all resolve to one another making sure they work together.
$ rez env localz -- localise maya-2018 arnold flexLocalise an entire context with the --full flag.
$ rez env localz -- localise maya alita gitlab --fullLocalise one package resolved with another.
$ rez env localz -- localise maya --requires alitaIn this case, if alita carries a requirement for maya-2018 then that's the version being localised, despite maya-2017 and maya-2019 also being available.
The syntax to localise is the same as for rez env, including complex version queries.
$ rez env localz -- localise "maya-2015,<2020"Pass --all-variants to include every variant for a given package, rather than the one that matches the current resolve.
$ rez env localz -- localise python --all-variantsThe above could include both Linux and Windows variants for the latest version of python.
localise uses rez cp under the hood and can be considered high-level version of it, taking more variables into account like context and other packages.