-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (82 loc) · 3.16 KB
/
Copy pathcd.yml
File metadata and controls
87 lines (82 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: CD
on:
workflow_run:
workflows: [CI]
types: [completed]
workflow_dispatch:
inputs:
ref:
description: Commit SHA to package
required: true
type: string
permissions:
contents: read
jobs:
release-artifact:
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_branch == 'main' &&
github.event.workflow_run.event == 'push')
runs-on: ubuntu-latest
env:
RELEASE_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.event.workflow_run.head_sha }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ env.RELEASE_REF }}
- uses: docker/setup-buildx-action@v4
- uses: docker/build-push-action@v7
with:
context: .
outputs: type=oci,dest=${{ runner.temp }}/local-llm-router.tar
tags: local-llm-router:${{ env.RELEASE_REF }}
- uses: actions/upload-artifact@v7
with:
name: local-llm-router-${{ env.RELEASE_REF }}
path: ${{ runner.temp }}/local-llm-router.tar
retention-days: 14
deployment-plan:
# Renders the deployment topology and the canary plan that names its own
# rollback target. Applying to a cluster stays disabled until a deployment
# destination is configured; nothing here contacts a live environment.
needs: release-artifact
runs-on: ubuntu-latest
env:
RELEASE_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.event.workflow_run.head_sha }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ env.RELEASE_REF }}
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- run: python -m pip install --upgrade pip
- run: python -m pip install -e ".[dev]"
- name: Verify the serving configuration matches the catalog
run: python -m llm_router.serving > /tmp/ray-serve.yaml && diff -u config/ray-serve.yaml /tmp/ray-serve.yaml
- name: Render the canary and rollback plan
run: |
python - <<'PY' > canary-plan.json
import json
from llm_router.registry import load_registry
from llm_router.serving import canary_config
registry = load_registry("config/registry.yaml")
production = [item for item in registry.deployments if item.stage.value == "production"]
plan = canary_config(registry, production[0].id)
plan["release_ref"] = "${{ env.RELEASE_REF }}"
print(json.dumps(plan, indent=2))
PY
- name: Validate the Kubernetes manifests
run: |
curl -sSLo kubeconform.tar.gz https://github.com/yannh/kubeconform/releases/download/v0.7.0/kubeconform-linux-amd64.tar.gz
tar xf kubeconform.tar.gz kubeconform
./kubeconform -strict -ignore-missing-schemas -summary deploy/kubernetes
- uses: actions/upload-artifact@v7
with:
name: deployment-plan-${{ env.RELEASE_REF }}
path: |
canary-plan.json
config/ray-serve.yaml
deploy/kubernetes
retention-days: 14