You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For more details about the project please follow this [announcement blog post](https://lfaidata.foundation/blog/2021/09/28/machine-learning-exchange-mlx/).
- Automated sample pipeline code generation to execute registered models, datasets and notebooks
@@ -28,6 +23,12 @@ Additionally it provides:
28
23
- Serving engine by [KFServing](https://github.com/kubeflow/kfserving)
29
24
- Model Metadata schemas
30
25
26
+
For more details about the project check out this [announcement blog post](https://lfaidata.foundation/blog/2021/09/28/machine-learning-exchange-mlx/).
For information on how to get started with Docker Compose before making any changes
100
+
to the UI code, check out the [Quick Start Guide](/quickstart/README.md) and
101
+
take a look at the [docker-compose.yaml](/quickstart/docker-compose.yaml) file
102
+
to understand how the individual services like `mysql`, `minio`, `mlx-api`, `mlx-ui`,
103
+
etc. are working together.
75
104
76
-
Change the Docker image tag in the deployment spec server/mlx-ui.yml from image: ibmandrewbutler/open-ui:add-homepage to image: <your_docker_user_id>/<reponame>:<tagname> and then run:
105
+
The Docker Compose stack can be brought up and taken down by running the following
106
+
commands. The `--project-name` tag keeps the docker compose network and the volumes
107
+
(stored assets) separate from the quickstart for development. Each docker compose
108
+
project has separate network and volumes which can be viewed using
You can test most code changes without a Kubernetes cluster. A K8s cluster is only
86
117
required to `run` the generated sample pipeline code. Running the Quickstart with
87
118
Docker Compose is sufficient to test any `katalog` related API endpoints.
88
119
89
120
A development setup that works very well requires to 2 shell terminals:
90
121
91
-
### Terminal 1 - Quickstart without `mlx-ui` service
122
+
### Terminal 1 - Quickstart without the `mlx-ui` service
92
123
93
124
Bring up the Quickstart without the `mlx-ui` service, since we will run the MLX UI
94
-
from our local source code, instead of using the pre-built Docker image `mlexchange/mlx-ui:nightly-origin-main`.
125
+
from our local source code, instead of using the pre-built Docker image
126
+
`mlexchange/mlx-ui:nightly-origin-main`.
95
127
96
128
```Bash
97
129
# cd <mlx_root_directory>
@@ -116,7 +148,7 @@ docker compose rm -v -f
116
148
docker volume prune -f
117
149
```
118
150
119
-
### Terminal 2 - Start the UI server
151
+
### Terminal 2 - Start the MLX UI locally
120
152
121
153
Navigate to the UI source folder:
122
154
@@ -185,6 +217,10 @@ which matches a previous request and the difference of the time between the two
185
217
186
218
To invalidate or hard reset the cache, navigate to the settings page (clicking the three dots at the bottom of the sidebar) and click on the `Reset Cache` button.
187
219
220
+
# Development Guidelines:
221
+
222
+
For information on UI code structure, design principles, etc. check out the [MLX UI Developer Guide](developer-guide.md).
The key feature of React is composition of components. React works by having pages use components to add functionality which themselves use components to add functionality.
5
6
6
7

@@ -11,107 +12,45 @@ Image 1: The Landing Page divided into some of its components.
11
12
12
13
Image 2: MLX UI structure
13
14
14
-
15
-
React Props vs. State:
15
+
### React Props vs. State:
16
16
17
17
A components props and state are variables which dictate the changeable content of a component. For example, take a parent component that is a webpage and take a child component which represents a Button. The parent could ask for two Buttons with the text="Press" on one and text="Click" on the other. "Press" and "Click" would be the value of the variable props.text and should not be changed inside of the Button component. The state of these Buttons could be something like "clickNum" which defines how many times the button has been clicked.
18
18
Props - Parameters passed from the parent component. Props should not be changed inside the child component. If a prop is changed in a parent component then the child component will be recreated.
19
19
State - Variables that dictate the current condition of the component. State can be changed inside the component. If a state variable is changed in a component then the component will be recreated.
20
20
21
-
22
-
Lifecycle Methods:
21
+
### Lifecycle Methods:
23
22
24
23
Each component has several “lifecycle methods” that you can override to run code at particular times in the process. Putting functions in different lifecycle methods will cause the function to be run at a specific point in a component's lifecycle. An example of this is running a function after a component is being unmounted (removed or refreshed).
25
24
26
-
## Startup
27
-
28
-
General Startup Instructions: https://github.com/machine-learning-exchange/mlx/tree/main/dashboard/origin-mlx
29
-
30
-
### Starting the MLX UI locally
31
-
32
-
To run this app, you'll need a current version of Node.js installed.
The folders which contain the pieces of the MLX UI:
86
29
87
30

88
31
89
-
90
-
91
-
-**components/** - Small items which get used inside of pages. For example, the sidebar is used in all the pages, but is not a page itself. The major components are listed below.
32
+
-**components/** - Small items which get used inside of pages. For example, the sidebar is used in all the pages, but is not a page itself. The major components are listed below.
92
33
-**Button/**
93
34
-**Detail/** - The Detail folder contains the specific implementations of each asset type for the MetaDetailPage. The ComponentDetail, for example, has a MetadataView, RunView, and two SourceCodeDisplays. The ComponentDetail file represents the content of the MetaDetailPage for the Component assets.
94
35
-**RunView/** - Contains the displays which dictate what parameters the user must fill out when attempting to run any of the assets
95
36
-**Sidebar/**
96
37
-**Tooltip/**
97
38
98
-
99
39
- There are other components other than those which make up their own folder. Some of the important ones are listed below.
100
40
- Hero - The “Hero Bar” is the bar at the top of the page with mostly navigational items.
101
41
- MarkdownViewer - A display which shows the contents of a markdown file
102
42
- PageFooter - The content that gets displayed at the bottom of every page
103
43
- SecretMenu - The menu which is only available for admins that provides admin’s with extra functionality
104
44
105
45
-**icons/**
106
-
Icons are typically an .svg wrapped in a react component.
46
+
Icons are typically an `.svg` wrapped in a React component.
107
47
108
48
-**images/**
109
-
.png files used in UI
49
+
`.png` files used in UI
110
50
111
-
-**lib/**
112
-
lib/ is divided into two folders api/ and stores/
113
-
api/ - Contains all the functions which calls to the MLX API.
114
-
stores/ - Contains all the functions which add to and view the MLX UI data store
51
+
-**lib/**`lib/` is divided into two folders `api/` and `stores/`
52
+
-`api/` - Contains all the functions which calls to the MLX API
53
+
-`stores/` - Contains all the functions which add to and view the MLX UI data store
115
54
116
55
-**mock/**
117
56
Some mock assets for each asset type (no longer in use).
@@ -124,12 +63,12 @@ Most (>90%) of styling is contained in css files in styles/
124
63
125
64
## Developing for the MLX UI
126
65
66
+
### MLX UI Starting Points
127
67
128
-
MLX UI Starting Points
129
-
src/App.tsx controls all the routing inside the react application. If a new route needs to be added it will be added here. If it is not clear what file represents the page at a given url, trace the routes in App.tsx to find the route associated with that url and that route will show the component that is being used.
130
-
68
+
-`src/App.tsx`: controls all the routing inside the react application. If a new route needs to be added it will be added here. If it is not clear what file represents the page at a given url, trace the routes in App.tsx to find the route associated with that url and that route will show the component that is being used.
131
69
132
-
src/styles/ contains most (>90%) of the page styling in css. If the style needs to be changed first check the component file for styling and if the css is not inline then check in src/styles/.
70
+
-`src/styles/`: contains most (>90%) of the page styling in css. If the style needs to be changed first check the component file for styling and if the css is not inline then check in src/styles/.
133
71
72
+
-`src/lib/api/`: contains all the calls to the MLX API. If some API call is going wrong, it will likely be an issue in this folder.
134
73
135
-
src/lib/api/ contains all of the calls to the MLX API. If some API call is going wrong, it will likely be an issue in this folder.
74
+
For more information on UI Setup and Deployment go [here](README.md)
0 commit comments