@@ -30,6 +30,9 @@ set -euo pipefail
3030# BENCH_DB_PASSWORD — PostgreSQL password (default: random 24-char string)
3131# PROMETHEUS_RELEASE — Prometheus Operator release label for ServiceMonitor discovery (default: llmd-kube-prometheus-stack)
3232# PROMETHEUS_NAMESPACE — Namespace where Prometheus is deployed (default: llm-d-monitoring)
33+ # DISPATCHER_VERSION — async-processor image version for scenario 5 (default: v0.7.3)
34+ # DISPATCHER_CHART — async-processor Helm chart reference (default: OCI chart)
35+ # DISPATCHER_CHART_VERSION — async-processor chart version (default: 0.7.3)
3336
3437SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
3538REPO_ROOT=" $( cd " ${SCRIPT_DIR} /.." && pwd) "
@@ -166,6 +169,12 @@ GIE_VERSION="${GIE_VERSION:-v1.5.0}"
166169GIE_REPO=" ${GIE_REPO:- } "
167170GIE_UPSTREAM_REPO=" https://github.com/kubernetes-sigs/gateway-api-inference-extension.git"
168171
172+ # Async-processor settings for scenario 5
173+ DISPATCHER_VERSION=" ${DISPATCHER_VERSION:- v0.7.3} "
174+ DISPATCHER_IMAGE=" ${DISPATCHER_IMAGE:- ghcr.io/ llm-d-incubation/ llm-d-async: ${DISPATCHER_VERSION} } "
175+ DISPATCHER_CHART=" ${DISPATCHER_CHART:- oci:// ghcr.io/ llm-d-incubation/ charts/ async-processor} "
176+ DISPATCHER_CHART_VERSION=" ${DISPATCHER_CHART_VERSION:- 0.7.3} "
177+
169178# --- Inference backend ---
170179if [ " ${MODE} " = " sim" ]; then
171180 # Sim mode: deploy inference-sim (no GPU, no router, no Istio)
@@ -199,6 +208,11 @@ spec:
199208 - "8000"
200209 - --time-to-first-token=${SIM_TTFT}
201210 - --inter-token-latency=${SIM_ITL}
211+ $( [ " ${SCENARIO} " = " 5" ] && cat << FAKEARGS
212+ - --fake-metrics
213+ - '{"kv-cache-usage": 0, "waiting-requests": 0, "running-requests": 0}'
214+ FAKEARGS
215+ )
202216 ports:
203217 - containerPort: 8000
204218 name: modelserver
@@ -229,6 +243,14 @@ spec:
229243 name: http
230244EOF
231245
246+ # --- Scenario 5 sim mode: enable fake metrics on inference-sim ---
247+ if [ " ${SCENARIO} " = " 5" ]; then
248+ log " Enabling --fake-metrics on inference-sim for endpoint-scrape gate"
249+ ${K} -n " ${NAMESPACE} " patch deployment inference-sim --type=json \
250+ -p=' [{"op":"add","path":"/spec/template/spec/containers/0/args/-","value":"--fake-metrics"},{"op":"add","path":"/spec/template/spec/containers/0/args/-","value":"{\"kv-cache-usage\": 0, \"waiting-requests\": 0, \"running-requests\": 0}"}]' > /dev/null
251+ ${K} -n " ${NAMESPACE} " rollout status deployment/inference-sim --timeout=120s > /dev/null
252+ fi
253+
232254 # --- Scenarios 3/4 sim mode: deploy GIE EPP ---
233255 if [ " ${SCENARIO} " = " 3" ] || [ " ${SCENARIO} " = " 4" ]; then
234256 log " Deploying GIE EPP (sim mode, scenario ${SCENARIO} )"
@@ -500,6 +522,11 @@ if [ -n "${VALUES_FILE}" ]; then
500522 --set-json " processor.config.globalInferenceGateway=null"
501523 --set-json " processor.config.modelGateways={\" ${MODEL} \" :{\" url\" :\" http://epp-bench-epp.${NAMESPACE} .svc.cluster.local:8081\" ,\" requestTimeout\" :\" 5m\" ,\" maxRetries\" :3,\" initialBackoff\" :\" 2s\" ,\" maxBackoff\" :\" 30s\" ,\" inferenceObjective\" :\" batch-sheddable\" }}"
502524 )
525+ elif [ " ${SCENARIO} " = " 5" ]; then
526+ # Scenario 5: async dispatch — use inferencePoolName to match async-processor queue name
527+ BG_EXTRA_ARGS+=(
528+ --set-json " processor.config.modelGateways={\" ${MODEL} \" :{\" inferencePoolName\" :\" sim-pool\" }}"
529+ )
503530 else
504531 # Other scenarios: direct to inference-sim
505532 BG_EXTRA_ARGS+=(
@@ -508,7 +535,7 @@ if [ -n "${VALUES_FILE}" ]; then
508535 fi
509536 fi
510537
511- ${H} install batch-gateway \
538+ ${H} upgrade -- install batch-gateway \
512539 " ${REPO_ROOT} /charts/batch-gateway/" \
513540 -n " ${NAMESPACE} " \
514541 -f " ${VALUES_FILE} " \
554581
555582# --- Scenario 5: Async processor ---
556583if [ " ${SCENARIO} " = " 5" ]; then
557- log " ERROR: Scenario 5 (async) is blocked on async-processor integration"
558- log " Skipping async-processor deployment"
584+ log " Deploying async-processor (scenario 5)"
585+
586+ # Determine pool name and URLs for queue coordination
587+ if [ " ${MODE} " = " sim" ]; then
588+ ASYNC_POOL_NAME=" sim-pool"
589+ ASYNC_IGW_URL=" http://inference-sim.${NAMESPACE} .svc.cluster.local:8000"
590+ ASYNC_METRICS_URL=" http://inference-sim.${NAMESPACE} .svc.cluster.local:8000/metrics"
591+ else
592+ ASYNC_POOL_NAME=" ${GUIDE_NAME} "
593+ ASYNC_IGW_URL=" http://vllm-metrics.${NAMESPACE} .svc.cluster.local:8000"
594+ ASYNC_METRICS_URL=" http://vllm-metrics.${NAMESPACE} .svc.cluster.local:8000/metrics"
595+
596+ # Create a Service for the vLLM decode deployment (endpoint-scrape needs it)
597+ log " Creating vLLM metrics Service"
598+ ${K} -n " ${NAMESPACE} " apply -f - << EOVLLMSVC
599+ apiVersion: v1
600+ kind: Service
601+ metadata:
602+ name: vllm-metrics
603+ spec:
604+ selector:
605+ llm-d.ai/role: decode
606+ ports:
607+ - port: 8000
608+ targetPort: 8000
609+ name: http
610+ EOVLLMSVC
611+ fi
612+
613+ DISPATCHER_IMAGE_REPO=" $( echo " ${DISPATCHER_IMAGE} " | cut -d: -f1) "
614+ DISPATCHER_IMAGE_TAG=" $( echo " ${DISPATCHER_IMAGE} " | cut -d: -f2) "
615+
616+ ${H} upgrade --install async-processor " ${DISPATCHER_CHART} " \
617+ --version " ${DISPATCHER_CHART_VERSION} " \
618+ -n " ${NAMESPACE} " \
619+ --set " ap.image.repository=${DISPATCHER_IMAGE_REPO} " \
620+ --set " ap.image.tag=${DISPATCHER_IMAGE_TAG} " \
621+ --set ap.messageQueueImpl=redis-sortedset \
622+ --set ap.concurrency=1 \
623+ --set ap.redis.enabled=true \
624+ --set " ap.redis.url=redis://redis-master.${NAMESPACE} .svc.cluster.local:6379" \
625+ --set ap.redis.pollIntervalMs=500 \
626+ --set ap.redis.batchSize=10 \
627+ --set-json " ap.redis.queuesConfig=[{\" queue_name\" :\" llm-d-async:requests:${ASYNC_POOL_NAME} \" ,\" result_queue_name\" :\" llm-d-async:results:${ASYNC_POOL_NAME} \" ,\" request_path_url\" :\" /v1/chat/completions\" ,\" igw_base_url\" :\" ${ASYNC_IGW_URL} \" ,\" gate_type\" :\" endpoint-scrape\" ,\" gate_params\" :{\" url\" :\" ${ASYNC_METRICS_URL} \" ,\" metric\" :\" vllm:num_requests_waiting\" ,\" max_count_per_pod\" :\" 5\" ,\" fallback\" :\" 1.0\" }}]" \
628+ --set ap.modelServerMonitor.enabled=false \
629+ --set ap.metrics.enabled=true \
630+ --set ap.metrics.port=9091 \
631+ --set ap.metrics.secure=false \
632+ --wait --timeout=120s > /dev/null
633+
634+ log " Waiting for async-processor to be ready..."
635+ ${K} -n " ${NAMESPACE} " wait --for=condition=available deployment/async-processor --timeout=120s > /dev/null
636+ log " Async-processor deployed (pool: ${ASYNC_POOL_NAME} , gate: endpoint-scrape)"
559637fi
560638
561639if [ -n " ${VALUES_FILE} " ]; then
0 commit comments