Replies: 1 comment 1 reply
-
Thanks @ttrently ! Great write up. I still need to read it a couple more times and digests some stuff, but here are some quick thoughts, notes and questions:
Feel free to ignore some of the stuff I mentioned. I'll come back later with more details on some points. I just wanted to drop my thoughts to not forget them. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all!
I wanted to continue the modularity overview discussion here, specifically on the artifact repository implementation. If you haven't checked out the discussion linked above, I suggest reading through that first as most of the following thoughts are based on the concepts proposed there.
Below I will show my take on the artifact repository implementation and its association with a package repository, but would like to know others thoughts on it as well.
Proposal
The interaction between a package repository and artifact repository lends itself to be that of a one-to-many connection in that a package repository can connect to and pull from multiple different artifact repositories, while an artifact repository can contain any number of package payloads associated with multiple package repositories.
When packages are then requested in a resolved context, package repositories that require artifact payloads will cache those payloads in a blocking way to ensure they are present for the environment.
Paths
With the introduction of an artifact repository association, package paths become a bit more complex to create that connection for the user. Default formats of
repo_type@location
would still work, but we need the ability to tell a repository to look for artifacts in a specific location. Because of this we may look at constructing a more robust string representation, possibly in the following format:repo_type@location?art_repo@location&art_repo@location*
Where anything defined past the
?
query character would be an associated artifact repository when the package repository is constructed and cached.In this example we have three package repositories and two artifact repositories defined.
Since there is an increase in complexity here with the associations, we will probably want to create a simple interface for package repository paths, compared to the normal string manipulation that is done now. This new class would simply deconstruct the package repository path provided and split it.
Package Repository
The package repository should behave as-is but be extended to have knowledge of it's associated artifact repositories. In this way the package repository would handle iterating package definitions but not own the logic for downloading or caching the payloads. This functionality should be the ownership of the artifact repository in conjunction with the individual resources. (This becomes apparent in the caching process where we have access to the resource which then has access to the repository.)
The package cache would then be updated to use the new
Resource.install
method duringadd_variant
which should then allow for more robust handling of variant caching from repositories in the future (package_cache.py line 292).Alternative to this is that we wouldn't use the caching system to handle artifacts and instead download them into the users local filesystem repository and resolve again from there. This option could work but the caching systems seems like this is a good place for this to happen as it is cleanable and allows for re-caching of variants.
Artifact Repository
The artifact repository can be implemented as an additional plug-in type so that it can be extend by users and customized for independent needs. This repository should have the ability to pull, push, and find artifacts within it based on package or variant resources.
The difference between download and install variant here is to allow for packaged downloads to occur and the install process handling actually unpacking the payload. Ex. You may store an artifact package called
foo
in a zip format asfoo.zip
on your artifact repository. The download method would handle pullingfoo.zip
into a local temporary location, while install would handle unpacking the contents of the payload and moving them into the cache. (Install method here would always call download to ensure a payload is present to install).Artifact repositories would also have the ability to copy packages between them to support move functionality (
copy_variant_to_path
,copy_variant_from_path
). These methods would potentially be exposed in the package repository to allow for easy upload access points during a rez build or install.It would then be possible for database based package repositories to also update based on the provided variant, ie. when a variant is copied, an additional entry is pushed to the package repository database based on a schema. This could be standardized in general for rez database package repositories to ensure specific behavior and format.
Final Thoughts
If you made it this far, thanks for reading my ramblings! I'm sure I've missed something.
I'd be interested on any thoughts about this extension of the artifact repository proposal and it's implementation, especially if this seems close to how others envisioned an artifact style repository working and how it is associated with the package repository.
Some additional open questions:
Beta Was this translation helpful? Give feedback.
All reactions