Skip to content

NOISSUE - Implement extensible resource downloader framework with support for S3, GCS, and OCI sources#590

Merged
dborovcanin merged 5 commits into
ultravioletrs:mainfrom
SammyOina:s3
Apr 28, 2026
Merged

NOISSUE - Implement extensible resource downloader framework with support for S3, GCS, and OCI sources#590
dborovcanin merged 5 commits into
ultravioletrs:mainfrom
SammyOina:s3

Conversation

@SammyOina

Copy link
Copy Markdown
Contributor

What type of PR is this?

What does this do?

Which issue(s) does this PR fix/relate to?

  • Related Issue #
  • Resolves #

Have you included tests for your changes?

Did you document any new/modified feature?

Notes

… for S3, GCS, and OCI sources

Signed-off-by: SammyOina <sammyoina@gmail.com>
Comment thread agent/service.go
Comment on lines +589 to +604
// inferSourceType infers the resource source type from the URL scheme.
func inferSourceType(url string) string {
switch {
case strings.HasPrefix(url, "docker://"), strings.HasPrefix(url, "oci:"):
return resource.SourceTypeOCIImage
case strings.HasPrefix(url, "s3://"):
return resource.SourceTypeS3
case strings.HasPrefix(url, "gs://"):
return resource.SourceTypeGCS
case strings.HasPrefix(url, "https://"):
return resource.SourceTypeHTTPS
case strings.HasPrefix(url, "http://"):
return resource.SourceTypeHTTP
default:
return ""
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be more effective to use scheme instead of prefix matching.
Something like

u, err := urlpkg.Parse(url)
if err != nil {
return ""
}

Comment thread agent/service.go Outdated
// inferSourceType infers the resource source type from the URL scheme.
func inferSourceType(url string) string {
switch {
case strings.HasPrefix(url, "docker://"), strings.HasPrefix(url, "oci:"):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need to handle a scenario where the user may enter oci without a scheme.

…mage references

Signed-off-by: Sammy Oina <sammyoina@gmail.com>
@SammyOina SammyOina requested review from smithjilks April 27, 2026 09:34
…ence, and update python unit tests with event mock expectations

Signed-off-by: Sammy Oina <sammyoina@gmail.com>
@codecov

codecov Bot commented Apr 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.69231% with 71 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.48%. Comparing base (b44780d) to head (e5b504a).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pkg/resource/s3.go 52.85% 33 Missing ⚠️
agent/service.go 77.77% 11 Missing and 11 partials ⚠️
pkg/resource/http.go 69.69% 5 Missing and 5 partials ⚠️
pkg/resource/decrypt.go 75.00% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #590      +/-   ##
==========================================
+ Coverage   68.36%   68.48%   +0.11%     
==========================================
  Files         116      121       +5     
  Lines        7344     7612     +268     
==========================================
+ Hits         5021     5213     +192     
- Misses       1746     1805      +59     
- Partials      577      594      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…tion, and improve resource download error handling

Signed-off-by: Sammy Oina <sammyoina@gmail.com>
Signed-off-by: Sammy Oina <sammyoina@gmail.com>

@smithjilks smithjilks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dborovcanin dborovcanin merged commit c59a413 into ultravioletrs:main Apr 28, 2026
10 checks passed
drasko pushed a commit that referenced this pull request May 8, 2026
* Added GPU evidence collection

* Added GPU evidence verification

* Added make command for nvattest helper

* Added command for installing all services

* changed attestion-service.service so it knows where the helper is

* Possible IGVM script bug

* Possible bug

* Bug

* bug

* Revert "bug"

This reverts commit d81d67e.

* Revert "Bug"

This reverts commit 5e566d5.

* Revert "Possible bug"

This reverts commit 47d13fe.

* Revert "Possible IGVM script bug"

This reverts commit 3fb1b79.

* Revert "changed attestion-service.service so it knows where the helper is"

This reverts commit f9f11ed.

* Revert "Added command for installing all services"

This reverts commit 5dcf7a5.

* NOISSUE - Enforce binding label check (#589)

* NOISSUE - Implement extensible resource downloader framework with support for S3, GCS, and OCI sources (#590)

* feat: implement extensible resource downloader framework with support for S3, GCS, and OCI sources

Signed-off-by: SammyOina <sammyoina@gmail.com>

* refactor: improve resource URL parsing and add support for bare OCI image references

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* fix: add empty string check and slash requirement for OCI image inference, and update python unit tests with event mock expectations

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* refactor: introduce OCIClient interface, add test coverage for decryption, and improve resource download error handling

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* chore: remove trailing whitespace in OCI downloader and HTTP tests

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* Refactored baed on comments

* Added GPU evidence collection

* Added GPU evidence verification

* Added make command for nvattest helper

* Added command for installing all services

* changed attestion-service.service so it knows where the helper is

* Possible IGVM script bug

* Possible bug

* Bug

* bug

* Revert "bug"

This reverts commit d81d67e.

* Revert "Bug"

This reverts commit 5e566d5.

* Revert "Possible bug"

This reverts commit 47d13fe.

* Revert "Possible IGVM script bug"

This reverts commit 3fb1b79.

* Revert "changed attestion-service.service so it knows where the helper is"

This reverts commit f9f11ed.

* Revert "Added command for installing all services"

This reverts commit 5dcf7a5.

* Refactored baed on comments

* fixed lint error

* fixed tests

* Fixed according to comments

* COCOS-584 - Support multiple kbs (#587)

* feat: Implement per-resource KBS configuration, allowing algorithms and datasets to specify individual KBS URLs.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* refactor: Encapsulate CLI error handling and CVM certificate paths within the CLI struct, and add algorithm type to agent's algorithm structure.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* style: Remove blank lines and fix indentation in CLI commands.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* refactor: Update downloadAndDecryptGenericResource to accept KBS URL as a parameter and adjust related tests

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* refactor: group CLI configuration into structured types and simplify skopeo decryption key handling

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

---------

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* Added GPU evidence collection

* Added GPU evidence verification

* Added make command for nvattest helper

* Added command for installing all services

* changed attestion-service.service so it knows where the helper is

* Possible IGVM script bug

* Possible bug

* Bug

* bug

* Revert "bug"

This reverts commit d81d67e.

* Revert "Bug"

This reverts commit 5e566d5.

* Revert "Possible bug"

This reverts commit 47d13fe.

* Revert "Possible IGVM script bug"

This reverts commit 3fb1b79.

* Revert "changed attestion-service.service so it knows where the helper is"

This reverts commit f9f11ed.

* Revert "Added command for installing all services"

This reverts commit 5dcf7a5.

* Refactored baed on comments

* Added GPU evidence collection

* Added GPU evidence verification

* Added make command for nvattest helper

* Added command for installing all services

* changed attestion-service.service so it knows where the helper is

* Possible IGVM script bug

* Possible bug

* Bug

* bug

* Revert "bug"

This reverts commit d81d67e.

* Revert "Bug"

This reverts commit 5e566d5.

* Revert "Possible bug"

This reverts commit 47d13fe.

* Revert "Possible IGVM script bug"

This reverts commit 3fb1b79.

* Revert "changed attestion-service.service so it knows where the helper is"

This reverts commit f9f11ed.

* Revert "Added command for installing all services"

This reverts commit 5dcf7a5.

* Refactored baed on comments

* fixed lint error

* fixed tests

* Fixed according to comments

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
Co-authored-by: Danko Miladinovic <72250944+danko-miladinovic@users.noreply.github.com>
Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants