-
Notifications
You must be signed in to change notification settings - Fork 749
feat: 4184 ai oci model support #4335
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: main
Are you sure you want to change the base?
Changes from 30 commits
6ceef5f
f92b7d2
1ad4a27
bcd47d1
b702952
08c0572
f664f9e
c689dcf
64dc451
38c0e6e
9a2a45f
9b31c04
6daea43
b18f7bb
cdb41b0
b80592f
56761ce
9609ce2
2976df5
7ed34c8
efcfecb
8031957
ec978f0
1a85625
bfe63bb
ffdd219
f5fd311
ea50011
2da3718
dbe0716
39a48d9
a4ef861
04365f3
9e83ddc
ea64192
28dbf2f
c1929fe
924c790
11e744d
2718e33
1bcd85c
74fdc90
80ada3c
8e2ef24
9e79513
e9a3b9e
4971537
a141a73
a69941e
aa4d2b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,39 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| package ocimodelsource | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import "github.com/anchore/syft/syft/source" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // OCIModelMetadata represents all static metadata that defines what an OCI model artifact is. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // This is similar to ImageMetadata but includes model-specific fields and OCI artifact annotations. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type OCIModelMetadata struct { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Core OCI artifact metadata (mirrors ImageMetadata) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| UserInput string `json:"userInput"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ID string `json:"artifactID"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ManifestDigest string `json:"manifestDigest"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MediaType string `json:"mediaType"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Tags []string `json:"tags"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Size int64 `json:"artifactSize"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Layers []source.LayerMetadata `json:"layers"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RawManifest []byte `json:"manifest"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RawConfig []byte `json:"config"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RepoDigests []string `json:"repoDigests"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Architecture string `json:"architecture"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Variant string `json:"architectureVariant,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| OS string `json:"os"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Labels map[string]string `json:"labels,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // OCI-specific metadata | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Annotations map[string]string `json:"annotations,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Model-specific metadata | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ModelFormat string `json:"modelFormat,omitempty"` // e.g., "gguf" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GGUFLayers []GGUFLayerInfo `json:"ggufLayers,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type OCIModelMetadata struct { | |
| // Core OCI artifact metadata (mirrors ImageMetadata) | |
| UserInput string `json:"userInput"` | |
| ID string `json:"artifactID"` | |
| ManifestDigest string `json:"manifestDigest"` | |
| MediaType string `json:"mediaType"` | |
| Tags []string `json:"tags"` | |
| Size int64 `json:"artifactSize"` | |
| Layers []source.LayerMetadata `json:"layers"` | |
| RawManifest []byte `json:"manifest"` | |
| RawConfig []byte `json:"config"` | |
| RepoDigests []string `json:"repoDigests"` | |
| Architecture string `json:"architecture"` | |
| Variant string `json:"architectureVariant,omitempty"` | |
| OS string `json:"os"` | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // OCI-specific metadata | |
| Annotations map[string]string `json:"annotations,omitempty"` | |
| // Model-specific metadata | |
| ModelFormat string `json:"modelFormat,omitempty"` // e.g., "gguf" | |
| GGUFLayers []GGUFLayerInfo `json:"ggufLayers,omitempty"` | |
| } | |
| type OCIModelMetadata{ | |
| ImageMetadata | |
| Annotations map[string]string | |
| } |
or
| type OCIModelMetadata struct { | |
| // Core OCI artifact metadata (mirrors ImageMetadata) | |
| UserInput string `json:"userInput"` | |
| ID string `json:"artifactID"` | |
| ManifestDigest string `json:"manifestDigest"` | |
| MediaType string `json:"mediaType"` | |
| Tags []string `json:"tags"` | |
| Size int64 `json:"artifactSize"` | |
| Layers []source.LayerMetadata `json:"layers"` | |
| RawManifest []byte `json:"manifest"` | |
| RawConfig []byte `json:"config"` | |
| RepoDigests []string `json:"repoDigests"` | |
| Architecture string `json:"architecture"` | |
| Variant string `json:"architectureVariant,omitempty"` | |
| OS string `json:"os"` | |
| Labels map[string]string `json:"labels,omitempty"` | |
| // OCI-specific metadata | |
| Annotations map[string]string `json:"annotations,omitempty"` | |
| // Model-specific metadata | |
| ModelFormat string `json:"modelFormat,omitempty"` // e.g., "gguf" | |
| GGUFLayers []GGUFLayerInfo `json:"ggufLayers,omitempty"` | |
| } | |
| type OCIModelMetadata ImageMetadata |
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'm not saying this must be done, but given that the gguf/model format properties are redundant, then it is essentially the same. The annotations are new, however, still relevant to OCI images.
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.
we should probably have id:- to ensure this doesn't affect the ID of existing sources. Probably worth a test to ensure this isn't changing
Uh oh!
There was an error while loading. Please reload this page.