Skip to content

Commit dc2e3de

Browse files
authored
feat(epp): use kebab-cased flags for epp (#1177)
* feat(epp): use kebab-cased flags for epp Signed-off-by: bitliu <[email protected]> * resolve feedbacks Signed-off-by: bitliu <[email protected]> --------- Signed-off-by: bitliu <[email protected]>
1 parent a6f468c commit dc2e3de

File tree

7 files changed

+69
-69
lines changed

7 files changed

+69
-69
lines changed

cmd/bbr/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ import (
4040

4141
var (
4242
grpcPort = flag.Int(
43-
"grpcPort",
43+
"grpc-port",
4444
9004,
4545
"The gRPC port used for communicating with Envoy proxy")
4646
grpcHealthPort = flag.Int(
47-
"grpcHealthPort",
47+
"grpc-health-port",
4848
9005,
4949
"The port used for gRPC liveness and readiness probes")
5050
metricsPort = flag.Int(
51-
"metricsPort", 9090, "The metrics port")
51+
"metrics-port", 9090, "The metrics port")
5252
streaming = flag.Bool(
5353
"streaming", false, "Enables streaming support for Envoy full-duplex streaming mode")
5454
logVerbosity = flag.Int("v", logging.DEFAULT, "number for the log level verbosity")

cmd/epp/runner/runner.go

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -52,91 +52,91 @@ import (
5252

5353
var (
5454
grpcPort = flag.Int(
55-
"grpcPort",
55+
"grpc-port",
5656
runserver.DefaultGrpcPort,
5757
"The gRPC port used for communicating with Envoy proxy")
5858
grpcHealthPort = flag.Int(
59-
"grpcHealthPort",
59+
"grpc-health-port",
6060
runserver.DefaultGrpcHealthPort,
6161
"The port used for gRPC liveness and readiness probes")
6262
metricsPort = flag.Int(
63-
"metricsPort",
63+
"metrics-port",
6464
runserver.DefaultMetricsPort,
6565
"The metrics port")
6666
enablePprof = flag.Bool(
67-
"enablePprof",
67+
"enable-pprof",
6868
runserver.DefaultEnablePprof,
6969
"Enables pprof handlers. Defaults to true. Set to false to disable pprof handlers.")
7070
destinationEndpointHintKey = flag.String(
71-
"destinationEndpointHintKey",
71+
"destination-endpoint-hint-key",
7272
runserver.DefaultDestinationEndpointHintKey,
7373
"Header and response metadata key used by Envoy to route to the appropriate pod. This must match Envoy configuration.")
7474
destinationEndpointHintMetadataNamespace = flag.String(
75-
"DestinationEndpointHintMetadataNamespace",
75+
"destination-endpoint-hint-metadata-namespace",
7676
runserver.DefaultDestinationEndpointHintMetadataNamespace,
7777
"The key for the outer namespace struct in the metadata field of the extproc response that is used to wrap the"+
7878
"target endpoint. If not set, then an outer namespace struct should not be created.")
7979
poolName = flag.String(
80-
"poolName",
80+
"pool-name",
8181
runserver.DefaultPoolName,
8282
"Name of the InferencePool this Endpoint Picker is associated with.")
8383
poolNamespace = flag.String(
84-
"poolNamespace",
84+
"pool-namespace",
8585
runserver.DefaultPoolNamespace,
8686
"Namespace of the InferencePool this Endpoint Picker is associated with.")
8787
refreshMetricsInterval = flag.Duration(
88-
"refreshMetricsInterval",
88+
"refresh-metrics-interval",
8989
runserver.DefaultRefreshMetricsInterval,
9090
"interval to refresh metrics")
9191
refreshPrometheusMetricsInterval = flag.Duration(
92-
"refreshPrometheusMetricsInterval",
92+
"refresh-prometheus-metrics-interval",
9393
runserver.DefaultRefreshPrometheusMetricsInterval,
9494
"interval to flush prometheus metrics")
9595
logVerbosity = flag.Int(
9696
"v",
9797
logging.DEFAULT,
9898
"number for the log level verbosity")
9999
secureServing = flag.Bool(
100-
"secureServing",
100+
"secure-serving",
101101
runserver.DefaultSecureServing,
102102
"Enables secure serving. Defaults to true.")
103103
healthChecking = flag.Bool(
104-
"healthChecking",
104+
"health-checking",
105105
runserver.DefaultHealthChecking,
106106
"Enables health checking")
107107
certPath = flag.String(
108-
"certPath",
108+
"cert-path",
109109
runserver.DefaultCertPath,
110110
"The path to the certificate for secure serving. The certificate and private key files "+
111111
"are assumed to be named tls.crt and tls.key, respectively. If not set, and secureServing is enabled, "+
112112
"then a self-signed certificate is used.")
113113
// metric flags
114114
totalQueuedRequestsMetric = flag.String(
115-
"totalQueuedRequestsMetric",
115+
"total-queued-requests-metric",
116116
runserver.DefaultTotalQueuedRequestsMetric,
117117
"Prometheus metric for the number of queued requests.")
118118
kvCacheUsagePercentageMetric = flag.String(
119-
"kvCacheUsagePercentageMetric",
119+
"kv-cache-usage-percentage-metric",
120120
runserver.DefaultKvCacheUsagePercentageMetric,
121121
"Prometheus metric for the fraction of KV-cache blocks currently in use (from 0 to 1).")
122122
// LoRA metrics
123123
loraInfoMetric = flag.String(
124-
"loraInfoMetric",
124+
"lora-info-metric",
125125
runserver.DefaultLoraInfoMetric,
126126
"Prometheus metric for the LoRA info metrics (must be in vLLM label format).")
127127
// configuration flags
128128
configFile = flag.String(
129-
"configFile",
129+
"config-file",
130130
runserver.DefaultConfigFile,
131131
"The path to the configuration file")
132132
configText = flag.String(
133-
"configText",
133+
"config-text",
134134
runserver.DefaultConfigText,
135135
"The configuration specified as text, in lieu of a file")
136136

137-
modelServerMetricsPort = flag.Int("modelServerMetricsPort", 0, "Port to scrape metrics from pods. "+
137+
modelServerMetricsPort = flag.Int("model-server-metrics-port", 0, "Port to scrape metrics from pods. "+
138138
"Default value will be set to InferencePool.Spec.TargetPortNumber if not set.")
139-
modelServerMetricsPath = flag.String("modelServerMetricsPath", "/metrics", "Path to scrape metrics from pods")
139+
modelServerMetricsPath = flag.String("model-server-metrics-path", "/metrics", "Path to scrape metrics from pods")
140140

141141
setupLog = ctrl.Log.WithName("setup")
142142
)
@@ -167,16 +167,16 @@ func (r *Runner) WithSchedulerConfig(schedulerConfig *scheduling.SchedulerConfig
167167
func bindEnvToFlags() {
168168
// map[ENV_VAR]flagName – add more as needed
169169
for env, flg := range map[string]string{
170-
"GRPC_PORT": "grpcPort",
171-
"GRPC_HEALTH_PORT": "grpcHealthPort",
172-
"MODEL_SERVER_METRICS_PORT": "modelServerMetricsPort",
173-
"MODEL_SERVER_METRICS_PATH": "modelServerMetricsPath",
174-
"DESTINATION_ENDPOINT_HINT_KEY": "destinationEndpointHintKey",
175-
"POOL_NAME": "poolName",
176-
"POOL_NAMESPACE": "poolNamespace",
170+
"GRPC_PORT": "grpc-port",
171+
"GRPC_HEALTH_PORT": "grpc-health-port",
172+
"MODEL_SERVER_METRICS_PORT": "model-server-metrics-port",
173+
"MODEL_SERVER_METRICS_PATH": "model-server-metrics-path",
174+
"DESTINATION_ENDPOINT_HINT_KEY": "destination-endpoint-hint-key",
175+
"POOL_NAME": "pool-name",
176+
"POOL_NAMESPACE": "pool-namespace",
177177
// durations & bools work too; flag.Set expects the *string* form
178-
"REFRESH_METRICS_INTERVAL": "refreshMetricsInterval",
179-
"SECURE_SERVING": "secureServing",
178+
"REFRESH_METRICS_INTERVAL": "refresh-metrics-interval",
179+
"SECURE_SERVING": "secure-serving",
180180
} {
181181
if v := os.Getenv(env); v != "" {
182182
// ignore error; Parse() will catch invalid values later

config/charts/body-based-routing/templates/bbr.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ spec:
1818
image: {{ .Values.bbr.image.hub }}/{{ .Values.bbr.image.name }}:{{ .Values.bbr.image.tag }}
1919
imagePullPolicy: {{ .Values.bbr.image.pullPolicy | default "Always" }}
2020
args:
21-
- "-streaming"
22-
- "-v"
21+
- "--streaming"
22+
- "--v"
2323
- "3"
2424
ports:
2525
- containerPort: {{ .Values.bbr.port }}

config/charts/inferencepool/templates/epp-deployment.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,28 @@ spec:
2323
image: {{ .Values.inferenceExtension.image.hub }}/{{ .Values.inferenceExtension.image.name }}:{{ .Values.inferenceExtension.image.tag }}
2424
imagePullPolicy: {{ .Values.inferenceExtension.image.pullPolicy | default "Always" }}
2525
args:
26-
- -poolName
26+
- --pool-name
2727
- {{ .Release.Name }}
28-
- -poolNamespace
28+
- --pool-namespace
2929
- {{ .Release.Namespace }}
30-
- -v
30+
- --v
3131
- "3"
32-
- -grpcPort
32+
- --grpc-port
3333
- "9002"
34-
- -grpcHealthPort
34+
- --grpc-health-port
3535
- "9003"
36-
- -metricsPort
36+
- --metrics-port
3737
- "9090"
38-
- -configFile
38+
- --config-file
3939
- "config/{{ .Values.inferenceExtension.pluginsConfigFile }}"
4040
# https://pkg.go.dev/flag#hdr-Command_line_flag_syntax; space is only for non-bool flags
41-
- "-enablePprof={{ .Values.inferenceExtension.enablePprof }}"
41+
- "--enable-pprof={{ .Values.inferenceExtension.enablePprof }}"
4242
{{- if eq (.Values.inferencePool.modelServerType | default "vllm") "triton-tensorrt-llm" }}
43-
- -totalQueuedRequestsMetric
43+
- --total-queued-requests-metric
4444
- "nv_trt_llm_request_metrics{request_type=waiting}"
45-
- -kvCacheUsagePercentageMetric
45+
- --kv-cache-usage-percentage-metric
4646
- "nv_trt_llm_kv_cache_block_metrics{kv_cache_block_type=fraction}"
47-
- -loraInfoMetric
47+
- --lora-info-metric
4848
- "" # Set an empty metric to disable LoRA metric scraping as they are not supported by Triton yet.
4949
{{- end }}
5050
ports:

config/manifests/inferencepool-resources.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ spec:
5353
image: us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension/epp:main
5454
imagePullPolicy: Always
5555
args:
56-
- -poolName
56+
- --pool-name
5757
- "vllm-llama3-8b-instruct"
58-
- "-poolNamespace"
58+
- "--pool-namespace"
5959
- "default"
60-
- -v
60+
- --v
6161
- "4"
6262
- --zap-encoder
6363
- "json"
64-
- -grpcPort
64+
- --grpc-port
6565
- "9002"
66-
- -grpcHealthPort
66+
- --grpc-health-port
6767
- "9003"
68-
- "-configFile"
68+
- "--config-file"
6969
- "/config/default-plugins.yaml"
7070
ports:
7171
- containerPort: 9002

conformance/resources/manifests/manifests.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -199,19 +199,19 @@ spec:
199199
image: us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension/epp:main
200200
imagePullPolicy: Always
201201
args:
202-
- -poolName
202+
- --pool-name
203203
- "primary-inference-pool"
204-
- -poolNamespace
204+
- --pool-namespace
205205
- "gateway-conformance-app-backend"
206-
- -v
206+
- --v
207207
- "4"
208208
- --zap-encoder
209209
- "json"
210-
- -grpcPort
210+
- --grpc-port
211211
- "9002"
212-
- -grpcHealthPort
212+
- --grpc-health-port
213213
- "9003"
214-
- "-configFile"
214+
- "--config-file"
215215
- "/config/conformance-plugins.yaml"
216216
ports:
217217
- containerPort: 9002
@@ -293,19 +293,19 @@ spec:
293293
image: us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension/epp:main
294294
imagePullPolicy: Always
295295
args:
296-
- -poolName
296+
- --pool-name
297297
- "secondary-inference-pool"
298-
- -poolNamespace
298+
- --pool-namespace
299299
- "gateway-conformance-app-backend"
300-
- -v
300+
- --v
301301
- "4"
302302
- --zap-encoder
303303
- "json"
304-
- -grpcPort
304+
- --grpc-port
305305
- "9002"
306-
- -grpcHealthPort
306+
- --grpc-health-port
307307
- "9003"
308-
- "-configFile"
308+
- "--config-file"
309309
- "/config/conformance-plugins.yaml"
310310
ports:
311311
- containerPort: 9002

test/testdata/inferencepool-e2e.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ spec:
5050
image: $E2E_IMAGE
5151
imagePullPolicy: IfNotPresent
5252
args:
53-
- -poolName
53+
- --pool-name
5454
- "vllm-llama3-8b-instruct"
55-
- -poolNamespace
55+
- --pool-namespace
5656
- "$E2E_NS"
57-
- -v
57+
- --v
5858
- "4"
5959
- --zap-encoder
6060
- "json"
61-
- -grpcPort
61+
- --grpc-port
6262
- "9002"
63-
- -grpcHealthPort
63+
- --grpc-health-port
6464
- "9003"
65-
- "-configFile"
65+
- "--config-file"
6666
- "/config/default-plugins.yaml"
6767
ports:
6868
- containerPort: 9002

0 commit comments

Comments
 (0)