-
Notifications
You must be signed in to change notification settings - Fork 326
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
Add Artifact Repository #2 #1662
base: main
Are you sure you want to change the base?
Add Artifact Repository #2 #1662
Conversation
Adds the artifact repository concept with an example MongoDB / S3 setup. Signed-off-by: ttrently <[email protected]>
…iable. Signed-off-by: Bryce Gattis <[email protected]>
…is/rez into s3-artifact-repository
Signed-off-by: Bryce Gattis <[email protected]>
Signed-off-by: Bryce Gattis <[email protected]>
Signed-off-by: Bryce Gattis <[email protected]>
Signed-off-by: Bryce Gattis <[email protected]>
Signed-off-by: Bryce Gattis <[email protected]>
@@ -166,12 +165,6 @@ def add_variant(self, variant, force=False): | |||
% variant.uri | |||
) | |||
|
|||
if not os.path.isdir(variant_root): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be the culprit for why the tests are breaking. We need to have a generic way to check if we can access the variant_root
regardless of what type of PackageRepository is used (ex. database/filesystem).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed the immediate issue by readding this check and checking if the repository associated with a package is "filesystem", but it's not fully fleshed out yet.
…s filesystem Signed-off-by: Bryce Gattis <[email protected]>
@@ -303,6 +304,11 @@ def _uri(self): | |||
""" | |||
raise NotImplementedError | |||
|
|||
def install(self, location): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this even be here? Shouldn't it be the responsibility of the ArtifactRepository to know how to install a resource? Wouldn't this break if we're using s3 as an artifact repository since it can't just run a basic copytree from s3?
Signed-off-by: Bryce Gattis <[email protected]>
Signed-off-by: Bryce Gattis <[email protected]>
…oesnt expect a package.py file to exist on disk Signed-off-by: Bryce Gattis <[email protected]>
Signed-off-by: Bryce Gattis <[email protected]>
Signed-off-by: Bryce Gattis <[email protected]>
Signed-off-by: Bryce Gattis <[email protected]>
Signed-off-by: Bryce Gattis <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1662 +/- ##
=======================================
Coverage ? 58.02%
=======================================
Files ? 129
Lines ? 17133
Branches ? 3505
=======================================
Hits ? 9942
Misses ? 6523
Partials ? 668 ☔ View full report in Codecov by Sentry. |
Thought for potential backlog item: Can we use a different data validation library or perhaps update our vendored
|
Signed-off-by: Bryce Gattis <[email protected]>
… be loaded correctly Signed-off-by: Bryce Gattis <[email protected]>
@BryceGattis I agree the errors are awful. I have started to look at replacing our schema stuff with something more modern. But it's a difficult task because the schemas leak into our public API is in some places, the rez internals (the core ones) are all very tightly coupled to schemas and it is also very performance sensitive. It is probably positive to swap our schema library with something else without introducing breaking changes, but I'll be a tough task. |
This PR picks up from the work that work that @ttrently started in PR #1453.
Requirements
This implementation requires some additional packages that have not been included in rez.vendor.
These can be installed via python -m pip install PKG --target path\to\rez\Lib\site-packages.
Setup
For testing I setup Mongo and Mongo Express docker containers locally by running the following commands:
docker run --detach --name mongo_rez --network rez -p 27017:27017 mongo:7.0.5
docker run --detach --name mongo_rez_express --network rez -e ME_CONFIG_MONGODB_SERVER=mongo_rez -p 8081:8081 mongo-express:1.0.2-20
I ran the Mongo Express container so I could easily see the contents of the DB in the browser.
How To Use
In order to use you will need an existing S3 bucket and a MongoDB instance with a named database and a collection called "packages".
In your
rezconfig.py
you will need to set the following:Please note that the above Mongo URI will not directly be usable by PyMongo in a Python Console.
Steps
rez build --install -p mongo@localhost:27017/db_name --clean
to build a package and put its definition in the MongoDB. TODO: Running this seems to upload to DB now butinstall_variant
doesn't fully work yet.Changes
FUTURE
The following changes are not handled by this PR, but should be kept in mind for the future.
rez-release
do we need to makerelease_packages_path
a list so we can deploy to potentially multiple package repositories at once?TODO:
need some help with modern practices for credentials management and what our workflow should be here.
rez/vendor
folder, but maybe that's a good first thing to do?rez release
behavior. Does this push to both to package repository and artifact repository? What does this do if there are multiple of either of those?