ai-ml/gke-ray/rayserve/gradio.yaml (41 lines of code) (raw):
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# [START gke_ai_ml_gke_ray_rayserve_gradio]
apiVersion: apps/v1
kind: Deployment
metadata:
name: gradio
labels:
app: gradio
spec:
replicas: 1
selector:
matchLabels:
app: gradio
template:
metadata:
labels:
app: gradio
spec:
containers:
- name: gradio
image: us-docker.pkg.dev/google-samples/containers/gke/gradio-app:v1.0.4
env:
- name: MODEL_ID
value: "meta-llama/Llama-2-7b-chat-hf"
- name: CONTEXT_PATH
value: "/v1/chat/completions"
- name: HOST
value: "http://rayllm-serve-svc:8000"
ports:
- containerPort: 7860
---
apiVersion: v1
kind: Service
metadata:
name: gradio
spec:
selector:
app: gradio
ports:
- protocol: TCP
port: 80
targetPort: 7860
type: LoadBalancer
# [END gke_ai_ml_gke_ray_rayserve_gradio]