Skip to content

Commit

Permalink
Merge pull request #134 from tarilabs/tarilabs-20241015-sync
Browse files Browse the repository at this point in the history
periodic sync upstream KF to midstream ODH
  • Loading branch information
openshift-merge-bot[bot] authored Oct 16, 2024
2 parents 5181abc + d574a27 commit 37c6570
Show file tree
Hide file tree
Showing 18 changed files with 741 additions and 270 deletions.
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
PROJECT_PATH := $(patsubst %/,%,$(dir $(MKFILE_PATH)))
PROJECT_BIN := $(PROJECT_PATH)/bin
GO ?= "$(shell which go)"
BFF_PATH := $(PROJECT_PATH)/clients/ui/bff
UI_PATH := $(PROJECT_PATH)/clients/ui/frontend

# add tools bin directory
PATH := $(PROJECT_BIN):$(PATH)
Expand All @@ -21,13 +23,26 @@ IMG_ORG ?= opendatahub
IMG_VERSION ?= main
# container image repository
IMG_REPO ?= model-registry
# container image build path
BUILD_PATH ?= .
# container image
ifdef IMG_REGISTRY
IMG := ${IMG_REGISTRY}/${IMG_ORG}/${IMG_REPO}
else
IMG := ${IMG_ORG}/${IMG_REPO}
endif

# Change Dockerfile path depending on IMG_REPO
ifeq ($(IMG_REPO),model-registry-ui)
DOCKERFILE := $(UI_PATH)/Dockerfile
BUILD_PATH := $(UI_PATH)
endif

ifeq ($(IMG_REPO),model-registry-bff)
DOCKERFILE := $(BFF_PATH)/Dockerfile
BUILD_PATH := $(BFF_PATH)
endif

model-registry: build

# clean the ml-metadata protos and trigger a fresh new build which downloads
Expand Down Expand Up @@ -216,7 +231,7 @@ endif
# build docker image
.PHONY: image/build
image/build:
${DOCKER} build . -f ${DOCKERFILE} -t ${IMG}:$(IMG_VERSION)
${DOCKER} build ${BUILD_PATH} -f ${DOCKERFILE} -t ${IMG}:$(IMG_VERSION)

# build docker image using buildx
# PLATFORMS defines the target platforms for the model registry image be built to provide support to multiple
Expand Down
18 changes: 14 additions & 4 deletions clients/ui/bff/internal/mocks/model_registry_client_mock.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package mocks

import (
"log/slog"
"net/url"

"github.com/kubeflow/model-registry/pkg/openapi"
"github.com/kubeflow/model-registry/ui/bff/internal/integrations"
"github.com/stretchr/testify/mock"
"log/slog"
"net/url"
)

