Overview
Dave Dykstra, Andrew McNab, and I had a discussion about a proposed feature DUNE asked RCDS to add, which would allow RCDS to download a repository for particular tag from github, tar it up, and then publish the tarball to RCDS. The proposed RCDS API for a client to publish such a tarball is:
publish?cid={vo}/{hash}&source=github.com/{owner}/{repo}
where the {hash} should be the appropriate commit hash for the desired tag. The CID would both serve as the hash that RCDS uses to keep track of the tarball, and also the guide to RCDS as to which commit of a repository to pull down.
Details
Thus jobsub will need to do the following (or something like it):
- Modify the
--tar-file-name flag so we have an additional URI, maybe git:// that takes a repository/tag combo. For example: git://github.com/fermitools/jobsub_lite:1.12.
- jobsub should know, with this URI, to NOT create or check a tarball, but rather to run the github API
https://api.github.com/repos/{owner}/{repo_name}/git/ref/tags/{tag}. The response is a JSON document, whose object.sha entry contains the commit hash for that tag. See, for example, https://api.github.com/repos/fermitools/jobsub_lite/git/ref/tags/1.12
- This commit hash will be used to construct the CID for the
TarballPublisherHandler instantiation. Like before, the CID will be something like vo/hash; e.g. fermilab/1bf8d373dc04024ae714e072ca059846937a0add.
- The RCDS API call to publish the tarball will then need to be a little different than before, as mentioned above in the Overview. jobsub will have to parse the user-given repo/tag to create the API call:
publish?cid={cid from (3)}&source={user-given-repo}
From then on, the logic is the same. The default behavior would be for jobsub to check for the successful publish of the tarball before proceeding; or the user could skip that check with --skip-check rcds.
Overview
Dave Dykstra, Andrew McNab, and I had a discussion about a proposed feature DUNE asked RCDS to add, which would allow RCDS to download a repository for particular tag from github, tar it up, and then publish the tarball to RCDS. The proposed RCDS API for a client to publish such a tarball is:
publish?cid={vo}/{hash}&source=github.com/{owner}/{repo}where the {hash} should be the appropriate commit hash for the desired tag. The CID would both serve as the hash that RCDS uses to keep track of the tarball, and also the guide to RCDS as to which commit of a repository to pull down.
Details
Thus jobsub will need to do the following (or something like it):
--tar-file-nameflag so we have an additional URI, maybegit://that takes a repository/tag combo. For example:git://github.com/fermitools/jobsub_lite:1.12.https://api.github.com/repos/{owner}/{repo_name}/git/ref/tags/{tag}. The response is a JSON document, whoseobject.shaentry contains the commit hash for that tag. See, for example, https://api.github.com/repos/fermitools/jobsub_lite/git/ref/tags/1.12TarballPublisherHandlerinstantiation. Like before, the CID will be something likevo/hash; e.g.fermilab/1bf8d373dc04024ae714e072ca059846937a0add.publish?cid={cid from (3)}&source={user-given-repo}From then on, the logic is the same. The default behavior would be for jobsub to check for the successful publish of the tarball before proceeding; or the user could skip that check with
--skip-check rcds.