Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE]Main based model registry #389

Draft
wants to merge 75 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
539cd48
Revert "feat: remove model registry related code and dependencies (#63)"
ruanyl Jan 31, 2023
b5ef886
Feat add show my models in owner filter (#29)
wanglam Jan 30, 2023
3a60008
bring in-app navigation bar back (#72)
ruanyl Jan 31, 2023
7048cfc
feat: add more actions in model list (#77)
raintygao Feb 1, 2023
67a8066
populate register form with existing model version (#82)
raintygao Feb 2, 2023
110dc64
Feature/add model upload logic (#83)
wanglam Feb 8, 2023
f8c0f57
feat: update register model form ui according to the new design (#85)
ruanyl Feb 8, 2023
115752f
update help button location and flyout content according to updated d…
raintygao Feb 9, 2023
04fad6f
feat: add multiple validation rules on tag field (#93)
ruanyl Feb 13, 2023
c16f225
feat: align ui with the latest design changes (#95)
ruanyl Feb 13, 2023
1eb4688
add metrics validation (#97)
raintygao Feb 14, 2023
52f873d
feat: add register form submission footer (#99)
ruanyl Feb 14, 2023
622a31c
feat: show notifications if form submit success or fail (#110)
ruanyl Feb 20, 2023
0be9346
feat: add model_register_button to model_list (#80)
xyinshen Feb 21, 2023
531b603
feat: add upload callout (#113)
wanglam Feb 22, 2023
a302d48
fix: update-register-form-hearder-descriptions (#114)
xyinshen Feb 22, 2023
a493f78
feat: upload file after register form submitted (#117)
ruanyl Feb 22, 2023
e0bca75
feat: update artifact file validation rules (#118)
ruanyl Feb 24, 2023
9509ceb
feat: display notification when upload model by URL (#126)
ruanyl Feb 27, 2023
ea5d5ec
Feature/add model name unique verification (#129)
wanglam Mar 7, 2023
2f46e80
Feature/rename annotation and remove model details (#133)
wanglam Mar 7, 2023
3083a8b
Feature/fetch pre trained model list (#131)
wanglam Mar 8, 2023
d22c759
fix: revert legacy pagination methods
ruanyl Mar 9, 2023
ed81610
feat: init model group page (#134)
ruanyl Mar 10, 2023
22ebc9c
Featuer/fill pre trained model data to register form (#135)
wanglam Mar 10, 2023
7654fcd
Feature file version title and configuration description (#130)
xyinshen Mar 10, 2023
3ff81c1
fix: tweak test mocks (#137)
ruanyl Mar 13, 2023
2ba8108
Feature update description max width 725 (#140)
xyinshen Mar 13, 2023
c24d55d
feat: disallow user to type if text exceed max length (#138)
ruanyl Mar 14, 2023
8a7ed88
Feature/update model register tags logic (#142)
wanglam Mar 16, 2023
8787bd4
feat: add form error call-out (#141)
ruanyl Mar 16, 2023
88e983c
feat: add model file format select (#143)
ruanyl Mar 17, 2023
69a6823
feat: tweaks form section titles per new design (#144)
ruanyl Mar 20, 2023
95918d1
Feature change register form max width to 1000px and make it centered…
xyinshen Mar 22, 2023
33705dc
test: initiate the use of MSW for API mocking (#147)
ruanyl Mar 24, 2023
7b1fea3
Feature/add model version detail mock page (#153)
wanglam Apr 6, 2023
60b1129
feat: support for adding tag types (#161)
ruanyl Apr 19, 2023
9121c4d
Feature/replace model list stage filter with deployment toggle (#163)
wanglam Apr 20, 2023
cb0c0e8
Feature/update tag filter (#162)
wanglam Apr 23, 2023
03e554b
Feature/update model detail page layout (#166)
wanglam Apr 26, 2023
a9c1fd6
Feature/update global breadcrumbs (#164)
wanglam Apr 27, 2023
067a7be
Feature/add model loading empty failed screen for model list (#165)
wanglam May 6, 2023
4fab379
Feature/add versions table in model group detail (#170)
wanglam May 9, 2023
635dffe
Feature/add id column for model versions table (#177)
wanglam May 11, 2023
76f0422
Version details page mockup (#179)
ruanyl May 12, 2023
b6e4dae
Feature/add details tab content in model group page (#176)
wanglam May 12, 2023
ec603ba
feat(ui): version information edit component (#180)
ruanyl May 17, 2023
4df7a51
Feature/add tags tab content model group page (#181)
wanglam May 18, 2023
9aa8391
feat: version tag edit (#182)
ruanyl May 22, 2023
e119ebb
feat(ui): artifact and configuration edit (#187)
ruanyl May 23, 2023
b7289bd
Feature/add model version loading empty error screens (#185)
wanglam May 24, 2023
8ab8a3c
Feature/add deploy confirmation modal (#186)
wanglam May 24, 2023
edec198
Feature/create model group before register (#192)
wanglam May 26, 2023
100af2e
Feature/jump to model detail page with correct (#193)
wanglam May 26, 2023
c0831d5
Feature/update model list with model group (#197)
wanglam May 30, 2023
59d0d04
feat: deploy and undeploy api integration (#198)
ruanyl May 31, 2023
52d1e4c
fix: map model_group_id to model_id (#207)
ruanyl Jun 12, 2023
7bf1a7a
Feature/add model version delete modal (#199)
wanglam Jun 12, 2023
6bd7184
Feature/import model by name (#218)
wanglam Jun 19, 2023
9361ee6
Feat add basic model delete (#219)
wanglam Jun 19, 2023
9d7851e
feat: refresh model version data after deploy or undeploy complete (#…
wanglam Jun 20, 2023
3ba16ab
fix: fix error when search for model name when index hasn't created (…
ruanyl Jun 20, 2023
42d76cd
build: add experimental release action (#221)
ruanyl Jun 20, 2023
a2531e8
Fix owner and transport missing
wanglam Jan 3, 2025
e767c0c
Hide model registry entrances
wanglam Jan 3, 2025
d74398a
Replace response factory with response
wanglam Jan 3, 2025
93f17d6
Renaming model version service test cases
wanglam Jan 3, 2025
0e85397
Rename model version utils
wanglam Jan 3, 2025
1409e0c
Renaming model version router
wanglam Jan 3, 2025
eca4234
Hide global breadcrumbs model registry unit tests
wanglam Jan 3, 2025
e1e8670
Fix model version table unit tests
wanglam Jan 3, 2025
d9faa0d
Fix invalid import path for model util
wanglam Jan 6, 2025
717cbad
Fix failed UT in monitoring page
wanglam Jan 6, 2025
f392d31
Fix failed cases in useMonitoring
wanglam Jan 6, 2025
64bc340
Change back waitFor
wanglam Jan 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/experimental-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: experimental-release

on:
workflow_dispatch:
inputs:
opensearch_dashboards_version:
description: 'Which version of OpenSearch-Dashboards that this build is targeting'
required: false
default: '2.x'

jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
RELEASE_TAG: ${{ github.event.inputs.opensearch_dashboards_version }}-experimental.${{ github.run_id }}

steps:
- run: echo Target OpenSearch-Dashboards version ${{ github.event.inputs.opensearch_dashboards_version }}
- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v2
with:
repository: opensearch-project/OpenSearch-Dashboards
ref: ${{ github.event.inputs.opensearch_dashboards_version }}
path: OpenSearch-Dashboards
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: './OpenSearch-Dashboards/.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Install Yarn
# Need to use bash to avoid having a windows/linux specific step
shell: bash
run: |
YARN_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').engines.yarn")
echo "Installing yarn@$YARN_VERSION"
npm i -g yarn@$YARN_VERSION
- run: node -v
- run: yarn -v
- name: Checkout ML Commons OpenSearch Dashboards plugin
uses: actions/checkout@v2
with:
path: OpenSearch-Dashboards/plugins/ml-commons-dashboards
- name: Bootstrap plugin/opensearch-dashboards
run: |
cd OpenSearch-Dashboards/plugins/ml-commons-dashboards
yarn osd bootstrap
- name: Run build
run: |
cd OpenSearch-Dashboards/plugins/ml-commons-dashboards
yarn run build
- name: Create Release Tag
run: |
cd OpenSearch-Dashboards/plugins/ml-commons-dashboards
git tag ${{ env.RELEASE_TAG }}
git push origin ${{ env.RELEASE_TAG }}
- name: Release
id: release_step
uses: softprops/action-gh-release@v1
with:
files: OpenSearch-Dashboards/plugins/ml-commons-dashboards/build/*.zip
tag_name: ${{ env.RELEASE_TAG }}
- name: Update Artifact URL
run: |
echo ${{ steps.release_step.outputs.assets }}
4 changes: 2 additions & 2 deletions .github/workflows/lint-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Lint workflow
on:
push:
branches:
- '*'
- '**'
pull_request:
branches:
- '*'
- '**'
env:
OPENSEARCH_DASHBOARDS_VERSION: 'main'
jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Unit tests workflow
on:
push:
branches:
- '*'
- '**'
pull_request:
branches:
- '*'
- '**'
env:
OPENSEARCH_DASHBOARDS_VERSION: 'main'
jobs:
Expand Down
11 changes: 11 additions & 0 deletions common/constant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export const ONE_MB = 1000 * 1000;
export const ONE_GB = 1000 * ONE_MB;

export const MAX_MODEL_CHUNK_SIZE = 10 * ONE_MB;

export const DATE_FORMAT = 'MMM D, yyyy @ HH:mm:ss.SSS';
4 changes: 4 additions & 0 deletions common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ export const PLUGIN_ID = 'ml-commons-dashboards';
export const PLUGIN_NAME = 'Machine Learning';
export const PLUGIN_DESC = `ML Commons for OpenSearch eases the development of machine learning features by providing a set of common machine learning (ML) algorithms through transport and REST API calls. Those calls choose the right nodes and resources for each ML request and monitors ML tasks to ensure uptime. This allows you to leverage existing open-source ML algorithms and reduce the effort required to develop new ML features.`;

export * from './constant';
export * from './status';
export * from './model_version';
export * from './router_paths';
export * from './model';
export * from './model_aggregate';
68 changes: 21 additions & 47 deletions common/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,29 @@
* SPDX-License-Identifier: Apache-2.0
*/

// TODO: rename the enum keys accordingly
export enum MODEL_STATE {
loaded = 'DEPLOYED',
trained = 'TRAINED',
unloaded = 'UNDEPLOYED',
uploaded = 'REGISTERED',
uploading = 'REGISTERING',
loading = 'DEPLOYING',
partiallyLoaded = 'PARTIALLY_DEPLOYED',
loadFailed = 'DEPLOY_FAILED',
}

export interface OpenSearchModelBase {
name: string;
model_id: string;
model_state: MODEL_STATE;
model_version: string;
}

export interface OpenSearchSelfTrainedModel extends OpenSearchModelBase {
algorithm: string;
}

export interface OpenSearchCustomerModel extends OpenSearchModelBase {
chunk_number: number;
created_time: number;
description: string;
last_loaded_time?: number;
last_unloaded_time?: number;
last_uploaded_time: number;
model_config: {
all_config?: string;
embedding_dimension: number;
framework_type: string;
model_type: string;
export interface OpenSearchModel {
id: string;
owner?: {
backend_roles: string[];
roles: string[];
name: string;
};
model_content: string;
model_content_hash_value: string;
model_content_size_in_bytes: string;
model_format: string;
total_chunks: number;
version: number;
planning_worker_nodes: string[];
latest_version: number;
created_time: number;
last_updated_time: number;
name: string;
description?: string;
access: 'public' | 'restricted' | 'private';
}

export type ModelSearchSort =
export type ModelSort =
| 'name-asc'
| 'name-desc'
| 'id-asc'
| 'model_state-asc'
| 'model_state-desc'
| 'id-desc';
| 'latest_version-asc'
| 'latest_version-desc'
| 'description-asc'
| 'description-desc'
| 'owner.name-asc'
| 'owner.name-desc'
| 'last_updated_time-asc'
| 'last_updated_time-desc';
27 changes: 27 additions & 0 deletions common/model_aggregate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export interface ModelAggregateItem {
id: string;
name: string;
description?: string;
latest_version: number;
deployed_versions: string[];
owner_name: string;
created_time?: number;
last_updated_time: number;
}

export type ModelAggregateSort =
| 'name-asc'
| 'name-desc'
| 'latest_version-asc'
| 'latest_version-desc'
| 'description-asc'
| 'description-desc'
| 'owner_name-asc'
| 'owner_name-desc'
| 'last_updated_time-asc'
| 'last_updated_time-desc';
35 changes: 35 additions & 0 deletions common/model_version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

// TODO: rename the enum keys accordingly
export enum MODEL_VERSION_STATE {
deployed = 'DEPLOYED',
trained = 'TRAINED',
undeployed = 'UNDEPLOYED',
registered = 'REGISTERED',
registering = 'REGISTERING',
deploying = 'DEPLOYING',
partiallyDeployed = 'PARTIALLY_DEPLOYED',
deployFailed = 'DEPLOY_FAILED',
registerFailed = 'REGISTER_FAILED',
}

export const isModelDeployable = (state: MODEL_VERSION_STATE) => {
if (
state === MODEL_VERSION_STATE.undeployed ||
state === MODEL_VERSION_STATE.registered ||
state === MODEL_VERSION_STATE.deployFailed
) {
return true;
}
return false;
};

export const isModelUndeployable = (state: MODEL_VERSION_STATE) => {
if (state === MODEL_VERSION_STATE.deployed || state === MODEL_VERSION_STATE.partiallyDeployed) {
return true;
}
return false;
};
4 changes: 2 additions & 2 deletions common/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { MODEL_STATE } from './model';
import { MODEL_VERSION_STATE } from './model';

export interface OpenSearchMLCommonsProfile {
nodes: {
Expand All @@ -12,7 +12,7 @@ export interface OpenSearchMLCommonsProfile {
[key: string]: {
worker_nodes: string[];
predictor: string;
model_state: MODEL_STATE;
model_state: MODEL_VERSION_STATE;
predict_request_stats: {
count: number;
max: number;
Expand Down
5 changes: 5 additions & 0 deletions common/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@ interface RouteConfig {
Component: React.ComponentType<any>;
label: string;
exact?: boolean;
/**
* true: display route in nav bar
*/
nav: boolean;
}

export const ROUTES: RouteConfig[] = [
{
path: routerPaths.overview,
Component: Monitoring,
label: 'Overview',
nav: true,
},
];
5 changes: 5 additions & 0 deletions common/router_paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@
export const routerPaths = {
root: '/',
overview: '/overview',
monitoring: '/monitoring',
registerModel: '/model-registry/register-model/:id?',
modelList: '/model-registry/model-list',
model: '/model-registry/model/:id',
modelVersion: '/model-registry/model-version/:id',
};
20 changes: 20 additions & 0 deletions common/security.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export interface OpenSearchSecurityAccount {
user_name: string;
is_reserved: boolean;
is_hidden: boolean;
is_interval_user: boolean;
user_required_tenant: null;
backed_roles: string[];
custom_attribute_names: string[];
tenants: {
global_tenant: boolean;
admin_tenant: true;
admin: true;
};
roles: string[];
}
21 changes: 17 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,26 @@
"plugin-helpers": "node ../../scripts/plugin_helpers",
"osd": "node ../../scripts/osd",
"lint:es": "node ../../scripts/eslint",
"test:jest": "../../node_modules/.bin/jest --config ./test/jest.config.js",
"test:jest": "TZ=UTC ../../node_modules/.bin/jest --config ./test/jest.config.js",
"test:watch": "TZ=UTC ../../node_modules/.bin/jest --config ./test/jest.config.js --watch",
"prepare": "husky install"
},
"dependencies": {},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"dependencies": {
"hash-wasm": "^4.9.0",
"papaparse": "^5.3.2",
"react-hook-form": "^7.39.4",
"rxjs": "^6.5.5"
},
"devDependencies": {
"@testing-library/user-event": "^14.4.3",
"husky": "^8.0.0",
"lint-staged": "^10.0.0"
"@types/papaparse": "^5.3.5",
"lint-staged": "^10.0.0",
"msw": "^1.1.0"
}
}
}
18 changes: 18 additions & 0 deletions public/ace-themes/sql_console.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import * as ace from 'brace';

ace.define('ace/theme/sql_console', ['require', 'exports', 'module', 'ace/lib/dom'], function (
acequire,
exports
) {
exports.isDark = false;
exports.cssClass = 'ace-sql-console';
exports.cssText = require('../index.scss');

const dom = acequire('../lib/dom');
dom.importCssString(exports.cssText, exports.cssClass);
});
21 changes: 0 additions & 21 deletions public/apis/__mocks__/model.ts

This file was deleted.

Loading
Loading