components/llm_service/skaffold.yaml (68 lines of code) (raw):
# Copyright 2023 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.
apiVersion: skaffold/v4beta1
kind: Config
metadata:
name: llm_service
# Requires the common image for shared data models or utils.
requires:
- configs:
- common_ml
path: ../common_ml
build:
artifacts:
- image: llm-service
sync:
infer:
- '**/*.py'
- '**/*.json'
docker:
cacheFrom:
- llm-service
- llm-service:latest
requires:
- image: common-ml
alias: COMMON_ML_IMAGE
googleCloudBuild: {}
# Portforwarding when running `skaffold dev` locally.
portForward:
- resourceType: service
resourceName: llm-service
port: 80
localPort: 9002 # Change this when adding other microservice.
profiles:
# Profile for building images locally.
- name: local_build
build:
artifacts:
- image: llm-service
sync:
infer:
- '**/*.py'
- '**/*.json'
tagPolicy:
gitCommit: {}
local:
concurrency: 0
# Profile for GKE deployment, building images via CloudBuild
- &gke-profile # YAML anchor used by "default" profile.
name: gke
manifests:
# Loading kustomize base file for deployment.
kustomize:
paths:
- ./kustomize/base
# Substitute system's environment vars to properties.rendered.env
hooks:
before:
- host:
dir: ./kustomize/base
command: ["sh", "-c",
"envsubst < properties.env > properties.rendered.env"]
after:
- host:
dir: ./kustomize/base
command: ["sh", "-c", "rm *.rendered.env"]
# Simple deployment using kubectl.
deploy:
kubectl: {}
# Profile for GKE Horizontal Pod Autoscaler.
# This profile only works with `gke` profile together.
# E.g. skaffold run -p gke,hpa
- name: gke-hpa
manifests:
kustomize:
paths:
- ./kustomize/hpa
# Simple deployment using kubectl.
deploy:
kubectl: {}
# The default-deploy profile refer to gke profile above.
- <<: *gke-profile
name: default-deploy