Skip to content

Commit

Permalink
Initial commit for OCI dist spec v1.1.0 agent support
Browse files Browse the repository at this point in the history
Partially addresses kubeflow/community#682

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
  • Loading branch information
rchincha committed Mar 21, 2024
1 parent 11e0ab2 commit 99fab15
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 15 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ deploy-ci: manifests
deploy-helm: manifests
helm install kserve-crd charts/kserve-crd/ --wait --timeout 180s
helm install kserve charts/kserve-resources/ --wait --timeout 180s
# deploy a OCI dist spec v1.1.0 registry
helm repo add project-zot http://zotregistry.dev/helm-charts
helm install --set service.port=5000 zot project-zot/zot

undeploy:
kubectl delete -k config/default
Expand Down
27 changes: 27 additions & 0 deletions pkg/agent/storage/oci.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
Copyright 2021 The KServe Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package storage

import "net/http"

type OCIProvider struct {
Client *http.Client
}

func (p *OCIProvider) DownloadModel(modelDir string, modelName string, storageUri string) error {
return nil
}
4 changes: 3 additions & 1 deletion pkg/agent/storage/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ const (
//File Protocol = "file://"
HTTPS Protocol = "https://"
HTTP Protocol = "http://"
// OCI dist spec v1.1.0
OCI Protocol = "oci://"
)

var SupportedProtocols = []Protocol{S3, GCS, HTTPS, HTTP}
var SupportedProtocols = []Protocol{S3, GCS, HTTPS, HTTP, OCI}

func GetAllProtocol() (protocols []string) {
for _, protocol := range SupportedProtocols {
Expand Down
14 changes: 0 additions & 14 deletions pkg/apis/serving/v1beta1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ func TestIsPrefixSupported(t *testing.T) {
"GCS://",
"HTTP://",
"HTTPS://",
"OCI://",
}
scenarios := map[string]struct {
input string
Expand Down

0 comments on commit 99fab15

Please sign in to comment.