From bbb7ff4bce31718cf8ec51df2c80a0b8c1bd8907 Mon Sep 17 00:00:00 2001 From: Dinakar Guniguntala Date: Mon, 20 Mar 2023 15:05:24 +0530 Subject: [PATCH] Update listAutotuneTunables to listKruizeTunables Related script and API doc changes Signed-off-by: Dinakar Guniguntala --- design/ExperimentModeAPI.md | 10 +++++----- docs/autotune_install.md | 2 +- scripts/minikube-helpers.sh | 6 +++--- scripts/openshift-helpers.sh | 2 +- src/main/java/com/autotune/Autotune.java | 2 +- src/main/java/com/autotune/analyzer/Analyzer.java | 2 +- .../analyzer/services/ListKruizeTunables.java | 6 +++--- .../java/com/autotune/utils/ServerContext.java | 14 +++++++------- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/design/ExperimentModeAPI.md b/design/ExperimentModeAPI.md index 8b0a62765..5c190226d 100644 --- a/design/ExperimentModeAPI.md +++ b/design/ExperimentModeAPI.md @@ -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=` gives all tunables for the SLO class +`GET /listKruizeTunables?slo_class=` gives all tunables for the SLO class -`GET /listAutotuneTunables?slo_class=&layer_name=` gives tunables for the SLO class and the layer +`GET /listKruizeTunables?slo_class=&layer_name=` gives tunables for the SLO class and the layer -`curl -H 'Accept: application/json' http://:/listAutotuneTunables?slo_class=` +`curl -H 'Accept: application/json' http://:/listKruizeTunables?slo_class=` **Response** diff --git a/docs/autotune_install.md b/docs/autotune_install.md index f3cd30ee6..bd7c1164e 100644 --- a/docs/autotune_install.md +++ b/docs/autotune_install.md @@ -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 diff --git a/scripts/minikube-helpers.sh b/scripts/minikube-helpers.sh index eb8af9440..9a70d9509 100755 --- a/scripts/minikube-helpers.sh +++ b/scripts/minikube-helpers.sh @@ -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" @@ -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 } @@ -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 diff --git a/scripts/openshift-helpers.sh b/scripts/openshift-helpers.sh index c2a2f8017..604b211db 100644 --- a/scripts/openshift-helpers.sh +++ b/scripts/openshift-helpers.sh @@ -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 } diff --git a/src/main/java/com/autotune/Autotune.java b/src/main/java/com/autotune/Autotune.java index 7bc7e8930..bb142fcc1 100644 --- a/src/main/java/com/autotune/Autotune.java +++ b/src/main/java/com/autotune/Autotune.java @@ -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()); diff --git a/src/main/java/com/autotune/analyzer/Analyzer.java b/src/main/java/com/autotune/analyzer/Analyzer.java index 6e3b0d5cb..5f6b2b050 100644 --- a/src/main/java/com/autotune/analyzer/Analyzer.java +++ b/src/main/java/com/autotune/analyzer/Analyzer.java @@ -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); diff --git a/src/main/java/com/autotune/analyzer/services/ListKruizeTunables.java b/src/main/java/com/autotune/analyzer/services/ListKruizeTunables.java index d7a8e6f82..410b87253 100644 --- a/src/main/java/com/autotune/analyzer/services/ListKruizeTunables.java +++ b/src/main/java/com/autotune/analyzer/services/ListKruizeTunables.java @@ -37,11 +37,11 @@ public class ListKruizeTunables extends HttpServlet { * 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=` gives all tunables for the SLO class + * `GET /listKruizeTunables?slo_class=` gives all tunables for the SLO class *

- * `GET /listAutotuneTunables?slo_class=&layer=` gives tunables for the SLO class and the layer + * `GET /listKruizeTunables?slo_class=&layer=` gives tunables for the SLO class and the layer *

* Example JSON: * [ diff --git a/src/main/java/com/autotune/utils/ServerContext.java b/src/main/java/com/autotune/utils/ServerContext.java index dab8a877b..12947618e 100644 --- a/src/main/java/com/autotune/utils/ServerContext.java +++ b/src/main/java/com/autotune/utils/ServerContext.java @@ -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"; @@ -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";