Skip to content

Commit 48a81ab

Browse files
committed
small fixes
1 parent 74b28ee commit 48a81ab

File tree

9 files changed

+52
-12
lines changed

9 files changed

+52
-12
lines changed

docker/build-tools/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ RUN curl --proto '=https' -v --tlsv1.2 -sSf https://sh.rustup.rs | \
634634
mv /home/.cargo/bin/* /usr/bin
635635
RUN cargo install rustfilt
636636

637+
637638
# Clean up stuff we don't need in the final image
638639
RUN rm -rf /var/lib/apt/lists/* \
639640
&& rm -fr /usr/share/python \

perf/benchmark/configs/istio/ext_authz/installation.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ spec:
1919
telemetry:
2020
enabled: true
2121
v2:
22-
enabled: true
22+
enabled: true

perf/benchmark/graph_plotter/graph_plotter.py

+15-5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def plotter(args):
2929

3030
df = pd.read_csv(args.csv_filepath)
3131
telemetry_modes_y_data = {}
32+
if not args.telemetry_modes:
33+
args.telemetry_modes = df["Labels"].unique()
34+
3235
metric_name = get_metric_name(args)
3336
constructed_query_str = get_constructed_query_str(args)
3437

@@ -41,6 +44,8 @@ def plotter(args):
4144
fig = plt.figure(figsize=(1138 / dpi, 871 / dpi), dpi=dpi)
4245
ax = fig.add_subplot(111)
4346
ax.set_ylim(0, 1.0)
47+
if args.title:
48+
ax.set_title(args.title)
4449
for key, val in telemetry_modes_y_data.items():
4550
plot_key = key
4651
match key:
@@ -107,15 +112,15 @@ def get_data_helper(df, query_list, query_str, telemetry_mode, metric_name):
107112
try:
108113
data[metric_name].head().empty
109114
except KeyError as e:
110-
y_series_data.append(None)
115+
y_series_data.append(0)
111116
else:
112117
if not data[metric_name].head().empty:
113118
if metric_name.startswith('cpu') or metric_name.startswith('mem'):
114119
y_series_data.append(data[metric_name].head(1).values[0])
115120
else:
116-
y_series_data.append(data[metric_name].head(1).values[0] / data["ActualQPS"].head(1).values[0])
121+
y_series_data.append(data[metric_name].head(1).values[0] / 1000)
117122
else:
118-
y_series_data.append(None)
123+
y_series_data.append(0)
119124

120125
return y_series_data
121126

@@ -174,15 +179,20 @@ def get_parser():
174179
parser.add_argument(
175180
"--query_str",
176181
help="Specify the qps or conn query_str that will be used to query your y-axis data based on the CSV file."
177-
"For example: conn_query_str=ActualQPS==1000, qps_query_str=NumThreads==16."
182+
"For example: conn_query_str=ActualQPS==1000, qps_query_str=NumThreads==16.",
183+
default=""
178184
)
179185
parser.add_argument(
180186
"--csv_filepath",
181187
help="The path of the CSV file."
182188
)
183189
parser.add_argument(
184190
"--graph_title",
185-
help="The graph title."
191+
help="Output path."
192+
)
193+
parser.add_argument(
194+
"--title",
195+
help="Visual title of graph."
186196
)
187197
return parser
188198

perf/benchmark/runner/fortio.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def sync_fortio(url, table, selector=None, promUrl="", csv=None, csv_output="",
177177
if gd.get('errorPercent', 0) > 10:
178178
print("... Run resulted in", gd['errorPercent'], "% errors")
179179
continue
180-
min_duration = METRICS_START_SKIP_DURATION + METRICS_END_SKIP_DURATION
180+
min_duration = 5 # METRICS_START_SKIP_DURATION + METRICS_END_SKIP_DURATION
181181
if min_duration > gd['ActualDuration']:
182182
print("... {} duration={}s is less than minimum {}s".format(
183183
gd["Labels"], gd['ActualDuration'], min_duration))

perf/benchmark/runner/runner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ def can_connect_to_nighthawk_service():
499499

500500

501501
def run_perf_test(args):
502-
min_duration = METRICS_START_SKIP_DURATION + METRICS_END_SKIP_DURATION
502+
min_duration = 5 # METRICS_START_SKIP_DURATION + METRICS_END_SKIP_DURATION
503503

504504
# run with config files
505505
if args.config_file is not None:

perf/benchmark/setup_test.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ RBAC_ENABLED="false"
3333
SERVER_REPLICA="${SERVER_REPLICA:-1}"
3434
CLIENT_REPLICA="${CLIENT_REPLICA:-1}"
3535
ISTIO_INJECT="${ISTIO_INJECT:-false}"
36+
AMBIENT_ENABLED="${AMBIENT_ENABLED:-false}"
3637
LINKERD_INJECT="${LINKERD_INJECT:-disabled}"
3738
INTERCEPTION_MODE="${INTERCEPTION_MODE:-REDIRECT}"
3839
FORTIO_SERVER_INGRESS_CERT_ENABLED="${FORTIO_SERVER_INGRESS_CERT_ENABLED:-false}"
@@ -55,12 +56,13 @@ function setup_test() {
5556
--set rbac.enabled="${RBAC_ENABLED}" \
5657
--set namespace="${NAMESPACE}" \
5758
--set loadGenType="${LOAD_GEN_TYPE}" \
58-
--set excludeOutboundIPRanges=$(pod_ip_range)\
59-
--set includeOutboundIPRanges=$(svc_ip_range) \
6059
--set server.replica="${SERVER_REPLICA}" \
6160
--set client.replica="${CLIENT_REPLICA}" \
6261
--set server.inject="${ISTIO_INJECT}" \
6362
--set client.inject="${ISTIO_INJECT}" \
63+
--set server.waypoint="${WAYPOINT_ENABLED}" \
64+
--set server.ambient="${AMBIENT_ENABLED}" \
65+
--set client.ambient="${AMBIENT_ENABLED}" \
6466
--set server.injectL="${LINKERD_INJECT}" \
6567
--set client.injectL="${LINKERD_INJECT}" \
6668
--set domain="${DNS_DOMAIN}" \
@@ -92,6 +94,10 @@ then
9294
kubectl label namespace "${NAMESPACE}" istio-injection=enabled --overwrite || true
9395
fi
9496

97+
if [[ "$AMBIENT_ENABLED" == "true" ]]
98+
then
99+
kubectl label namespace "${NAMESPACE}" istio.io/dataplane-mode=ambient --overwrite || true
100+
fi
95101
if [[ "$LINKERD_INJECT" == "enabled" ]]
96102
then
97103
kubectl annotate namespace "${NAMESPACE}" linkerd.io/inject=enabled || true

perf/benchmark/templates/fortio.yaml

+21-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ spec:
88
rules:
99
- services: ["{{ $.name }}.*"]
1010
methods: ["*"]
11+
1112
---
1213
apiVersion: "rbac.istio.io/v1alpha1"
1314
kind: ServiceRoleBinding
@@ -20,13 +21,31 @@ spec:
2021
kind: ServiceRole
2122
name: "{{ $ruleName }}"
2223
{{- end }}
23-
2424
{{- define "fortio" }}
2525
---
26+
{{- if and .Values.server.waypoint .Values.server.ambient }}
27+
apiVersion: gateway.networking.k8s.io/v1
28+
kind: Gateway
29+
metadata:
30+
name: {{ $.name }}-wp
31+
labels:
32+
istio.io/waypoint-for: service
33+
spec:
34+
gatewayClassName: istio-waypoint
35+
listeners:
36+
- name: mesh
37+
port: 15008
38+
protocol: HBONE
39+
{{- end }}
40+
---
2641
apiVersion: v1
2742
kind: Service
2843
metadata:
2944
name: {{ $.name }}
45+
{{- if and .Values.server.waypoint .Values.server.ambient }}
46+
labels:
47+
istio.io/use-waypoint: {{ $.name }}-wp
48+
{{- end }}
3049
spec:
3150
ports:
3251
- name: http-echo
@@ -388,6 +407,7 @@ spec:
388407
labels:
389408
app: {{ $.name }}
390409
spec:
410+
terminationGracePeriodSeconds: 0
391411
affinity:
392412
podAntiAffinity:
393413
requiredDuringSchedulingIgnoredDuringExecution:

perf/benchmark/values.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ server: # server overrides
3131
#tlsmode: DISABLE
3232
tlsmode: ISTIO_MUTUAL
3333
expose: false
34+
waypoint: false
35+
ambient: false
3436
inject: "false"
3537
injectL: "disabled" # "enabled" or "disabled"
3638
replica: 1 # default value
@@ -39,6 +41,7 @@ client: # client overrides
3941
#tlsmode: DISABLE
4042
tlsmode: ISTIO_MUTUAL
4143
expose: true
44+
ambient: false
4245
inject: "false"
4346
injectL: "disabled" # "enabled" or "disabled"
4447
replica: 1 # default value

perf/istio-install/base/templates/prometheus-operator.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,4 @@ spec:
175175
selector:
176176
app.kubernetes.io/component: controller
177177
app.kubernetes.io/name: prometheus-operator
178-
{{- end }}
178+
{{- end }}

0 commit comments

Comments
 (0)