From 3c7086c9b740c0467cdef97e67a822bcee98ea3e Mon Sep 17 00:00:00 2001 From: Steven Jin Xuan Date: Mon, 23 Sep 2024 14:43:21 -0400 Subject: [PATCH] small fixes --- docker/build-tools/Dockerfile | 1 + .../configs/istio/ext_authz/installation.yaml | 2 +- perf/benchmark/graph_plotter/graph_plotter.py | 14 ++++++++----- perf/benchmark/setup_test.sh | 10 ++++++++-- perf/benchmark/templates/fortio.yaml | 20 +++++++++++++++++++ perf/benchmark/values.yaml | 3 +++ .../base/templates/prometheus-operator.yaml | 2 +- 7 files changed, 43 insertions(+), 9 deletions(-) diff --git a/docker/build-tools/Dockerfile b/docker/build-tools/Dockerfile index a6be1eb42b..21a3cea568 100644 --- a/docker/build-tools/Dockerfile +++ b/docker/build-tools/Dockerfile @@ -634,6 +634,7 @@ RUN curl --proto '=https' -v --tlsv1.2 -sSf https://sh.rustup.rs | \ mv /home/.cargo/bin/* /usr/bin RUN cargo install rustfilt + # Clean up stuff we don't need in the final image RUN rm -rf /var/lib/apt/lists/* \ && rm -fr /usr/share/python \ diff --git a/perf/benchmark/configs/istio/ext_authz/installation.yaml b/perf/benchmark/configs/istio/ext_authz/installation.yaml index 3e48963962..8be2d7521d 100644 --- a/perf/benchmark/configs/istio/ext_authz/installation.yaml +++ b/perf/benchmark/configs/istio/ext_authz/installation.yaml @@ -19,4 +19,4 @@ spec: telemetry: enabled: true v2: - enabled: true \ No newline at end of file + enabled: true diff --git a/perf/benchmark/graph_plotter/graph_plotter.py b/perf/benchmark/graph_plotter/graph_plotter.py index b8f2d01d7c..b3ab37de28 100755 --- a/perf/benchmark/graph_plotter/graph_plotter.py +++ b/perf/benchmark/graph_plotter/graph_plotter.py @@ -29,6 +29,9 @@ def plotter(args): df = pd.read_csv(args.csv_filepath) telemetry_modes_y_data = {} + if not args.telemetry_modes: + args.telemetry_modes = df["Labels"].unique() + metric_name = get_metric_name(args) constructed_query_str = get_constructed_query_str(args) @@ -40,7 +43,7 @@ def plotter(args): plt.figure(figsize=(1138 / dpi, 871 / dpi), dpi=dpi) fig = plt.figure(figsize=(1138 / dpi, 871 / dpi), dpi=dpi) ax = fig.add_subplot(111) - ax.set_ylim(0, 1.0) + # ax.set_ylim(0, 1.0) for key, val in telemetry_modes_y_data.items(): plot_key = key match key: @@ -107,15 +110,15 @@ def get_data_helper(df, query_list, query_str, telemetry_mode, metric_name): try: data[metric_name].head().empty except KeyError as e: - y_series_data.append(None) + y_series_data.append(0) else: if not data[metric_name].head().empty: if metric_name.startswith('cpu') or metric_name.startswith('mem'): y_series_data.append(data[metric_name].head(1).values[0]) else: - y_series_data.append(data[metric_name].head(1).values[0] / data["ActualQPS"].head(1).values[0]) + y_series_data.append(data[metric_name].head(1).values[0] / 1000) else: - y_series_data.append(None) + y_series_data.append(0) return y_series_data @@ -174,7 +177,8 @@ def get_parser(): parser.add_argument( "--query_str", help="Specify the qps or conn query_str that will be used to query your y-axis data based on the CSV file." - "For example: conn_query_str=ActualQPS==1000, qps_query_str=NumThreads==16." + "For example: conn_query_str=ActualQPS==1000, qps_query_str=NumThreads==16.", + default="" ) parser.add_argument( "--csv_filepath", diff --git a/perf/benchmark/setup_test.sh b/perf/benchmark/setup_test.sh index 42621a11ce..ee20656678 100755 --- a/perf/benchmark/setup_test.sh +++ b/perf/benchmark/setup_test.sh @@ -33,6 +33,7 @@ RBAC_ENABLED="false" SERVER_REPLICA="${SERVER_REPLICA:-1}" CLIENT_REPLICA="${CLIENT_REPLICA:-1}" ISTIO_INJECT="${ISTIO_INJECT:-false}" +AMBIENT_ENABLED="${AMBIENT_ENABLED:-false}" LINKERD_INJECT="${LINKERD_INJECT:-disabled}" INTERCEPTION_MODE="${INTERCEPTION_MODE:-REDIRECT}" FORTIO_SERVER_INGRESS_CERT_ENABLED="${FORTIO_SERVER_INGRESS_CERT_ENABLED:-false}" @@ -55,12 +56,13 @@ function setup_test() { --set rbac.enabled="${RBAC_ENABLED}" \ --set namespace="${NAMESPACE}" \ --set loadGenType="${LOAD_GEN_TYPE}" \ - --set excludeOutboundIPRanges=$(pod_ip_range)\ - --set includeOutboundIPRanges=$(svc_ip_range) \ --set server.replica="${SERVER_REPLICA}" \ --set client.replica="${CLIENT_REPLICA}" \ --set server.inject="${ISTIO_INJECT}" \ --set client.inject="${ISTIO_INJECT}" \ + --set server.waypoint="${WAYPOINT_ENABLED}" \ + --set server.ambient="${AMBIENT_ENABLED}" \ + --set client.ambient="${AMBIENT_ENABLED}" \ --set server.injectL="${LINKERD_INJECT}" \ --set client.injectL="${LINKERD_INJECT}" \ --set domain="${DNS_DOMAIN}" \ @@ -92,6 +94,10 @@ then kubectl label namespace "${NAMESPACE}" istio-injection=enabled --overwrite || true fi +if [[ "$AMBIENT_ENABLED" == "true" ]] +then + kubectl label namespace "${NAMESPACE}" istio.io/dataplane-mode=ambient --overwrite || true +fi if [[ "$LINKERD_INJECT" == "enabled" ]] then kubectl annotate namespace "${NAMESPACE}" linkerd.io/inject=enabled || true diff --git a/perf/benchmark/templates/fortio.yaml b/perf/benchmark/templates/fortio.yaml index 8b33e6aa88..f5e2b40a17 100644 --- a/perf/benchmark/templates/fortio.yaml +++ b/perf/benchmark/templates/fortio.yaml @@ -23,10 +23,29 @@ spec: {{- define "fortio" }} --- +{{- if and .Values.server.waypoint .Values.server.ambient }} +apiVersion: gateway.networking.k8s.io/v1 +kind: Gateway +metadata: + name: {{ $.name }}-wp + labels: + istio.io/waypoint-for: {{ $.name }} +spec: + gatewayClassName: istio-waypoint + listeners: + - name: mesh + port: 15008 + protocol: HBONE +{{- end }} +--- apiVersion: v1 kind: Service metadata: name: {{ $.name }} +{{- if and .Values.server.waypoint .Values.server.ambient }} + labels: + istio.io/use-waypoint: {{ $.name }}-wp +{{- end }} spec: ports: - name: http-echo @@ -388,6 +407,7 @@ spec: labels: app: {{ $.name }} spec: + terminationGracePeriodSeconds: 0 affinity: podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: diff --git a/perf/benchmark/values.yaml b/perf/benchmark/values.yaml index 1f2c5fad69..c1ee53c22f 100644 --- a/perf/benchmark/values.yaml +++ b/perf/benchmark/values.yaml @@ -31,6 +31,8 @@ server: # server overrides #tlsmode: DISABLE tlsmode: ISTIO_MUTUAL expose: false + waypoint: false + ambient: false inject: "false" injectL: "disabled" # "enabled" or "disabled" replica: 1 # default value @@ -39,6 +41,7 @@ client: # client overrides #tlsmode: DISABLE tlsmode: ISTIO_MUTUAL expose: true + ambient: false inject: "false" injectL: "disabled" # "enabled" or "disabled" replica: 1 # default value diff --git a/perf/istio-install/base/templates/prometheus-operator.yaml b/perf/istio-install/base/templates/prometheus-operator.yaml index 12236332e3..1732056e26 100644 --- a/perf/istio-install/base/templates/prometheus-operator.yaml +++ b/perf/istio-install/base/templates/prometheus-operator.yaml @@ -175,4 +175,4 @@ spec: selector: app.kubernetes.io/component: controller app.kubernetes.io/name: prometheus-operator -{{- end }} \ No newline at end of file +{{- end }}