From 694053a39f4906d1a46e58695812d563aadc5e4f Mon Sep 17 00:00:00 2001 From: Andrea Lamparelli Date: Wed, 4 Dec 2024 17:22:39 +0100 Subject: [PATCH] Move csi under /cmd Signed-off-by: Andrea Lamparelli --- Makefile | 6 +++--- Dockerfile.csi => cmd/csi/Dockerfile.csi | 3 --- {clients => cmd}/csi/GET_STARTED.md | 0 {clients => cmd}/csi/README.md | 0 {clients => cmd}/csi/main.go | 4 ++-- .../csi}/samples/modelregistry.clusterstoragecontainer.yaml | 0 {clients/csi/pkg => internal/csi}/constants/constants.go | 0 .../csi/pkg => internal/csi}/modelregistry/api_client.go | 2 +- .../pkg => internal/csi}/storage/modelregistry_provider.go | 2 +- 9 files changed, 7 insertions(+), 10 deletions(-) rename Dockerfile.csi => cmd/csi/Dockerfile.csi (94%) rename {clients => cmd}/csi/GET_STARTED.md (100%) rename {clients => cmd}/csi/README.md (100%) rename {clients => cmd}/csi/main.go (90%) rename {clients/csi/config => cmd/csi}/samples/modelregistry.clusterstoragecontainer.yaml (100%) rename {clients/csi/pkg => internal/csi}/constants/constants.go (100%) rename {clients/csi/pkg => internal/csi}/modelregistry/api_client.go (93%) rename {clients/csi/pkg => internal/csi}/storage/modelregistry_provider.go (98%) diff --git a/Makefile b/Makefile index 8497ea794..15e783cf1 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ PROJECT_BIN := $(PROJECT_PATH)/bin GO ?= "$(shell which go)" BFF_PATH := $(PROJECT_PATH)/clients/ui/bff UI_PATH := $(PROJECT_PATH)/clients/ui/frontend -CSI_PATH := $(PROJECT_PATH)/clients/csi +CSI_PATH := $(PROJECT_PATH)/cmd/csi # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.29 @@ -50,7 +50,7 @@ endif # The BUILD_PATH is still the root ifeq ($(IMG_REPO),model-registry-storage-initializer) - DOCKERFILE := Dockerfile.csi + DOCKERFILE := $(CSI_PATH)/Dockerfile.csi endif model-registry: build @@ -229,7 +229,7 @@ lint: .PHONY: lint/csi lint/csi: ${GOLANGCI_LINT} run ${CSI_PATH}/main.go - ${GOLANGCI_LINT} run ${CSI_PATH}/pkg/... + ${GOLANGCI_LINT} run internal/csi/... .PHONY: test test: gen bin/envtest diff --git a/Dockerfile.csi b/cmd/csi/Dockerfile.csi similarity index 94% rename from Dockerfile.csi rename to cmd/csi/Dockerfile.csi index 809e93d7e..1df4e83b6 100644 --- a/Dockerfile.csi +++ b/cmd/csi/Dockerfile.csi @@ -29,9 +29,6 @@ COPY scripts/ scripts/ COPY pkg/ pkg/ COPY patches/ patches/ COPY templates/ templates/ -# csi specific source code -COPY clients/csi/main.go clients/csi/ -COPY clients/csi/pkg/ clients/csi/pkg/ # Download tools RUN make deps diff --git a/clients/csi/GET_STARTED.md b/cmd/csi/GET_STARTED.md similarity index 100% rename from clients/csi/GET_STARTED.md rename to cmd/csi/GET_STARTED.md diff --git a/clients/csi/README.md b/cmd/csi/README.md similarity index 100% rename from clients/csi/README.md rename to cmd/csi/README.md diff --git a/clients/csi/main.go b/cmd/csi/main.go similarity index 90% rename from clients/csi/main.go rename to cmd/csi/main.go index 0e04a7e38..63e512523 100644 --- a/clients/csi/main.go +++ b/cmd/csi/main.go @@ -4,8 +4,8 @@ import ( "log" "os" - "github.com/kubeflow/model-registry/clients/csi/pkg/modelregistry" - "github.com/kubeflow/model-registry/clients/csi/pkg/storage" + "github.com/kubeflow/model-registry/internal/csi/modelregistry" + "github.com/kubeflow/model-registry/internal/csi/storage" "github.com/kubeflow/model-registry/pkg/openapi" ) diff --git a/clients/csi/config/samples/modelregistry.clusterstoragecontainer.yaml b/cmd/csi/samples/modelregistry.clusterstoragecontainer.yaml similarity index 100% rename from clients/csi/config/samples/modelregistry.clusterstoragecontainer.yaml rename to cmd/csi/samples/modelregistry.clusterstoragecontainer.yaml diff --git a/clients/csi/pkg/constants/constants.go b/internal/csi/constants/constants.go similarity index 100% rename from clients/csi/pkg/constants/constants.go rename to internal/csi/constants/constants.go diff --git a/clients/csi/pkg/modelregistry/api_client.go b/internal/csi/modelregistry/api_client.go similarity index 93% rename from clients/csi/pkg/modelregistry/api_client.go rename to internal/csi/modelregistry/api_client.go index 3e8e0d0db..fed6355bf 100644 --- a/clients/csi/pkg/modelregistry/api_client.go +++ b/internal/csi/modelregistry/api_client.go @@ -5,7 +5,7 @@ import ( "log" "strings" - "github.com/kubeflow/model-registry/clients/csi/pkg/constants" + "github.com/kubeflow/model-registry/internal/csi/constants" "github.com/kubeflow/model-registry/pkg/openapi" ) diff --git a/clients/csi/pkg/storage/modelregistry_provider.go b/internal/csi/storage/modelregistry_provider.go similarity index 98% rename from clients/csi/pkg/storage/modelregistry_provider.go rename to internal/csi/storage/modelregistry_provider.go index 1ff3379bd..5695e2271 100644 --- a/clients/csi/pkg/storage/modelregistry_provider.go +++ b/internal/csi/storage/modelregistry_provider.go @@ -9,7 +9,7 @@ import ( "strings" kserve "github.com/kserve/kserve/pkg/agent/storage" - "github.com/kubeflow/model-registry/clients/csi/pkg/constants" + "github.com/kubeflow/model-registry/internal/csi/constants" "github.com/kubeflow/model-registry/pkg/openapi" )