Skip to content

Commit 916bc59

Browse files
authored
feat: 🔧 unify the default parameter value positions (#1119)
1 parent caebcc6 commit 916bc59

File tree

2 files changed

+45
-17
lines changed

2 files changed

+45
-17
lines changed

‎cmd/epp/runner/runner.go

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,12 @@ var (
6464
"The gRPC port used for communicating with Envoy proxy")
6565
grpcHealthPort = flag.Int(
6666
"grpcHealthPort",
67-
9003,
67+
runserver.DefaultGrpcHealthPort,
6868
"The port used for gRPC liveness and readiness probes")
6969
metricsPort = flag.Int(
70-
"metricsPort", 9090, "The metrics port")
70+
"metricsPort",
71+
runserver.DefaultMetricsPort,
72+
"The metrics port")
7173
destinationEndpointHintKey = flag.String(
7274
"destinationEndpointHintKey",
7375
runserver.DefaultDestinationEndpointHintKey,
@@ -93,28 +95,47 @@ var (
9395
"refreshPrometheusMetricsInterval",
9496
runserver.DefaultRefreshPrometheusMetricsInterval,
9597
"interval to flush prometheus metrics")
96-
logVerbosity = flag.Int("v", logging.DEFAULT, "number for the log level verbosity")
98+
logVerbosity = flag.Int(
99+
"v",
100+
logging.DEFAULT,
101+
"number for the log level verbosity")
97102
secureServing = flag.Bool(
98-
"secureServing", runserver.DefaultSecureServing, "Enables secure serving. Defaults to true.")
99-
healthChecking = flag.Bool("healthChecking", runserver.DefaultHealthChecking, "Enables health checking")
100-
certPath = flag.String(
101-
"certPath", "", "The path to the certificate for secure serving. The certificate and private key files "+
103+
"secureServing",
104+
runserver.DefaultSecureServing,
105+
"Enables secure serving. Defaults to true.")
106+
healthChecking = flag.Bool(
107+
"healthChecking",
108+
runserver.DefaultHealthChecking,
109+
"Enables health checking")
110+
certPath = flag.String(
111+
"certPath",
112+
runserver.DefaultCertPath,
113+
"The path to the certificate for secure serving. The certificate and private key files "+
102114
"are assumed to be named tls.crt and tls.key, respectively. If not set, and secureServing is enabled, "+
103115
"then a self-signed certificate is used.")
104116
// metric flags
105-
totalQueuedRequestsMetric = flag.String("totalQueuedRequestsMetric",
106-
"vllm:num_requests_waiting",
117+
totalQueuedRequestsMetric = flag.String(
118+
"totalQueuedRequestsMetric",
119+
runserver.DefaultTotalQueuedRequestsMetric,
107120
"Prometheus metric for the number of queued requests.")
108-
kvCacheUsagePercentageMetric = flag.String("kvCacheUsagePercentageMetric",
109-
"vllm:gpu_cache_usage_perc",
121+
kvCacheUsagePercentageMetric = flag.String(
122+
"kvCacheUsagePercentageMetric",
123+
runserver.DefaultKvCacheUsagePercentageMetric,
110124
"Prometheus metric for the fraction of KV-cache blocks currently in use (from 0 to 1).")
111125
// LoRA metrics
112-
loraInfoMetric = flag.String("loraInfoMetric",
113-
"vllm:lora_requests_info",
126+
loraInfoMetric = flag.String(
127+
"loraInfoMetric",
128+
runserver.DefaultLoraInfoMetric,
114129
"Prometheus metric for the LoRA info metrics (must be in vLLM label format).")
115130
// configuration flags
116-
configFile = flag.String("configFile", "", "The path to the configuration file")
117-
configText = flag.String("configText", "", "The configuration specified as text, in lieu of a file")
131+
configFile = flag.String(
132+
"configFile",
133+
runserver.DefaultConfigFile,
134+
"The path to the configuration file")
135+
configText = flag.String(
136+
"configText",
137+
runserver.DefaultConfigText,
138+
"The configuration specified as text, in lieu of a file")
118139

119140
setupLog = ctrl.Log.WithName("setup")
120141

@@ -405,7 +426,7 @@ func validateFlags() error {
405426
return fmt.Errorf("required %q flag not set", "poolName")
406427
}
407428
if *configText != "" && *configFile != "" {
408-
return fmt.Errorf("both the %s and %s flags can not be set at the same time", "configText", "configFile")
429+
return fmt.Errorf("both the %q and %q flags can not be set at the same time", "configText", "configFile")
409430
}
410431

411432
return nil

‎pkg/epp/server/runserver.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"context"
2121
"crypto/tls"
2222
"fmt"
23-
2423
"time"
2524

2625
extProcPb "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3"
@@ -63,6 +62,8 @@ type ExtProcServerRunner struct {
6362
// Default values for CLI flags in main
6463
const (
6564
DefaultGrpcPort = 9002 // default for --grpcPort
65+
DefaultGrpcHealthPort = 9003 // default for --grpcHealthPort
66+
DefaultMetricsPort = 9090 // default for --metricsPort
6667
DefaultDestinationEndpointHintMetadataNamespace = "envoy.lb" // default for --destinationEndpointHintMetadataNamespace
6768
DefaultDestinationEndpointHintKey = "x-gateway-destination-endpoint" // default for --destinationEndpointHintKey
6869
DefaultPoolName = "" // required but no default
@@ -71,6 +72,12 @@ const (
7172
DefaultRefreshPrometheusMetricsInterval = 5 * time.Second // default for --refreshPrometheusMetricsInterval
7273
DefaultSecureServing = true // default for --secureServing
7374
DefaultHealthChecking = false // default for --healthChecking
75+
DefaultTotalQueuedRequestsMetric = "vllm:num_requests_waiting" // default for --totalQueuedRequestsMetric
76+
DefaultKvCacheUsagePercentageMetric = "vllm:gpu_cache_usage_perc" // default for --kvCacheUsagePercentageMetric
77+
DefaultLoraInfoMetric = "vllm:lora_requests_info" // default for --loraInfoMetric
78+
DefaultCertPath = "" // default for --certPath
79+
DefaultConfigFile = "" // default for --configFile
80+
DefaultConfigText = "" // default for --configText
7481
)
7582

7683
// NewDefaultExtProcServerRunner creates a runner with default values.

0 commit comments

Comments
 (0)