forked from kubeflow/model-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'kubeflow:main' into main
- Loading branch information
Showing
59 changed files
with
1,985 additions
and
943 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,10 @@ GO ?= "$(shell which go)" | |
BFF_PATH := $(PROJECT_PATH)/clients/ui/bff | ||
UI_PATH := $(PROJECT_PATH)/clients/ui/frontend | ||
|
||
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. | ||
ENVTEST_K8S_VERSION = 1.29 | ||
ENVTEST ?= $(PROJECT_BIN)/setup-envtest | ||
|
||
# add tools bin directory | ||
PATH := $(PROJECT_BIN):$(PATH) | ||
|
||
|
@@ -133,6 +137,9 @@ bin/protoc-gen-go: | |
bin/protoc-gen-go-grpc: | ||
GOBIN=$(PROJECT_BIN) ${GO} install google.golang.org/grpc/cmd/[email protected] | ||
|
||
bin/envtest: | ||
GOBIN=$(PROJECT_BIN) ${GO} install sigs.k8s.io/controller-runtime/tools/[email protected] | ||
|
||
GOLANGCI_LINT ?= ${PROJECT_BIN}/golangci-lint | ||
bin/golangci-lint: | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(PROJECT_BIN) v1.61.0 | ||
|
@@ -164,7 +171,7 @@ clean/deps: | |
rm -Rf bin/* | ||
|
||
.PHONY: deps | ||
deps: bin/protoc bin/go-enum bin/protoc-gen-go bin/protoc-gen-go-grpc bin/golangci-lint bin/goverter bin/openapi-generator-cli | ||
deps: bin/protoc bin/go-enum bin/protoc-gen-go bin/protoc-gen-go-grpc bin/golangci-lint bin/goverter bin/openapi-generator-cli bin/envtest | ||
|
||
.PHONY: vendor | ||
vendor: | ||
|
@@ -196,20 +203,20 @@ gen: deps gen/grpc gen/openapi gen/openapi-server gen/converter | |
|
||
.PHONY: lint | ||
lint: | ||
${GOLANGCI_LINT} run main.go | ||
${GOLANGCI_LINT} run cmd/... internal/... ./pkg/... | ||
${GOLANGCI_LINT} run main.go --timeout 3m | ||
${GOLANGCI_LINT} run cmd/... internal/... ./pkg/... --timeout 3m | ||
|
||
.PHONY: test | ||
test: gen | ||
${GO} test ./internal/... ./pkg/... | ||
test: gen bin/envtest | ||
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" ${GO} test ./internal/... ./pkg/... | ||
|
||
.PHONY: test-nocache | ||
test-nocache: gen | ||
${GO} test ./internal/... ./pkg/... -count=1 | ||
test-nocache: gen bin/envtest | ||
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" ${GO} test ./internal/... ./pkg/... -count=1 | ||
|
||
.PHONY: test-cover | ||
test-cover: gen | ||
${GO} test ./internal/... ./pkg/... -coverprofile=coverage.txt | ||
test-cover: gen bin/envtest | ||
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" ${GO} test ./internal/... ./pkg/... -coverprofile=coverage.txt | ||
${GO} tool cover -html=coverage.txt -o coverage.html | ||
|
||
.PHONY: run/proxy | ||
|
@@ -249,12 +256,12 @@ ifeq ($(DOCKER),docker) | |
# docker uses builder containers | ||
- $(DOCKER) buildx rm model-registry-builder | ||
$(DOCKER) buildx create --use --name model-registry-builder --platform=$(PLATFORMS) | ||
$(DOCKER) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f ${DOCKERFILE} . | ||
$(DOCKER) buildx build --push --platform=$(PLATFORMS) --tag ${IMG}:$(IMG_VERSION) -f ${DOCKERFILE} . | ||
$(DOCKER) buildx rm model-registry-builder | ||
else ifeq ($(DOCKER),podman) | ||
# podman uses image manifests | ||
$(DOCKER) manifest create -a ${IMG} | ||
$(DOCKER) buildx build --platform=$(PLATFORMS) --manifest ${IMG} -f ${DOCKERFILE} . | ||
$(DOCKER) buildx build --platform=$(PLATFORMS) --manifest ${IMG}:$(IMG_VERSION) -f ${DOCKERFILE} . | ||
$(DOCKER) manifest push ${IMG} | ||
$(DOCKER) manifest rm ${IMG} | ||
else | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
############### Default settings ############### | ||
CONTAINER_TOOL=docker | ||
IMG_BFF=kubeflow/model-registry-bff:dev-latest | ||
IMG_FRONTEND=kubeflow/model-registry-ui:dev-latest | ||
IMG_BFF=kubeflow/model-registry-bff:latest | ||
IMG_FRONTEND=kubeflow/model-registry-ui:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
approvers: | ||
- ederign | ||
- alexcreasy | ||
- lucferbux | ||
- Griffin-Sullivan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,21 +71,23 @@ make docker-build | |
| POST /api/v1/model_registry/{model_registry_id}/model_versions/{model_version_id}/artifacts | CreateModelArtifactByModelVersion | Create a ModelArtifact entity for a specific ModelVersion | | ||
|
||
### Sample local calls | ||
|
||
You will need to inject your requests with a kubeflow-userid header for authorization purposes. When running the service with the mocked Kubernetes client (MOCK_K8S_CLIENT=true), the user [email protected] is preconfigured with the necessary RBAC permissions to perform these actions. | ||
``` | ||
# GET /v1/healthcheck | ||
curl -i localhost:4000/api/v1/healthcheck | ||
curl -i -H "kubeflow-userid: [email protected]" localhost:4000/api/v1/healthcheck | ||
``` | ||
``` | ||
# GET /v1/model_registry | ||
curl -i localhost:4000/api/v1/model_registry | ||
curl -i -H "kubeflow-userid: [email protected]" localhost:4000/api/v1/model_registry | ||
``` | ||
``` | ||
# GET /v1/model_registry/{model_registry_id}/registered_models | ||
curl -i localhost:4000/api/v1/model_registry/model-registry/registered_models | ||
curl -i -H "kubeflow-userid: [email protected]" localhost:4000/api/v1/model_registry/model-registry/registered_models | ||
``` | ||
``` | ||
#POST /v1/model_registry/{model_registry_id}/registered_models | ||
curl -i -X POST "http://localhost:4000/api/v1/model_registry/model-registry/registered_models" \ | ||
curl -i -H "kubeflow-userid: [email protected]" -X POST "http://localhost:4000/api/v1/model_registry/model-registry/registered_models" \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ "data": { | ||
"customProperties": { | ||
|
@@ -103,23 +105,23 @@ curl -i -X POST "http://localhost:4000/api/v1/model_registry/model-registry/regi | |
``` | ||
``` | ||
# GET /v1/model_registry/{model_registry_id}/registered_models/{registered_model_id} | ||
curl -i localhost:4000/api/v1/model_registry/model-registry/registered_models/1 | ||
curl -i -H "kubeflow-userid: [email protected]" localhost:4000/api/v1/model_registry/model-registry/registered_models/1 | ||
``` | ||
``` | ||
# PATCH /v1/model_registry/{model_registry_id}/registered_models/{registered_model_id} | ||
curl -i -X PATCH "http://localhost:4000/api/v1/model_registry/model-registry/registered_models/1" \ | ||
curl -i -H "kubeflow-userid: [email protected]" -X PATCH "http://localhost:4000/api/v1/model_registry/model-registry/registered_models/1" \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ "data": { | ||
"description": "New description" | ||
}}' | ||
``` | ||
``` | ||
# GET /api/v1/model_registry/{model_registry_id}/model_versions/{model_version_id} | ||
curl -i http://localhost:4000/api/v1/model_registry/model-registry/model_versions/1 | ||
curl -i -H "kubeflow-userid: [email protected]" http://localhost:4000/api/v1/model_registry/model-registry/model_versions/1 | ||
``` | ||
``` | ||
# POST /api/v1/model_registry/{model_registry_id}/model_versions | ||
curl -i -X POST "http://localhost:4000/api/v1/model_registry/model-registry/model_versions" \ | ||
curl -i -H "kubeflow-userid: [email protected]" -X POST "http://localhost:4000/api/v1/model_registry/model-registry/model_versions" \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ "data": { | ||
"customProperties": { | ||
|
@@ -138,19 +140,19 @@ curl -i -X POST "http://localhost:4000/api/v1/model_registry/model-registry/mode | |
``` | ||
``` | ||
# PATCH /api/v1/model_registry/{model_registry_id}/model_versions/{model_version_id} | ||
curl -i -X PATCH "http://localhost:4000/api/v1/model_registry/model-registry/model_versions/1" \ | ||
curl -i -H "kubeflow-userid: [email protected]" -X PATCH "http://localhost:4000/api/v1/model_registry/model-registry/model_versions/1" \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ "data": { | ||
"description": "New description 2" | ||
}}' | ||
``` | ||
``` | ||
# GET /v1/model_registry/{model_registry_id}/registered_models/{registered_model_id}/versions | ||
curl -i localhost:4000/api/v1/model_registry/model-registry/registered_models/1/versions | ||
curl -i -H "kubeflow-userid: [email protected]" localhost:4000/api/v1/model_registry/model-registry/registered_models/1/versions | ||
``` | ||
``` | ||
# POST /v1/model_registry/{model_registry_id}/registered_models/{registered_model_id}/versions | ||
curl -i -X POST "http://localhost:4000/api/v1/model_registry/model-registry/registered_models/1/versions" \ | ||
curl -i -H "kubeflow-userid: [email protected]" -X POST "http://localhost:4000/api/v1/model_registry/model-registry/registered_models/1/versions" \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ "data": { | ||
"customProperties": { | ||
|
@@ -163,17 +165,17 @@ curl -i -X POST "http://localhost:4000/api/v1/model_registry/model-registry/regi | |
"externalId": "9928", | ||
"name": "ModelVersion One", | ||
"state": "LIVE", | ||
"author": "alex" | ||
"author": "alex", | ||
"registeredModelId: "1" | ||
}}' | ||
``` | ||
``` | ||
# GET /api/v1/model_registry/{model_registry_id}/model_versions/{model_version_id}/artifacts | ||
curl -i http://localhost:4000/api/v1/model_registry/model-registry/model_versions/1/artifacts | ||
curl -i -H "kubeflow-userid: [email protected]" http://localhost:4000/api/v1/model_registry/model-registry/model_versions/1/artifacts | ||
``` | ||
``` | ||
# POST /api/v1/model_registry/{model_registry_id}/model_versions/{model_version_id}/artifacts | ||
curl -i -X POST "http://localhost:4000/api/v1/model_registry/model-registry/model_versions/1/artifacts" \ | ||
curl -i -H "kubeflow-userid: [email protected]" -X POST "http://localhost:4000/api/v1/model_registry/model-registry/model_versions/1/artifacts" \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ "data": { | ||
"customProperties": { | ||
|
@@ -203,9 +205,9 @@ The following query parameters are supported by "Get All" style endpoints to con | |
### Sample local calls | ||
``` | ||
# Get with a page size of 5 getting a specific page. | ||
curl -i "http://localhost:4000/api/v1/model_registry/model-registry/registered_models?pageSize=5&nextPageToken=CAEQARoCCAE" | ||
curl -i -H "kubeflow-userid: [email protected]" "http://localhost:4000/api/v1/model_registry/model-registry/registered_models?pageSize=5&nextPageToken=CAEQARoCCAE" | ||
``` | ||
``` | ||
# Get with a page size of 5, order by last update time in descending order. | ||
curl -i "http://localhost:4000/api/v1/model_registry/model-registry/registered_models?pageSize=5&orderBy=LAST_UPDATE_TIME&sortOrder=DESC" | ||
curl -i -H "kubeflow-userid: [email protected]" "http://localhost:4000/api/v1/model_registry/model-registry/registered_models?pageSize=5&orderBy=LAST_UPDATE_TIME&sortOrder=DESC" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.