Skip to content

Commit 68250d2

Browse files
authored
[misc] patch ci and doc for helm charts (#75)
1 parent 061b04b commit 68250d2

3 files changed

Lines changed: 310 additions & 3 deletions

File tree

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Publish Helm Charts to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'charts/**'
9+
release:
10+
types: [published]
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: write
15+
pages: write
16+
id-token: write
17+
18+
jobs:
19+
publish-charts:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Setup Helm
28+
uses: azure/setup-helm@v4
29+
with:
30+
version: 'latest'
31+
32+
- name: Configure Git
33+
run: |
34+
git config user.name "$GITHUB_ACTOR"
35+
git config user.email "[email protected]"
36+
37+
- name: Prepare charts directory
38+
run: |
39+
mkdir -p .charts-repo
40+
41+
# If this is a release, update versions
42+
if [[ "${{ github.event_name }}" == "release" ]]; then
43+
VERSION="${{ github.event.release.tag_name }}"
44+
VERSION="${VERSION#v}" # Remove 'v' prefix
45+
46+
for chart in charts/*/; do
47+
yq eval -i ".version = \"${VERSION}\"" "${chart}Chart.yaml"
48+
yq eval -i ".appVersion = \"${VERSION}\"" "${chart}Chart.yaml"
49+
done
50+
fi
51+
52+
- name: Package charts
53+
run: |
54+
for chart in charts/*/; do
55+
helm package "${chart}" -d .charts-repo
56+
done
57+
58+
- name: Checkout gh-pages branch
59+
run: |
60+
git fetch origin gh-pages || true
61+
git checkout gh-pages || git checkout --orphan gh-pages
62+
63+
# Clean everything except charts directory
64+
find . -mindepth 1 -maxdepth 1 ! -name '.git' ! -name '.charts-repo' -exec rm -rf {} +
65+
66+
# Create charts directory if it doesn't exist
67+
mkdir -p charts
68+
69+
- name: Update Helm repository
70+
run: |
71+
# Copy new charts
72+
cp .charts-repo/*.tgz charts/ || true
73+
74+
# Generate index.yaml
75+
helm repo index charts --url https://sgl-project.github.io/ome/charts
76+
77+
# Also create an index at root for backward compatibility
78+
cp charts/index.yaml .
79+
80+
- name: Create simple index.html
81+
run: |
82+
cat > index.html << 'EOF'
83+
<!DOCTYPE html>
84+
<html>
85+
<head>
86+
<title>OME Helm Charts</title>
87+
<style>
88+
body { font-family: Arial, sans-serif; margin: 40px; }
89+
h1 { color: #333; }
90+
.instructions { background: #f4f4f4; padding: 20px; border-radius: 5px; }
91+
code { background: #e8e8e8; padding: 2px 5px; border-radius: 3px; }
92+
pre { background: #333; color: #fff; padding: 15px; border-radius: 5px; overflow-x: auto; }
93+
</style>
94+
</head>
95+
<body>
96+
<h1>OME Helm Charts Repository</h1>
97+
<p>This is the official Helm charts repository for OME (Oracle Machine Learning Engine).</p>
98+
99+
<div class="instructions">
100+
<h2>Installation Instructions</h2>
101+
<pre>
102+
# Add the OME Helm repository
103+
helm repo add ome https://sgl-project.github.io/ome
104+
helm repo update
105+
106+
# Install OME CRDs
107+
helm install ome-crd ome/ome-crd --namespace ome --create-namespace
108+
109+
# Install OME resources
110+
helm install ome ome/ome-resources --namespace ome</pre>
111+
</div>
112+
113+
<h2>Available Charts</h2>
114+
<ul>
115+
<li><a href="charts/">Browse all charts</a></li>
116+
<li><a href="charts/index.yaml">Helm repository index</a></li>
117+
</ul>
118+
119+
<h2>Documentation</h2>
120+
<p>For more information, visit the <a href="https://sgl-project.github.io/ome/docs/">OME documentation</a>.</p>
121+
</body>
122+
</html>
123+
EOF
124+
125+
- name: Commit and push changes
126+
run: |
127+
git add .
128+
git commit -m "Update Helm charts repository" || echo "No changes to commit"
129+
git push origin gh-pages
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
name: Update Release Images
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: 'Tag to update images to (e.g., v0.1.0)'
10+
required: true
11+
type: string
12+
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
17+
jobs:
18+
update-images:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
ref: main
26+
27+
- name: Setup Go
28+
uses: actions/setup-go@v5
29+
with:
30+
go-version: '1.24.1'
31+
32+
- name: Install yq
33+
uses: mikefarah/yq@v4
34+
35+
- name: Determine version
36+
id: version
37+
run: |
38+
if [[ "${{ github.event_name }}" == "release" ]]; then
39+
TAG="${{ github.event.release.tag_name }}"
40+
else
41+
TAG="${{ inputs.tag }}"
42+
fi
43+
echo "tag=${TAG}" >> $GITHUB_OUTPUT
44+
echo "📦 Updating images to version: ${TAG}"
45+
46+
- name: Update config patches
47+
run: |
48+
TAG="${{ steps.version.outputs.tag }}"
49+
50+
# Update manager deployment patch
51+
cat > config/default/manager_image_patch.yaml << EOF
52+
apiVersion: apps/v1
53+
kind: Deployment
54+
metadata:
55+
name: ome-controller-manager
56+
namespace: ome
57+
spec:
58+
template:
59+
spec:
60+
containers:
61+
- name: manager
62+
image: ghcr.io/moirai-internal/ome-manager:${TAG}
63+
EOF
64+
65+
# Update model agent daemonset patch
66+
cat > config/default/model_agent_image_patch.yaml << EOF
67+
apiVersion: apps/v1
68+
kind: DaemonSet
69+
metadata:
70+
name: ome-model-agent-daemonset
71+
namespace: ome
72+
spec:
73+
template:
74+
spec:
75+
containers:
76+
- name: model-agent
77+
image: ghcr.io/moirai-internal/model-agent:${TAG}
78+
EOF
79+
80+
- name: Update Helm chart values
81+
run: |
82+
TAG="${{ steps.version.outputs.tag }}"
83+
84+
# Update the defaultVersion at the top
85+
yq eval -i '.ome.version = "'${TAG}'"' charts/ome-resources/values.yaml
86+
87+
# Update specific component images
88+
yq eval -i '.ome.multinodeProber.tag = "'${TAG}'"' charts/ome-resources/values.yaml
89+
yq eval -i '.ome.controller.tag = "'${TAG}'"' charts/ome-resources/values.yaml
90+
yq eval -i '.ome.omeAgent.tag = "'${TAG}'"' charts/ome-resources/values.yaml
91+
yq eval -i '.modelAgent.image.tag = "'${TAG}'"' charts/ome-resources/values.yaml
92+
93+
# Update the controller image to use the new namespace format
94+
yq eval -i '.ome.controller.image = "ghcr.io/moirai-internal/ome-manager"' charts/ome-resources/values.yaml
95+
96+
echo "✅ Updated Helm chart values"
97+
98+
- name: Update Chart.yaml versions
99+
run: |
100+
VERSION="${{ steps.version.outputs.tag }}"
101+
VERSION="${VERSION#v}" # Remove 'v' prefix if present
102+
103+
# Update all Chart.yaml files
104+
for chart in charts/*/; do
105+
if [[ -f "${chart}Chart.yaml" ]]; then
106+
yq eval -i ".version = \"${VERSION}\"" "${chart}Chart.yaml"
107+
yq eval -i ".appVersion = \"${VERSION}\"" "${chart}Chart.yaml"
108+
echo "✅ Updated ${chart}Chart.yaml"
109+
fi
110+
done
111+
112+
- name: Validate changes
113+
run: |
114+
echo "📋 Changes made:"
115+
echo ""
116+
echo "Config patches:"
117+
ls -la config/default/*_image_patch.yaml || true
118+
echo ""
119+
echo "Helm values changes:"
120+
git diff charts/ome-resources/values.yaml || true
121+
echo ""
122+
echo "Chart.yaml changes:"
123+
git diff charts/*/Chart.yaml || true
124+
125+
- name: Create Pull Request
126+
uses: peter-evans/create-pull-request@v6
127+
with:
128+
token: ${{ secrets.GITHUB_TOKEN }}
129+
commit-message: |
130+
[Release] Update images to ${{ steps.version.outputs.tag }}
131+
132+
- Update config patches for manager and model-agent
133+
- Update Helm chart default image tags
134+
- Update Chart.yaml versions
135+
136+
Auto-generated by release workflow
137+
branch: update-images-${{ steps.version.outputs.tag }}
138+
delete-branch: true
139+
title: "[Release] Update images to ${{ steps.version.outputs.tag }}"
140+
body: |
141+
## 🚀 Release Image Update
142+
143+
This PR automatically updates all image references to version `${{ steps.version.outputs.tag }}`.
144+
145+
### Changes made:
146+
- ✅ Updated config patches for kustomize deployments
147+
- ✅ Updated Helm chart image tags in values.yaml
148+
- ✅ Updated Chart.yaml versions
149+
150+
### Components updated:
151+
- ome-manager
152+
- model-agent
153+
- multinode-prober
154+
- ome-agent
155+
156+
Please review and merge this PR to ensure `make install` uses the latest release images.
157+
158+
---
159+
*This PR was automatically generated by the release workflow.*
160+
labels: |
161+
release
162+
automated
163+
assignees: ${{ github.actor }}

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,26 @@ To install OME in your cluster using Helm:
4949

5050
```bash
5151
# Add the OME Helm repository
52-
helm repo add ome https://sgl-project.github.io/ome/charts
52+
helm repo add ome https://sgl-project.github.io/ome
5353
helm repo update
5454

55-
# Install OME
56-
helm install ome ome/ome --namespace ome --create-namespace
55+
# Install OME CRDs first
56+
helm install ome-crd ome/ome-crd --namespace ome --create-namespace
57+
58+
# Install OME resources
59+
helm install ome ome/ome-resources --namespace ome
60+
```
61+
62+
For installation from source:
63+
64+
```bash
65+
# Clone the repository
66+
git clone https://github.com/sgl-project/ome.git
67+
cd ome
68+
69+
# Install from local charts
70+
helm install ome-crd charts/ome-crd --namespace ome --create-namespace
71+
helm install ome charts/ome-resources --namespace ome
5772
```
5873

5974
Read the [installation guide](https://sgl-project.github.io/ome/docs/installation/) for more options and advanced configurations.

0 commit comments

Comments
 (0)