diff --git a/clients/ui/bff/Dockerfile b/clients/ui/bff/Dockerfile index ac3e2a68..c06ebe76 100644 --- a/clients/ui/bff/Dockerfile +++ b/clients/ui/bff/Dockerfile @@ -12,13 +12,8 @@ COPY go.mod go.sum ./ RUN go mod download # Copy the go source files -COPY cmd/ cmd/ -COPY api/ api/ -COPY config/ config/ -COPY data/ data/ -COPY integrations/ integrations/ -COPY internals/ internals/ -COPY validation/ validation/ +COPY cmd/main.go cmd/main.go +COPY internal/ internal/ diff --git a/clients/ui/bff/cmd/main.go b/clients/ui/bff/cmd/main.go index 4b4b96ab..0652194a 100644 --- a/clients/ui/bff/cmd/main.go +++ b/clients/ui/bff/cmd/main.go @@ -3,8 +3,8 @@ package main import ( "flag" "fmt" - "github.com/kubeflow/model-registry/ui/bff/api" - "github.com/kubeflow/model-registry/ui/bff/config" + "github.com/kubeflow/model-registry/ui/bff/internal/api" + "github.com/kubeflow/model-registry/ui/bff/internal/config" "log/slog" "net/http" diff --git a/clients/ui/bff/api/app.go b/clients/ui/bff/internal/api/app.go similarity index 93% rename from clients/ui/bff/api/app.go rename to clients/ui/bff/internal/api/app.go index 36b0f6b9..e8b3fda4 100644 --- a/clients/ui/bff/api/app.go +++ b/clients/ui/bff/internal/api/app.go @@ -2,14 +2,14 @@ package api import ( "fmt" + "github.com/kubeflow/model-registry/ui/bff/internal/config" + "github.com/kubeflow/model-registry/ui/bff/internal/data" + "github.com/kubeflow/model-registry/ui/bff/internal/integrations" "log/slog" "net/http" "github.com/julienschmidt/httprouter" - "github.com/kubeflow/model-registry/ui/bff/config" - "github.com/kubeflow/model-registry/ui/bff/data" - "github.com/kubeflow/model-registry/ui/bff/integrations" - "github.com/kubeflow/model-registry/ui/bff/internals/mocks" + "github.com/kubeflow/model-registry/ui/bff/internal/mocks" ) const ( diff --git a/clients/ui/bff/api/errors.go b/clients/ui/bff/internal/api/errors.go similarity index 97% rename from clients/ui/bff/api/errors.go rename to clients/ui/bff/internal/api/errors.go index b70b8aaf..b15e1cd4 100644 --- a/clients/ui/bff/api/errors.go +++ b/clients/ui/bff/internal/api/errors.go @@ -3,7 +3,7 @@ package api import ( "encoding/json" "fmt" - "github.com/kubeflow/model-registry/ui/bff/integrations" + "github.com/kubeflow/model-registry/ui/bff/internal/integrations" "net/http" "strconv" ) diff --git a/clients/ui/bff/api/healthcheck__handler_test.go b/clients/ui/bff/internal/api/healthcheck__handler_test.go similarity index 87% rename from clients/ui/bff/api/healthcheck__handler_test.go rename to clients/ui/bff/internal/api/healthcheck__handler_test.go index 19c98eb7..e6350a85 100644 --- a/clients/ui/bff/api/healthcheck__handler_test.go +++ b/clients/ui/bff/internal/api/healthcheck__handler_test.go @@ -2,8 +2,8 @@ package api import ( "encoding/json" - "github.com/kubeflow/model-registry/ui/bff/config" - "github.com/kubeflow/model-registry/ui/bff/data" + "github.com/kubeflow/model-registry/ui/bff/internal/config" + "github.com/kubeflow/model-registry/ui/bff/internal/data" "github.com/stretchr/testify/assert" "io" "net/http" diff --git a/clients/ui/bff/api/healthcheck_handler.go b/clients/ui/bff/internal/api/healthcheck_handler.go similarity index 100% rename from clients/ui/bff/api/healthcheck_handler.go rename to clients/ui/bff/internal/api/healthcheck_handler.go diff --git a/clients/ui/bff/api/helpers.go b/clients/ui/bff/internal/api/helpers.go similarity index 100% rename from clients/ui/bff/api/helpers.go rename to clients/ui/bff/internal/api/helpers.go diff --git a/clients/ui/bff/api/helpers_test.go b/clients/ui/bff/internal/api/helpers_test.go similarity index 100% rename from clients/ui/bff/api/helpers_test.go rename to clients/ui/bff/internal/api/helpers_test.go diff --git a/clients/ui/bff/api/middleware.go b/clients/ui/bff/internal/api/middleware.go similarity index 97% rename from clients/ui/bff/api/middleware.go rename to clients/ui/bff/internal/api/middleware.go index b7d0385b..04cfc780 100644 --- a/clients/ui/bff/api/middleware.go +++ b/clients/ui/bff/internal/api/middleware.go @@ -4,7 +4,7 @@ import ( "context" "fmt" "github.com/julienschmidt/httprouter" - "github.com/kubeflow/model-registry/ui/bff/integrations" + "github.com/kubeflow/model-registry/ui/bff/internal/integrations" "k8s.io/client-go/rest" "net/http" ) diff --git a/clients/ui/bff/api/model_registry_handler.go b/clients/ui/bff/internal/api/model_registry_handler.go similarity index 91% rename from clients/ui/bff/api/model_registry_handler.go rename to clients/ui/bff/internal/api/model_registry_handler.go index 8a85870c..5f4d6957 100644 --- a/clients/ui/bff/api/model_registry_handler.go +++ b/clients/ui/bff/internal/api/model_registry_handler.go @@ -2,7 +2,7 @@ package api import ( "github.com/julienschmidt/httprouter" - "github.com/kubeflow/model-registry/ui/bff/data" + "github.com/kubeflow/model-registry/ui/bff/internal/data" "net/http" ) diff --git a/clients/ui/bff/api/model_registry_handler_test.go b/clients/ui/bff/internal/api/model_registry_handler_test.go similarity index 90% rename from clients/ui/bff/api/model_registry_handler_test.go rename to clients/ui/bff/internal/api/model_registry_handler_test.go index 355f4b6e..df3d1ae3 100644 --- a/clients/ui/bff/api/model_registry_handler_test.go +++ b/clients/ui/bff/internal/api/model_registry_handler_test.go @@ -2,8 +2,8 @@ package api import ( "encoding/json" - "github.com/kubeflow/model-registry/ui/bff/data" - "github.com/kubeflow/model-registry/ui/bff/internals/mocks" + "github.com/kubeflow/model-registry/ui/bff/internal/data" + "github.com/kubeflow/model-registry/ui/bff/internal/mocks" "github.com/stretchr/testify/assert" "io" "net/http" diff --git a/clients/ui/bff/api/model_versions_handler.go b/clients/ui/bff/internal/api/model_versions_handler.go similarity index 97% rename from clients/ui/bff/api/model_versions_handler.go rename to clients/ui/bff/internal/api/model_versions_handler.go index f8f77944..7b979267 100644 --- a/clients/ui/bff/api/model_versions_handler.go +++ b/clients/ui/bff/internal/api/model_versions_handler.go @@ -6,8 +6,8 @@ import ( "fmt" "github.com/julienschmidt/httprouter" "github.com/kubeflow/model-registry/pkg/openapi" - "github.com/kubeflow/model-registry/ui/bff/integrations" - "github.com/kubeflow/model-registry/ui/bff/validation" + "github.com/kubeflow/model-registry/ui/bff/internal/integrations" + "github.com/kubeflow/model-registry/ui/bff/internal/validation" "net/http" ) diff --git a/clients/ui/bff/api/model_versions_handler_test.go b/clients/ui/bff/internal/api/model_versions_handler_test.go similarity index 98% rename from clients/ui/bff/api/model_versions_handler_test.go rename to clients/ui/bff/internal/api/model_versions_handler_test.go index ffda872a..877856c4 100644 --- a/clients/ui/bff/api/model_versions_handler_test.go +++ b/clients/ui/bff/internal/api/model_versions_handler_test.go @@ -2,7 +2,7 @@ package api import ( "github.com/kubeflow/model-registry/pkg/openapi" - "github.com/kubeflow/model-registry/ui/bff/internals/mocks" + "github.com/kubeflow/model-registry/ui/bff/internal/mocks" "github.com/stretchr/testify/assert" "net/http" "testing" diff --git a/clients/ui/bff/api/registered_models_handler.go b/clients/ui/bff/internal/api/registered_models_handler.go similarity index 98% rename from clients/ui/bff/api/registered_models_handler.go rename to clients/ui/bff/internal/api/registered_models_handler.go index e456083e..ffff7cdc 100644 --- a/clients/ui/bff/api/registered_models_handler.go +++ b/clients/ui/bff/internal/api/registered_models_handler.go @@ -4,12 +4,12 @@ import ( "encoding/json" "errors" "fmt" + "github.com/kubeflow/model-registry/ui/bff/internal/integrations" + "github.com/kubeflow/model-registry/ui/bff/internal/validation" "net/http" "github.com/julienschmidt/httprouter" "github.com/kubeflow/model-registry/pkg/openapi" - "github.com/kubeflow/model-registry/ui/bff/integrations" - "github.com/kubeflow/model-registry/ui/bff/validation" ) type RegisteredModelEnvelope Envelope[*openapi.RegisteredModel, None] diff --git a/clients/ui/bff/api/registered_models_handler_test.go b/clients/ui/bff/internal/api/registered_models_handler_test.go similarity index 98% rename from clients/ui/bff/api/registered_models_handler_test.go rename to clients/ui/bff/internal/api/registered_models_handler_test.go index 133e22ab..33b073d4 100644 --- a/clients/ui/bff/api/registered_models_handler_test.go +++ b/clients/ui/bff/internal/api/registered_models_handler_test.go @@ -2,7 +2,7 @@ package api import ( "github.com/kubeflow/model-registry/pkg/openapi" - "github.com/kubeflow/model-registry/ui/bff/internals/mocks" + "github.com/kubeflow/model-registry/ui/bff/internal/mocks" "github.com/stretchr/testify/assert" "net/http" "testing" diff --git a/clients/ui/bff/api/test_utils.go b/clients/ui/bff/internal/api/test_utils.go similarity index 95% rename from clients/ui/bff/api/test_utils.go rename to clients/ui/bff/internal/api/test_utils.go index aea27d03..d0bbe526 100644 --- a/clients/ui/bff/api/test_utils.go +++ b/clients/ui/bff/internal/api/test_utils.go @@ -4,7 +4,7 @@ import ( "bytes" "context" "encoding/json" - "github.com/kubeflow/model-registry/ui/bff/internals/mocks" + "github.com/kubeflow/model-registry/ui/bff/internal/mocks" "io" "net/http" "net/http/httptest" diff --git a/clients/ui/bff/config/environment.go b/clients/ui/bff/internal/config/environment.go similarity index 100% rename from clients/ui/bff/config/environment.go rename to clients/ui/bff/internal/config/environment.go diff --git a/clients/ui/bff/data/health_check_model.go b/clients/ui/bff/internal/data/health_check_model.go similarity index 100% rename from clients/ui/bff/data/health_check_model.go rename to clients/ui/bff/internal/data/health_check_model.go diff --git a/clients/ui/bff/data/model_registry.go b/clients/ui/bff/internal/data/model_registry.go similarity index 91% rename from clients/ui/bff/data/model_registry.go rename to clients/ui/bff/internal/data/model_registry.go index 15f4516b..e3102883 100644 --- a/clients/ui/bff/data/model_registry.go +++ b/clients/ui/bff/internal/data/model_registry.go @@ -2,8 +2,7 @@ package data import ( "fmt" - - k8s "github.com/kubeflow/model-registry/ui/bff/integrations" + k8s "github.com/kubeflow/model-registry/ui/bff/internal/integrations" ) type ModelRegistryModel struct { diff --git a/clients/ui/bff/data/model_registry_client.go b/clients/ui/bff/internal/data/model_registry_client.go similarity index 100% rename from clients/ui/bff/data/model_registry_client.go rename to clients/ui/bff/internal/data/model_registry_client.go diff --git a/clients/ui/bff/data/model_registry_test.go b/clients/ui/bff/internal/data/model_registry_test.go similarity index 92% rename from clients/ui/bff/data/model_registry_test.go rename to clients/ui/bff/internal/data/model_registry_test.go index 4f137edd..c4ada613 100644 --- a/clients/ui/bff/data/model_registry_test.go +++ b/clients/ui/bff/internal/data/model_registry_test.go @@ -1,7 +1,7 @@ package data import ( - "github.com/kubeflow/model-registry/ui/bff/internals/mocks" + "github.com/kubeflow/model-registry/ui/bff/internal/mocks" "github.com/stretchr/testify/assert" "testing" ) diff --git a/clients/ui/bff/data/model_version.go b/clients/ui/bff/internal/data/model_version.go similarity index 98% rename from clients/ui/bff/data/model_version.go rename to clients/ui/bff/internal/data/model_version.go index 41057d0a..c84c08ef 100644 --- a/clients/ui/bff/data/model_version.go +++ b/clients/ui/bff/internal/data/model_version.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" "github.com/kubeflow/model-registry/pkg/openapi" - "github.com/kubeflow/model-registry/ui/bff/integrations" + "github.com/kubeflow/model-registry/ui/bff/internal/integrations" "net/url" ) diff --git a/clients/ui/bff/data/model_version_test.go b/clients/ui/bff/internal/data/model_version_test.go similarity index 98% rename from clients/ui/bff/data/model_version_test.go rename to clients/ui/bff/internal/data/model_version_test.go index a17f0d1f..b2da9637 100644 --- a/clients/ui/bff/data/model_version_test.go +++ b/clients/ui/bff/internal/data/model_version_test.go @@ -3,7 +3,7 @@ package data import ( "encoding/json" "github.com/brianvoe/gofakeit/v7" - "github.com/kubeflow/model-registry/ui/bff/internals/mocks" + "github.com/kubeflow/model-registry/ui/bff/internal/mocks" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "net/http" diff --git a/clients/ui/bff/data/models.go b/clients/ui/bff/internal/data/models.go similarity index 100% rename from clients/ui/bff/data/models.go rename to clients/ui/bff/internal/data/models.go diff --git a/clients/ui/bff/data/registered_model.go b/clients/ui/bff/internal/data/registered_model.go similarity index 98% rename from clients/ui/bff/data/registered_model.go rename to clients/ui/bff/internal/data/registered_model.go index cfefbfed..10acd55c 100644 --- a/clients/ui/bff/data/registered_model.go +++ b/clients/ui/bff/internal/data/registered_model.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" "github.com/kubeflow/model-registry/pkg/openapi" - "github.com/kubeflow/model-registry/ui/bff/integrations" + "github.com/kubeflow/model-registry/ui/bff/internal/integrations" "net/url" ) diff --git a/clients/ui/bff/data/registered_model_test.go b/clients/ui/bff/internal/data/registered_model_test.go similarity index 98% rename from clients/ui/bff/data/registered_model_test.go rename to clients/ui/bff/internal/data/registered_model_test.go index 871e1bc0..0af73f16 100644 --- a/clients/ui/bff/data/registered_model_test.go +++ b/clients/ui/bff/internal/data/registered_model_test.go @@ -3,7 +3,7 @@ package data import ( "encoding/json" "github.com/brianvoe/gofakeit/v7" - "github.com/kubeflow/model-registry/ui/bff/internals/mocks" + "github.com/kubeflow/model-registry/ui/bff/internal/mocks" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "net/http" diff --git a/clients/ui/bff/integrations/constants.go b/clients/ui/bff/internal/integrations/constants.go similarity index 100% rename from clients/ui/bff/integrations/constants.go rename to clients/ui/bff/internal/integrations/constants.go diff --git a/clients/ui/bff/integrations/http.go b/clients/ui/bff/internal/integrations/http.go similarity index 100% rename from clients/ui/bff/integrations/http.go rename to clients/ui/bff/internal/integrations/http.go diff --git a/clients/ui/bff/integrations/k8s.go b/clients/ui/bff/internal/integrations/k8s.go similarity index 100% rename from clients/ui/bff/integrations/k8s.go rename to clients/ui/bff/internal/integrations/k8s.go diff --git a/clients/ui/bff/integrations/k8s_test.go b/clients/ui/bff/internal/integrations/k8s_test.go similarity index 100% rename from clients/ui/bff/integrations/k8s_test.go rename to clients/ui/bff/internal/integrations/k8s_test.go diff --git a/clients/ui/bff/internals/mocks/http_mock.go b/clients/ui/bff/internal/mocks/http_mock.go similarity index 100% rename from clients/ui/bff/internals/mocks/http_mock.go rename to clients/ui/bff/internal/mocks/http_mock.go diff --git a/clients/ui/bff/internals/mocks/k8s_mock.go b/clients/ui/bff/internal/mocks/k8s_mock.go similarity index 94% rename from clients/ui/bff/internals/mocks/k8s_mock.go rename to clients/ui/bff/internal/mocks/k8s_mock.go index abbe4610..313eeb8b 100644 --- a/clients/ui/bff/internals/mocks/k8s_mock.go +++ b/clients/ui/bff/internal/mocks/k8s_mock.go @@ -1,7 +1,7 @@ package mocks import ( - k8s "github.com/kubeflow/model-registry/ui/bff/integrations" + k8s "github.com/kubeflow/model-registry/ui/bff/internal/integrations" "github.com/stretchr/testify/mock" "log/slog" ) diff --git a/clients/ui/bff/internals/mocks/model_registry_client_mock.go b/clients/ui/bff/internal/mocks/model_registry_client_mock.go similarity index 97% rename from clients/ui/bff/internals/mocks/model_registry_client_mock.go rename to clients/ui/bff/internal/mocks/model_registry_client_mock.go index 375f5dbf..b65aca0a 100644 --- a/clients/ui/bff/internals/mocks/model_registry_client_mock.go +++ b/clients/ui/bff/internal/mocks/model_registry_client_mock.go @@ -2,7 +2,7 @@ package mocks import ( "github.com/kubeflow/model-registry/pkg/openapi" - "github.com/kubeflow/model-registry/ui/bff/integrations" + "github.com/kubeflow/model-registry/ui/bff/internal/integrations" "github.com/stretchr/testify/mock" "log/slog" ) diff --git a/clients/ui/bff/internals/mocks/static_data_mock.go b/clients/ui/bff/internal/mocks/static_data_mock.go similarity index 100% rename from clients/ui/bff/internals/mocks/static_data_mock.go rename to clients/ui/bff/internal/mocks/static_data_mock.go diff --git a/clients/ui/bff/internals/mocks/types_mock.go b/clients/ui/bff/internal/mocks/types_mock.go similarity index 100% rename from clients/ui/bff/internals/mocks/types_mock.go rename to clients/ui/bff/internal/mocks/types_mock.go diff --git a/clients/ui/bff/validation/test_helpers.go b/clients/ui/bff/internal/validation/test_helpers.go similarity index 100% rename from clients/ui/bff/validation/test_helpers.go rename to clients/ui/bff/internal/validation/test_helpers.go diff --git a/clients/ui/bff/validation/validation.go b/clients/ui/bff/internal/validation/validation.go similarity index 100% rename from clients/ui/bff/validation/validation.go rename to clients/ui/bff/internal/validation/validation.go diff --git a/clients/ui/bff/validation/validation_test.go b/clients/ui/bff/internal/validation/validation_test.go similarity index 100% rename from clients/ui/bff/validation/validation_test.go rename to clients/ui/bff/internal/validation/validation_test.go