Commit
·
6fd272c
1
Parent(s):
e3ed00a
docs/ui: compact ui with more explanations
Browse files- agent/assets/custom.css +16 -0
- agent/dashboard/__init__.py +10 -1
- agent/dashboard/data.py +66 -34
- agent/dashboard/training.py +5 -4
agent/assets/custom.css
CHANGED
|
@@ -3,3 +3,19 @@ header {
|
|
| 3 |
background-position: center; /* Center the background image */
|
| 4 |
background-repeat: no-repeat; /* Prevent image from repeating */
|
| 5 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
background-position: center; /* Center the background image */
|
| 4 |
background-repeat: no-repeat; /* Prevent image from repeating */
|
| 5 |
}
|
| 6 |
+
|
| 7 |
+
.v-application {
|
| 8 |
+
line-height: 1;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
.v-input__slot {
|
| 12 |
+
margin-bottom: 1px;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
.v-messages {
|
| 16 |
+
min-height: 2px;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
.v-text-field__details {
|
| 20 |
+
min-height: 2px;
|
| 21 |
+
}
|
agent/dashboard/__init__.py
CHANGED
|
@@ -5,6 +5,15 @@ route_order = ["/","data","training","testing","inference"]
|
|
| 5 |
@solara.component
|
| 6 |
def Page():
|
| 7 |
with solara.VBox() as main:
|
| 8 |
-
solara.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
return main
|
|
|
|
| 5 |
@solara.component
|
| 6 |
def Page():
|
| 7 |
with solara.VBox() as main:
|
| 8 |
+
solara.Markdown(md_text="""
|
| 9 |
+
## Welcome
|
| 10 |
+
This web page is created to demonstrate the model-based auto-scaling
|
| 11 |
+
approach developed in "AI-based Auto-Scaling and Tuning" project.
|
| 12 |
+
|
| 13 |
+
* In [Data](/data) tab, you can investigate the raw data.
|
| 14 |
+
* In [Training](/training), you can build a model on the raw data.
|
| 15 |
+
* [Testing](/testing) tab is used to evaluate the performance of the trained model.
|
| 16 |
+
* Finally, [Inference](/inference) tab provides a simulation environment to test the model.
|
| 17 |
+
""")
|
| 18 |
|
| 19 |
return main
|
agent/dashboard/data.py
CHANGED
|
@@ -40,11 +40,12 @@ def FilteredDataFrame(df):
|
|
| 40 |
|
| 41 |
@solara.component
|
| 42 |
def FilterPanel(df):
|
| 43 |
-
solara.
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
| 48 |
|
| 49 |
|
| 50 |
|
|
@@ -63,36 +64,67 @@ def DataViewer(df):
|
|
| 63 |
dff = df[filter]
|
| 64 |
|
| 65 |
with solara.Sidebar():
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
columns = list(df.columns)
|
| 70 |
-
solara.
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
solara.
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
solara.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
@solara.component
|
| 98 |
def Page():
|
|
|
|
| 40 |
|
| 41 |
@solara.component
|
| 42 |
def FilterPanel(df):
|
| 43 |
+
with solara.Column(gap="0px"):
|
| 44 |
+
solara.CrossFilterReport(df)
|
| 45 |
+
solara.CrossFilterSelect(df, configurable=False, column='replica')
|
| 46 |
+
solara.CrossFilterSelect(df, configurable=False, column='cpu')
|
| 47 |
+
solara.CrossFilterSelect(df, configurable=False, column='expected_tps')
|
| 48 |
+
solara.CrossFilterSelect(df, configurable=False, column='previous_tps')
|
| 49 |
|
| 50 |
|
| 51 |
|
|
|
|
| 64 |
dff = df[filter]
|
| 65 |
|
| 66 |
with solara.Sidebar():
|
| 67 |
+
with solara.Card("Cross Filters", margin=1, elevation=10,
|
| 68 |
+
subtitle="""You can filter the data by selecting different values of several attributes,
|
| 69 |
+
and investigate the characteristics of the data.
|
| 70 |
+
Once a filter is applied to an attribute, other filter boxes
|
| 71 |
+
are immediately updated as well as the number of records in the
|
| 72 |
+
filtered data."""):
|
| 73 |
+
FilterPanel(df)
|
| 74 |
+
with solara.Card("Plot Settings", margin=1, elevation=10,
|
| 75 |
+
subtitle="""You can adjust these parameters to control the 2D scatter plot on the right.
|
| 76 |
+
"""):
|
| 77 |
+
with solara.Column(gap="0px"):
|
| 78 |
columns = list(df.columns)
|
| 79 |
+
with solara.Row():
|
| 80 |
+
with solara.Tooltip("Select to draw the x-axis in logarithmic scale"):
|
| 81 |
+
solara.Checkbox(label="Log x", value=state.value['logx'], on_value=state.value['logx'].set)
|
| 82 |
+
with solara.Tooltip("Select to draw the y-axis in logarithmic scale"):
|
| 83 |
+
solara.Checkbox(label="Log y", value=state.value['logy'], on_value=state.value['logy'].set)
|
| 84 |
+
with solara.Tooltip("Maximum size of the markers in the scatter plot"):
|
| 85 |
+
solara.SliderFloat(label="Maximum Marker Size", value=state.value['size_max'], min=1, max=100, on_value=state.value['size_max'].set)
|
| 86 |
+
with solara.Tooltip("Adjust the marker size based on the selected attribute"):
|
| 87 |
+
solara.Select("Size", values=columns, value=state.value['size'].value, on_value=state.value['size'].set)
|
| 88 |
+
with solara.Tooltip("Adjust the marker color based on the selected attribute"):
|
| 89 |
+
solara.Select("Color", values=columns, value=state.value['color'].value, on_value=state.value['color'].set)
|
| 90 |
+
with solara.Tooltip("Select the attribute to be used in x-axis"):
|
| 91 |
+
solara.Select("X-Axis", values=columns, value=state.value['x'].value, on_value=state.value['x'].set)
|
| 92 |
+
with solara.Tooltip("Select the attribute to be used in y-axis"):
|
| 93 |
+
solara.Select("Y-Axis", values=columns, value=state.value['y'].value, on_value=state.value['y'].set)
|
| 94 |
+
|
| 95 |
+
with solara.Card("Raw Data", margin=1, elevation=2,
|
| 96 |
+
subtitle="""The raw data to be used in this study.
|
| 97 |
+
Cross-filters on the left are immediately applied to the data.
|
| 98 |
+
Data is visualized as a scatter plot below which can be controlled via
|
| 99 |
+
widgets in 'Plot Settings'. The filters and the visualization plot
|
| 100 |
+
are only used to understand the characteristics of the data. So, the filtered data
|
| 101 |
+
is not used in the next steps. In the training section, there will be other
|
| 102 |
+
filters specific to training.
|
| 103 |
+
"""):
|
| 104 |
+
solara.CrossFilterDataFrame(df, items_per_page=10)
|
| 105 |
+
|
| 106 |
+
with solara.Card("Scatter Plot", margin=1, elevation=2,
|
| 107 |
+
subtitle="""Based on the plot controls on the left, the
|
| 108 |
+
data is visualized as a 2D scatter plot. You can select different
|
| 109 |
+
attributes for X and Y-axis. By manipulating the size and color
|
| 110 |
+
properties of the markers, you can investigate the data in detail.
|
| 111 |
+
"""):
|
| 112 |
+
|
| 113 |
+
if state.value['x'].value and state.value['y'].value:
|
| 114 |
+
|
| 115 |
+
solara_px.scatter(
|
| 116 |
+
dff,
|
| 117 |
+
state.value['x'].value,
|
| 118 |
+
state.value['y'].value,
|
| 119 |
+
size=state.value['size'].value,
|
| 120 |
+
color=state.value['color'].value,
|
| 121 |
+
size_max=state.value['size_max'].value,
|
| 122 |
+
log_x=state.value['logx'].value,
|
| 123 |
+
log_y=state.value['logy'].value,
|
| 124 |
+
width=800,
|
| 125 |
+
)
|
| 126 |
+
else:
|
| 127 |
+
solara.Warning("Select x and y columns")
|
| 128 |
|
| 129 |
@solara.component
|
| 130 |
def Page():
|
agent/dashboard/training.py
CHANGED
|
@@ -65,10 +65,11 @@ def force_render():
|
|
| 65 |
|
| 66 |
@solara.component
|
| 67 |
def FilterPanel(df):
|
| 68 |
-
solara.
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
|
|
|
| 72 |
|
| 73 |
@solara.component
|
| 74 |
def ExecutePanel(df):
|
|
|
|
| 65 |
|
| 66 |
@solara.component
|
| 67 |
def FilterPanel(df):
|
| 68 |
+
with solara.Column(gap="0px"):
|
| 69 |
+
solara.CrossFilterReport(df, classes=["py-2"])
|
| 70 |
+
for col in ['replica','cpu','expected_tps','previous_tps']:
|
| 71 |
+
if col in df.columns:
|
| 72 |
+
solara.CrossFilterSelect(df, configurable=False, column=col)
|
| 73 |
|
| 74 |
@solara.component
|
| 75 |
def ExecutePanel(df):
|