Skip to content

Commit 0ceffae

Browse files
committed
ci: add release pipeline and getting-started doc
Signed-off-by: imeoer <yansong.ys@antgroup.com>
1 parent a502f37 commit 0ceffae

File tree

5 files changed

+90
-10
lines changed

5 files changed

+90
-10
lines changed

.github/workflows/release.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
env:
15+
REGISTRY: ghcr.io
16+
IMAGE_NAME: ${{ github.repository }}
17+
CHART_NAME: model-csi-driver
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v3
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Extract tag name (version)
29+
id: extract_tag
30+
run: echo "tag=${GITHUB_REF##*/}" >> "$GITHUB_OUTPUT"
31+
32+
- name: Login to GitHub Container Registry
33+
uses: docker/login-action@v3
34+
with:
35+
registry: ghcr.io
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Build and push Docker image
40+
uses: docker/build-push-action@v5
41+
with:
42+
context: .
43+
file: ./build/Dockerfile
44+
push: true
45+
tags: |
46+
ghcr.io/${{ github.repository }}:${{ steps.extract_tag.outputs.tag }}
47+
ghcr.io/${{ github.repository }}:latest
48+
49+
- name: Install Helm
50+
run: |
51+
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
52+
53+
- name: Update chart version
54+
run: |
55+
TAG=$(echo ${{ steps.extract_tag.outputs.tag }} | sed 's/^v//')
56+
sed -i "s/^$TAG$/version: ${TAG}/" charts/${CHART_NAME}/Chart.yaml
57+
58+
- name: Helm registry login
59+
run: |
60+
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin
61+
62+
- name: Helm package chart
63+
run: |
64+
helm package charts/${CHART_NAME} --destination .
65+
66+
- name: Helm push chart to GHCR
67+
run: |
68+
CHART_VERSION=$(yq e '.version' charts/${CHART_NAME}/Chart.yaml)
69+
CHART_PKG=${CHART_NAME}-${CHART_VERSION}.tgz
70+
helm push $CHART_PKG oci://ghcr.io/${{ github.repository_owner }}/charts

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Model CSI Driver
22

3-
**Status**: 🚧 This project is actively developed, the CI setup and documentation are still in progress.
4-
53
Model CSI Driver is a Kubernetes CSI driver for serving OCI model artifacts, which are bundled based on [Model Spec](https://github.com/modelpack/model-spec).
64

5+
## Documentation
6+
7+
You can find the full documentation on the [getting started](./docs/getting-started.md).
8+
79
## Copyright
810

911
Copyright © contributors to ModelPack, established as ModelPack a Series of LF Projects, LLC.

build/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM golang:1.24 AS builder
2+
WORKDIR /app
3+
COPY . .
4+
5+
FROM ubuntu:24.04
6+
COPY --from=builder /app/model-csi-driver /usr/bin/model-csi-driver
7+
ENTRYPOINT ["/usr/bin/model-csi-driver"]

charts/model-csi-driver/values.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ config:
99
# must be writable and have enough disk space for model storage
1010
rootDir: /var/lib/model-csi
1111
registryAuths:
12-
# Registry host:port
13-
registry.example.com:
14-
# Based64 encoded username:password
15-
auth: dXNlcm5hbWU6cGFzc3dvcmQ=
16-
# Registry server scheme, http or https
17-
serverscheme: https
12+
# registry.example.com:
13+
# auth: dXNlcm5hbWU6cGFzc3dvcmQ=
14+
# serverscheme: https
1815

1916
namespace: model-csi
2017

docs/getting-started.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ config:
4848
4949
3. Install the driver using Helm:
5050
```bash
51-
helm install model-csi-driver ./charts/model-csi-driver \
51+
helm upgrade --install model-csi-driver ./charts/model-csi-driver \
5252
--namespace model-csi \
5353
--create-namespace \
5454
-f values-custom.yaml
@@ -61,6 +61,10 @@ kubectl get pods -n model-csi
6161

6262
## Basic Usage
6363

64+
### Create model artifact with modctl
65+
66+
Follow [guide](https://github.com/modelpack/modctl/blob/main/docs/getting-started.md) to build and push a model artifact to an OCI distribution-compatible registry.
67+
6468
### Create a Pod with Model Volume
6569

6670
The Model CSI Driver uses inline volumes directly in pod specifications. Here's a basic example:
@@ -84,7 +88,7 @@ spec:
8488
csi:
8589
driver: model.csi.modelpack.org
8690
volumeAttributes:
87-
modelRef: "registry.example.com/models/bert-base:latest"
91+
modelRef: "registry.example.com/models/qwen3-0.6b:latest"
8892
```
8993
9094
## Troubleshooting

0 commit comments

Comments
 (0)