Skip to content

Commit

Permalink
Update listAutotuneTunables to listKruizeTunables
Browse files Browse the repository at this point in the history
Related script and API doc changes

Signed-off-by: Dinakar Guniguntala <[email protected]>
  • Loading branch information
dinogun committed Mar 20, 2023
1 parent f7a8e1a commit bbb7ff4
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions design/ExperimentModeAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,18 @@ for the application.
]
```

## listAutotuneTunables
## listKruizeTunables

Get the tunables supported by autotune for the SLO.

**Request**
`GET /listAutotuneTunables` gives all tunables for all layers in the cluster
`GET /listKruizeTunables` gives all tunables for all layers in the cluster

`GET /listAutotuneTunables?slo_class=<SLO_CLASS>` gives all tunables for the SLO class
`GET /listKruizeTunables?slo_class=<SLO_CLASS>` gives all tunables for the SLO class

`GET /listAutotuneTunables?slo_class=<SLO_CLASS>&layer_name=<LAYER>` gives tunables for the SLO class and the layer
`GET /listKruizeTunables?slo_class=<SLO_CLASS>&layer_name=<LAYER>` gives tunables for the SLO class and the layer

`curl -H 'Accept: application/json' http://<URL>:<PORT>/listAutotuneTunables?slo_class=<SLO_CLASS>`
`curl -H 'Accept: application/json' http://<URL>:<PORT>/listKruizeTunables?slo_class=<SLO_CLASS>`

**Response**

