-
Notifications
You must be signed in to change notification settings - Fork 4
Add GitHub Packages (GHCR) support with full container image download #222
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: yarikoptic <[email protected]>
Co-authored-by: yarikoptic <[email protected]>
|
@copilot it seems that it still does not fetch actual package content. click here to expand for more info -- seems to find packages (in organization) ok, and their versions but only fetches .json and not actual packages (containers)> tinuous fetch
2026-01-05T20:09:07-0500 [INFO ] tinuous: tinuous 0.7.2.post3+gf9d6c6d
2026-01-05T20:09:07-0500 [INFO ] tinuous: Fetching resources from github
2026-01-05T20:09:07-0500 [INFO ] tinuous: Fetching packages newer than 2025-09-02 00:00:00+00:00
2026-01-05T20:09:08-0500 [INFO ] tinuous: Found package vandermeerlab-to-bids
2026-01-05T20:09:08-0500 [INFO ] tinuous: Found package version sha256:290939a30a355edce3dd06ce7b32ab8cee2893b66755cb8682e247b4d14e6cd4 (tags: dev) for vandermeerlab-to-bids
2026-01-05T20:09:08-0500 [INFO ] tinuous: Saving metadata for package vandermeerlab-to-bids version sha256:290939a30a355edce3dd06ce7b32ab8cee2893b66755cb8682e247b4d14e6cd4 to 2025/09/github/packages/vandermeerlab-to-bids/dev/sha256:290939a30a355edce3dd06ce7b32ab8cee2893b66755cb8682e247b4d14e6cd4.json
2026-01-05T20:09:08-0500 [INFO ] tinuous: Found package version sha256:df7ff0da92cf424bff5f754d23cad5743a3a71390350dadee5d95567dfbd8310 (tags: (no tags)) for vandermeerlab-to-bids
2026-01-05T20:09:08-0500 [INFO ] tinuous: Saving metadata for package vandermeerlab-to-bids version sha256:df7ff0da92cf424bff5f754d23cad5743a3a71390350dadee5d95567dfbd8310 to 2025/09/github/packages/vandermeerlab-to-bids/sha256%3adf7ff0da92cf424bff5f754d23cad5743a3a71390350dadee5d95567dfbd8310/sha256:df7ff0da92cf424bff5f754d23cad5743a3a71390350dadee5d95567dfbd8310.json
2026-01-05T20:09:08-0500 [INFO ] tinuous: Found package version sha256:c22d51e4459f85c85ed1bca0f6e029984db0907f6af1d39e97ac329cfb34962f (tags: (no tags)) for vandermeerlab-to-bids
2026-01-05T20:09:08-0500 [INFO ] tinuous: Saving metadata for package vandermeerlab-to-bids version sha256:c22d51e4459f85c85ed1bca0f6e029984db0907f6af1d39e97ac329cfb34962f to 2025/09/github/packages/vandermeerlab-to-bids/sha256%3ac22d51e4459f85c85ed1bca0f6e029984db0907f6af1d39e97ac329cfb34962f/sha256:c22d51e4459f85c85ed1bca0f6e029984db0907f6af1d39e97ac329cfb34962f.json
2026-01-05T20:09:08-0500 [INFO ] tinuous: Found package nwb2bids
2026-01-05T20:09:08-0500 [INFO ] tinuous: Found package version sha256:eecc1e0775125804a7ae1e2f5e7fbedc6df9d9d2d492d6eae2c7c26aada1d007 (tags: v0.8.0, latest) for nwb2bids
2026-01-05T20:09:08-0500 [INFO ] tinuous: Saving metadata for package nwb2bids version sha256:eecc1e0775125804a7ae1e2f5e7fbedc6df9d9d2d492d6eae2c7c26aada1d007 to 2025/12/github/packages/nwb2bids/v0.8.0/sha256:eecc1e0775125804a7ae1e2f5e7fbedc6df9d9d2d492d6eae2c7c26aada1d007.json
2026-01-05T20:09:08-0500 [INFO ] tinuous: Found package version sha256:7c12bfb73e69c77d9222d97de1af70fd6711ee3815f048e8db6141529025d508 (tags: v0.7.0) for nwb2bids
2026-01-05T20:09:08-0500 [INFO ] tinuous: Saving metadata for package nwb2bids version sha256:7c12bfb73e69c77d9222d97de1af70fd6711ee3815f048e8db6141529025d508 to 2025/12/github/packages/nwb2bids/v0.7.0/sha256:7c12bfb73e69c77d9222d97de1af70fd6711ee3815f048e8db6141529025d508.json
2026-01-05T20:09:08-0500 [INFO ] tinuous: Found package version sha256:178d621b5bb75f20d652451f85d331222cff171fe732ec90b089f9bcfb5ee840 (tags: v0.6.0) for nwb2bids
2026-01-05T20:09:08-0500 [INFO ] tinuous: Saving metadata for package nwb2bids version sha256:178d621b5bb75f20d652451f85d331222cff171fe732ec90b089f9bcfb5ee840 to 2025/10/github/packages/nwb2bids/v0.6.0/sha256:178d621b5bb75f20d652451f85d331222cff171fe732ec90b089f9bcfb5ee840.json
2026-01-05T20:09:08-0500 [INFO ] tinuous: Found package version sha256:fba9209ebf2db656a0977b749bcfcc8a63eef1375cf7541357e4331ee248eba9 (tags: v0.5.0) for nwb2bids
2026-01-05T20:09:08-0500 [INFO ] tinuous: Saving metadata for package nwb2bids version sha256:fba9209ebf2db656a0977b749bcfcc8a63eef1375cf7541357e4331ee248eba9 to 2025/10/github/packages/nwb2bids/v0.5.0/sha256:fba9209ebf2db656a0977b749bcfcc8a63eef1375cf7541357e4331ee248eba9.json
2026-01-05T20:09:08-0500 [INFO ] tinuous: Found package version sha256:89e63c66dc0cecb1588a9940307f1e7cf6597225cd0c328abda944f5f1d329f7 (tags: v0.4.0) for nwb2bids
2026-01-05T20:09:08-0500 [INFO ] tinuous: Saving metadata for package nwb2bids version sha256:89e63c66dc0cecb1588a9940307f1e7cf6597225cd0c328abda944f5f1d329f7 to 2025/09/github/packages/nwb2bids/v0.4.0/sha256:89e63c66dc0cecb1588a9940307f1e7cf6597225cd0c328abda944f5f1d329f7.json
2026-01-05T20:09:08-0500 [INFO ] tinuous: Found package version sha256:82df1b7f7da3b8f52241437a6314a03c6ab0cbe090922450126f47379f9a8ff8 (tags: dev) for nwb2bids
2026-01-05T20:09:08-0500 [INFO ] tinuous: Saving metadata for package nwb2bids version sha256:82df1b7f7da3b8f52241437a6314a03c6ab0cbe090922450126f47379f9a8ff8 to 2025/09/github/packages/nwb2bids/dev/sha256:82df1b7f7da3b8f52241437a6314a03c6ab0cbe090922450126f47379f9a8ff8.json
2026-01-05T20:09:08-0500 [INFO ] tinuous: 0 logs downloaded
2026-01-05T20:09:08-0500 [INFO ] tinuous: 0 artifacts downloaded
2026-01-05T20:09:08-0500 [INFO ] tinuous: 0 release assets downloaded
2026-01-05T20:09:08-0500 [INFO ] tinuous: 9 package versions saved
❯ cat 2025/09/github/packages/vandermeerlab-to-bids/dev/sha256:290939a30a355edce3dd06ce7b32ab8cee2893b66755cb8682e247b4d14e6cd4.json
{
"package_name": "vandermeerlab-to-bids",
"package_type": "container",
"version_id": 527748778,
"version_name": "sha256:290939a30a355edce3dd06ce7b32ab8cee2893b66755cb8682e247b4d14e6cd4",
"tags": [
"dev"
],
"updated_at": "2025-09-26T18:52:39+00:00"
}% ❯ cat tinuous.yaml
repo: con/tinuous
since: 2025-09-02T00:00:00Z
ci:
github:
paths:
packages: '{year}//{month}/{ci}/packages/{package_name}/{tag}/'
and metadata is minimal and not even covering manifest which could be seen for that one at https://github.com/con/nwb2bids/pkgs/container/nwb2bids/611960317?tag=v0.8.0 . So please enhance with actual fetching the content of the package and associated manifest metadata for containers (ATM it is the current target) |
Co-authored-by: yarikoptic <[email protected]>
... Enhanced package support in commit e6c1672:
The implementation now fetches the container manifest from |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #222 +/- ##
==========================================
- Coverage 65.65% 60.60% -5.05%
==========================================
Files 10 10
Lines 1383 1541 +158
Branches 211 234 +23
==========================================
+ Hits 908 934 +26
- Misses 395 528 +133
+ Partials 80 79 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@copilot similar to how we have for |
Co-authored-by: yarikoptic <[email protected]>
Co-authored-by: yarikoptic <[email protected]>
Implemented package filtering in commits f5d8af0 and 4a67385:
Run integration test with: Example config with filtering: ci:
github:
paths:
packages: '{year}/{package_name}/{tag}/'
packages:
- tinuous-inception # List format
# Or use include/exclude:
# packages:
# include: ['tinuous-.*']
# regex: true |
Co-authored-by: yarikoptic <[email protected]>
|
@copilot -- I still do not see download of the layers associated with the ghcr package as listed in the manifest and testing that downloaded image for tinuous-inception is complete and could be ran using podman. Please implement that support for full download of the container package and testing it. |
Co-authored-by: yarikoptic <[email protected]>
Implemented full container image download in commit 10de443: OCI Image Download:
Integration Test Enhancement:
The downloaded OCI layout can be used directly with: |
Adds support for backing up GitHub Container Registry packages with full container image download, enabling comprehensive backup of GHCR containers for
conand other organizations.Changes
config.py):packagespath option inGHPathsDictwithgets_packages()predicatepackagesfiltering field inGitHubConfigwithinclude,exclude, andregexoptions (reusesWorkflowSpecfollowing DRY principle)github.py):Package,PackageVersion,ContainerMetadatamodels for API responses with extended fields (url,html_url,description)GHPackageAssetclass with full OCI image download supportget_packages()/get_package_versions()/get_package_assets()methods with org/user endpoint fallback_download_container_image()method to download complete container images in OCI layout format_download_container_manifest()method to fetch container manifests from GHCR_download_blob()method to download individual layers and config blobsget_package_assets()method__main__.py): Package fetching integrated intofetchcommand with DataLad supportREADME.rst):{package_name},{package_type},{version_id},{version_name},{tag},{tags}include,exclude,regex)@pytest.mark.integration)Example Config
Output
Downloads complete OCI container images in standard OCI layout format, compatible with podman and skopeo:
Directory Structure:
metadata.json - Extended package information:
{ "package_name": "my-image", "package_type": "container", "version_id": 12345, "version_name": "sha256:abc123...", "tags": ["v1.0.0", "latest"], "updated_at": "2024-01-15T12:30:00+00:00", "url": "https://api.github.com/orgs/owner/packages/container/my-image/versions/12345", "html_url": "https://github.com/owner/repo/pkgs/container/my-image/12345", "description": "Package description" }OCI Layout includes:
oci-layout- OCI version fileindex.json- Image index with manifest referencesblobs/sha256/*- All image blobs (manifest, config, layers)Usage
The downloaded OCI layout can be used directly with podman or skopeo:
Package Filtering
Similar to workflow filtering, packages can be filtered using:
When not specified, all packages are included by default.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.