-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resources2 mongo #205
base: resources2
Are you sure you want to change the base?
Resources2 mongo #205
Conversation
…ges saved in a mongo database. -added rez-copy. this tool lets you copy packages from and to arbitrary repositories, for example from filesystem to mongo. -rez-build and rez-release uses two new configuration options local_packages_repository_path, release_packages_repository_path to control where the package is installed. By default their value is interpreted as: filesystem@local_packages_path and filesystem@release_packages_path. These options could be overridden directly from rez-build and rez-release through the --repo-prefix flag (ie: --repo-prefix mongo@/svr/local). -changed source_code_schema so that SourceCode is serialized to a basestring class. -rez-search support lookups on different repositories.
Thanks, @holofermes this looks very cool. I have a couple of questions: In your rez-search example ( If a package is installed to the mongo repository, I assume the package.yaml doesn't get copied into the install path? Would this be possible to aid transition - I imagine only some users using mongo initially while we test/evaluate so imagine they could become out of sync. It seems desirable for local packages to use the filesystem repository and released packages to use mongo in a normal developer workflow, what do you think? Can
Would it be possible to install pymongo under the Rez could then internally manage the imports of pymongo such that if pymongo is found in the virtualenv it is used in preference of |
I'll let holofermes cover the finer details, but see below.. On Tue, May 26, 2015 at 4:34 PM, Mark Streatfield notifications@github.com
This is a good point. I think it's probably always desirable to install the
Agreed. Mixing together different repository types on REZ_PACKAGES_PATH has
That would be my preference. Similarly, I saw this: If it looks like it works, I was considering a similar approach - if a
|
when using --path with rez-search you are telling where to search, so in the example rez will search in a mongo repo, in the /svr/packages namespace. also note that the following are equivalent:
That's totally doable. As of now, both local and released packages will go to the filesystem, however there are two settings that can override where the package metadata gets saved local_packages_repository_path and release_packages_repository_path, also coupled with an extra flag in rez-build/rez-release for further overriding. $ cd foo-source
$ rez-build -i --repo-prefix mongo@
$ tree /home/fpiparo/packages/foo
/home/fpiparo/packages/foo
`-- 1.0.1
`-- platform-linux
`-- arch-x86_64
`-- os-Ubuntu-12.04
`-- build.rxt
$ rez-search foo --path mongo@/home/fpiparo/packages -t variant
foo-1.0.1[0]
$ rez-env foo-1.0.1 --path mongo@/home/fpiparo/packages
> $exit
$ rez-env foo-1.0.1
rez: PackageDefinitionFileMissing: Missing package definition file: FileSystemPackageResource({'version': '1.0.1', 'repository_type': 'filesystem', 'location': '/home/fpiparo/packages', 'name': 'foo'}) so here the package.py isn't present in the filesystem, but exists in mongo. Instead of using the --repo-prefix flag, one could make this permanent by modifying: $ rez config | grep repository_path
local_packages_repository_path: filesystem@
release_packages_repository_path: filesystem@ By convention if the values are provided without anything after the @ then the following defaults are appended:
In theory it should install the module without building the C extensions, so yes it should work, but it needs testing. |
Hi Fabio, Thank you so much for this feature, we might end up using this in the short term. The I run into 2 issues.
Are you able to do a
then I tried build package
It succeeded to get a I debugged a little and I found this after it resolves all the packages,
I guess at some point you sort of need to translate the path in the namespace in the mongo repo location to an actual filesystem. Is that expected that the variant repository_type is Am I doing something wrong? For the first issues probably there are some changes in Thanks, |
Hi Fede,
Yes I am able to rez-env and get a shell, and I also have a hunch that your branch might miss some of the juice from resources2.
Also you can perform a rez-search, and see how is the package/variant data modeled:
lemme know! |
I merged
that build fine, then
if I run the
but at any point the
If you can not spot anything wrong in what I am doing here, don't waste your time.. it can be something on the merge. We will be merging all dangling branches to our local PS: just for curiosity I run the |
When you do the first rez-build your package's payload might be installed in filesystem@/scratch/federicon/rez/packages but the package definition (aka: package.py) is not in there but lives in mongo@/scratch/federicon/rez/packages, and that's why rez is tripping with "Missing package definition". And the second time it actually creates the package.py in the filesystem repo.
rez-env failing I'm not sure about..
Are you not using the memcache feature in rez? You should get pretty good results and it's not as invasive as rolling out mongo. |
""" Just wanted to chime in on what Fabio said on this RE memcached. He is Hth On Mon, Jul 6, 2015 at 12:06 PM, Fabio notifications@github.com wrote:
|
Hi Allan, Good point, I disabled all memcache completely when I did the tests. I just tried with memcache on, invalidating the resolved cache by adding a new version of a package and I got the resolve in ~28 seconds Thanks for the clarification Cheers |
Hey Fede, that's still a really big amount of time, have you profiled it to Something I'm also considering is a service that continually monitors for A On Mon, Jul 6, 2015 at 6:07 PM, Federico Naum notifications@github.com
|
Hey @nerdvegas I spent a bit of time today profiling, but nothing conclusive. I've been focusing on running two
The first resolve runs at about 50 seconds, the second resolve at just under 10 seconds. The second resolve is hitting the lru cache exclusively I think (and not memcache) and has no (or very little) filesystem access. In the first run a large chunk of time (although I can't quantify how much just yet) is spent parsing the yaml files and accessing the filesystem. Whether that is enough to account for the 40 second difference I am not so sure (and from Fede's earlier testing replacing this with Mongo shows ~50% improvement maybe). On the second run, nearly 2 million calls to _SubToken.eq are made, accounting for ~0.5 seconds. A similar number of calls and ~0.8 seconds is spent in AlphanumericVersionToken.less_than. So just the number of versions being considered (and objects being created and compared) is adding to the overall weight of the process. |
This PR adds a new repository type based on mongo. A new tool was created (rez-copy) to aid the logistic of moving packages from and to different repositories, and some features were added to a few existing tools to account for the new repository capabilities (rez-build, rez-release, rez-search).
rez-build and rez-release use two new configuration options local_packages_repository_path, release_packages_repository_path to control where the package is installed. By default their value is interpreted as: filesystem@local_packages_path and filesystem@release_packages_path, but they can be controlled directly from rez-build/release through the --repo-prefix flag (ie: --repo-prefix mongo@/svr/local).
EXAMPLES
rez-copy
copy all packages and variants from all filesystem repos to their mongo counterpart
copy all versions and possibly variants of a package as seen by the specified source filesystem path
copy a specific version and a specific variant
rez-search
perform a search on multiple repository types
$ rez-search python --paths mongo@/home/fpiparo/packages:filesystem@/home/fpiparo/packages --format='{qualified_name} {repository_path} {repository_type}' python-2.6 mongo@host=localhost,db=local,port=27017,namespace=/home/fpiparo/packages mongo python-2.7.3 mongo@host=localhost,db=local,port=27017,namespace=/home/fpiparo/packages mongo python-2.6 filesystem@/home/fpiparo/packages filesystem python-2.7.3 filesystem@/home/fpiparo/packages filesystem
rez-build
install the foo package, and its payload to local_packages_path, and the package definition in the mongo@/svr/packages repository.
and then search for it
OUTSTANDING
$ source /path/to/rez/bin/activate $ pip install -U pymongo.src.tgz
maybe this could be taken care of during the installation of rez. One caveat on linux is that pymongo itself supports optional C extensions, which requires a few things to be installed (http://api.mongodb.org/python/current/installation.html#dependencies-for-installing-c-extensions-on-unix), also I'm not sure if it would work on windows/mac the same way.