Expand Down
2 changes: 1 addition & 1 deletion docs/autotune_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ autotune-58cf47df84-rhqhx 1/1 Running 0 54s
Info: autotune deploy succeeded: Running
autotune-58cf47df84-rhqhx 1/1 Running 0 54s
Info: Access Autotune at http://192.168.39.12:30113/listAutotuneTunables
Info: Access Autotune at http://192.168.39.12:30113/listKruizeTunables
```

# Demo
Expand Down
6 changes: 3 additions & 3 deletions scripts/minikube-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function minikube_first() {

kubectl_cmd="kubectl -n ${autotune_ns}"
echo "Info: One time setup - Create a service account to deploy autotune"

${kubectl_cmd} apply -f ${AUTOTUNE_SA_MANIFEST}
check_err "Error: Failed to create service account and RBAC"

Expand Down Expand Up @@ -86,7 +86,7 @@ function minikube_deploy() {
# Get the Autotune application port in minikube
MINIKUBE_IP=$(minikube ip)
AUTOTUNE_PORT=$(${kubectl_cmd} get svc autotune --no-headers -o=custom-columns=PORT:.spec.ports[*].nodePort)
echo "Info: Access Autotune at http://${MINIKUBE_IP}:${AUTOTUNE_PORT}/listAutotuneTunables"
echo "Info: Access Autotune at http://${MINIKUBE_IP}:${AUTOTUNE_PORT}/listKruizeTunables"
echo
}

Expand Down Expand Up @@ -161,7 +161,7 @@ function minikube_terminate() {
echo
echo "Removing AutotuneQueryVariable objects"
${kubectl_cmd} delete -f ${AUTOTUNE_QUERY_VARIABLES} 2>/dev/null

echo
echo "Removing Autotune configmap"
${kubectl_cmd} delete -f ${AUTOTUNE_CONFIGMAPS}/${cluster_type}-config.yaml 2>/dev/null
Expand Down
2 changes: 1 addition & 1 deletion scripts/openshift-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function openshift_deploy() {
# Get the Autotune application port in openshift
OPENSHIFT_IP=$(${kubectl_cmd} get pods -l=app=autotune -o wide -n ${autotune_ns} -o=custom-columns=NODE:.spec.nodeName --no-headers)
AUTOTUNE_PORT=$(${kubectl_cmd} get svc autotune --no-headers -o=custom-columns=PORT:.spec.ports[*].nodePort)
echo "Info: Access Autotune at http://$OPENSHIFT_IP:${AUTOTUNE_PORT}/listAutotuneTunables"
echo "Info: Access Autotune at http://$OPENSHIFT_IP:${AUTOTUNE_PORT}/listKruizeTunables"
echo
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/autotune/Autotune.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void main(String[] args) {

disableServerLogging();

Server server = new Server(AUTOTUNE_SERVER_PORT);
Server server = new Server(KRUIZE_SERVER_PORT);
context = new ServletContextHandler();
context.setContextPath(ServerContext.ROOT_CONTEXT);
context.setErrorHandler(new KruizeErrorHandler());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/autotune/analyzer/Analyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static void addServlets(ServletContextHandler context) {
context.addServlet(ListStacks.class, ServerContext.LIST_STACKS);
context.addServlet(ListStackLayers.class, ServerContext.LIST_STACK_LAYERS);
context.addServlet(ListStackTunables.class, ServerContext.LIST_STACK_TUNABLES);
context.addServlet(ListKruizeTunables.class, ServerContext.LIST_AUTOTUNE_TUNABLES);
context.addServlet(ListKruizeTunables.class, ServerContext.LIST_KRUIZE_TUNABLES);
context.addServlet(SearchSpace.class, ServerContext.SEARCH_SPACE);
context.addServlet(ListExperiments.class, ServerContext.LIST_EXPERIMENTS);
context.addServlet(ExperimentsSummary.class, ServerContext.EXPERIMENTS_SUMMARY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public class ListKruizeTunables extends HttpServlet {
* Get the tunables supported by autotune for the SLO.
* <p>
* Request:
* `GET /listAutotuneTunables` gives all tunables for all layers in the cluster
* `GET /listKruizeTunables` gives all tunables for all layers in the cluster
* <p>
* `GET /listAutotuneTunables?slo_class=<SLO_CLASS>` gives all tunables for the SLO class
* `GET /listKruizeTunables?slo_class=<SLO_CLASS>` gives all tunables for the SLO class
* <p>
* `GET /listAutotuneTunables?slo_class=<SLO_CLASS>&layer=<LAYER>` gives tunables for the SLO class and the layer
* `GET /listKruizeTunables?slo_class=<SLO_CLASS>&layer=<LAYER>` gives tunables for the SLO class and the layer
* <p>
* Example JSON:
* [
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/autotune/utils/ServerContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
* All endpoints are having CORS enabled by default
*/
public class ServerContext {
public static final int AUTOTUNE_SERVER_PORT = Integer.parseInt(System.getenv().getOrDefault("AUTOTUNE_SERVER_PORT", "8080"));
public static final int KRUIZE_SERVER_PORT = Integer.parseInt(System.getenv().getOrDefault("AUTOTUNE_SERVER_PORT", "8080"));
public static final int HPO_SERVER_PORT = 8085;

// AnalyzerConstants end points
public static final String ROOT_CONTEXT = "/";
public static final String HEALTH_SERVICE = ROOT_CONTEXT + "health";
public static final String METRICS_SERVICE = ROOT_CONTEXT + "metrics";
public static final String LIST_AUTOTUNE_TUNABLES = ROOT_CONTEXT + "listAutotuneTunables";
public static final String LIST_KRUIZE_TUNABLES = ROOT_CONTEXT + "listKruizeTunables";
public static final String LIST_STACKS = ROOT_CONTEXT + "listStacks";
public static final String LIST_STACK_LAYERS = ROOT_CONTEXT + "listStackLayers";
public static final String LIST_STACK_TUNABLES = ROOT_CONTEXT + "listStackTunables";
Expand All @@ -43,17 +43,17 @@ public class ServerContext {



public static final String AUTOTUNE_SERVER_URL = "http://localhost:" + AUTOTUNE_SERVER_PORT;
public static final String SEARCH_SPACE_END_POINT = AUTOTUNE_SERVER_URL + SEARCH_SPACE;
public static final String LIST_EXPERIMENTS_END_POINT = AUTOTUNE_SERVER_URL + LIST_EXPERIMENTS;
public static final String UPDATE_RESULTS_END_POINT = AUTOTUNE_SERVER_URL + UPDATE_RESULTS;
public static final String KRUIZE_SERVER_URL = "http://localhost:" + KRUIZE_SERVER_PORT;
public static final String SEARCH_SPACE_END_POINT = KRUIZE_SERVER_URL + SEARCH_SPACE;
public static final String LIST_EXPERIMENTS_END_POINT = KRUIZE_SERVER_URL + LIST_EXPERIMENTS;
public static final String UPDATE_RESULTS_END_POINT = KRUIZE_SERVER_URL + UPDATE_RESULTS;

// HPO End Points
public static final String HPO_SERVER_URL = "http://localhost:" + HPO_SERVER_PORT;
public static final String HPO_TRIALS = ROOT_CONTEXT + "experiment_trials";
public static final String HPO_TRIALS_END_POINT = HPO_SERVER_URL + HPO_TRIALS;

public static final String EXPERIMENT_MANAGER_SERVER_URL = "http://localhost:" + AUTOTUNE_SERVER_PORT;
public static final String EXPERIMENT_MANAGER_SERVER_URL = "http://localhost:" + KRUIZE_SERVER_PORT;
public static final String EXPERIMENT_MANAGER_CREATE_TRIAL = ROOT_CONTEXT + "createExperimentTrial";
public static final String EXPERIMENT_MANAGER_CREATE_TRIAL_END_POINT = EXPERIMENT_MANAGER_SERVER_URL + EXPERIMENT_MANAGER_CREATE_TRIAL;
public static final String EXPERIMENT_MANAGER_LIST_EXPERIMENT_TRIAL = ROOT_CONTEXT + "listExperimentTrial";
Expand Down

0 comments on commit bbb7ff4

Please sign in to comment.