type ModelRegistryClientMock struct {
Expand All @@ -26,7 +27,11 @@ func (m *ModelRegistryClientMock) CreateRegisteredModel(_ integrations.HTTPClien
return &mockData, nil
}

func (m *ModelRegistryClientMock) GetRegisteredModel(_ integrations.HTTPClientInterface, _ string) (*openapi.RegisteredModel, error) {
func (m *ModelRegistryClientMock) GetRegisteredModel(_ integrations.HTTPClientInterface, id string) (*openapi.RegisteredModel, error) {
if id == "3" {
mockData := GetRegisteredModelMocks()[2]
return &mockData, nil
}
mockData := GetRegisteredModelMocks()[0]
return &mockData, nil
}
Expand All @@ -36,7 +41,12 @@ func (m *ModelRegistryClientMock) UpdateRegisteredModel(_ integrations.HTTPClien
return &mockData, nil
}

func (m *ModelRegistryClientMock) GetModelVersion(_ integrations.HTTPClientInterface, _ string) (*openapi.ModelVersion, error) {
func (m *ModelRegistryClientMock) GetModelVersion(_ integrations.HTTPClientInterface, id string) (*openapi.ModelVersion, error) {
if id == "3" {
mockData := GetModelVersionMocks()[2]
return &mockData, nil
}

mockData := GetModelVersionMocks()[0]
return &mockData, nil
}
Expand Down
12 changes: 12 additions & 0 deletions clients/ui/bff/internal/mocks/static_data_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,18 @@ func newCustomProperties() *map[string]openapi.MetadataValue {
MetadataType: "MetadataStringValue",
},
},
"AWS_KEY": {
MetadataStringValue: &openapi.MetadataStringValue{
StringValue: "asdf89asdf098asdfa",
MetadataType: "MetadataStringValue",
},
},
"AWS_PASSWORD": {
MetadataStringValue: &openapi.MetadataStringValue{
StringValue: "*AadfeDs34adf",
MetadataType: "MetadataStringValue",
},
},
}

return &result
Expand Down
76 changes: 38 additions & 38 deletions clients/ui/frontend/package-lock.json

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

4 changes: 2 additions & 2 deletions clients/ui/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.5",
"@cypress/code-coverage": "^3.13.4",
"@mui/material": "^6.1.1",
"@mui/material": "^6.1.3",
"@mui/icons-material": "^6.1.2",
"@mui/types": "^7.2.17",
"@testing-library/cypress": "^10.0.1",
Expand Down Expand Up @@ -84,7 +84,7 @@
"ts-loader": "^9.5.1",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"tslib": "^2.7.0",
"typescript": "^5.5.4",
"typescript": "^5.6.3",
"url-loader": "^4.1.1",
"webpack": "^5.94.0",
"webpack-bundle-analyzer": "^4.10.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import { CheckIcon, TimesIcon } from '@patternfly/react-icons';
import { KeyValuePair } from '~/types';
import { EitherNotBoth } from '~/typeHelpers';
import FormFieldset from '~/app/pages/modelRegistry/screens/components/FormFieldset';

type ModelPropertiesTableRowProps = {
allExistingKeys: string[];
Expand Down Expand Up @@ -94,19 +95,27 @@ const ModelPropertiesTableRow: React.FC<ModelPropertiesTableRowProps> = ({
<Td dataLabel="Key" width={45} modifier="breakWord">
{isEditing ? (
<>
<TextInput
data-testid={isAddRow ? `add-property-key-input` : `edit-property-${key}-key-input`}
aria-label={
isAddRow
? 'Key input for new property'
: `Key input for editing property with key ${key}`
<FormFieldset
className="tr-fieldset-wrapper"
component={
<TextInput
data-testid={
isAddRow ? `add-property-key-input` : `edit-property-${key}-key-input`
}
aria-label={
isAddRow
? 'Key input for new property'
: `Key input for editing property with key ${key}`
}
isRequired
type="text"
value={unsavedKey}
onChange={(_event, str) => setUnsavedKey(str)}
validated={keyValidationError ? 'error' : 'default'}
/>
}
isRequired
type="text"
value={unsavedKey}
onChange={(_event, str) => setUnsavedKey(str)}
validated={keyValidationError ? 'error' : 'default'}
/>

{keyValidationError && (
<FormHelperText>
<HelperText>
Expand All @@ -121,17 +130,24 @@ const ModelPropertiesTableRow: React.FC<ModelPropertiesTableRowProps> = ({
</Td>
<Td dataLabel="Value" width={45} modifier="breakWord">
{isEditing ? (
<TextInput
data-testid={isAddRow ? `add-property-value-input` : `edit-property-${key}-value-input`}
aria-label={
isAddRow
? 'Value input for new property'
: `Value input for editing property with key ${key}`
<FormFieldset
className="tr-fieldset-wrapper"
component={
<TextInput
data-testid={
isAddRow ? `add-property-value-input` : `edit-property-${key}-value-input`
}
aria-label={
isAddRow
? 'Value input for new property'
: `Value input for editing property with key ${key}`
}
isRequired
type="text"
value={unsavedValue}
onChange={(_event, str) => setUnsavedValue(str)}
/>
}
isRequired
type="text"
value={unsavedValue}
onChange={(_event, str) => setUnsavedValue(str)}
/>
) : (
<ExpandableSection
Expand Down
Loading

0 comments on commit 37c6570

Please sign in to comment.