Skip to content

Commit 9df6f64

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

File tree

6 files changed

+108
-11
lines changed

6 files changed

+108
-11
lines changed

.github/workflows/release.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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: Cache Docker layers
23+
uses: actions/cache@v4
24+
with:
25+
path: /tmp/.buildx-cache
26+
key: ${{ runner.os }}-docker-buildx-${{ github.sha }}
27+
restore-keys: |
28+
${{ runner.os }}-docker-buildx-
29+
30+
- name: Set up QEMU
31+
uses: docker/setup-qemu-action@v3
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Extract tag name (version)
37+
id: extract_tag
38+
run: echo "tag=${GITHUB_REF##*/}" >> "$GITHUB_OUTPUT"
39+
40+
- name: Login to GitHub Container Registry
41+
uses: docker/login-action@v3
42+
with:
43+
registry: ghcr.io
44+
username: ${{ github.actor }}
45+
password: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: Build and push Docker image
48+
uses: docker/build-push-action@v5
49+
with:
50+
context: .
51+
file: ./build/Dockerfile
52+
push: true
53+
platforms: linux/amd64,linux/arm64
54+
tags: |
55+
ghcr.io/${{ github.repository }}:${{ steps.extract_tag.outputs.tag }}
56+
ghcr.io/${{ github.repository }}:latest
57+
cache-from: type=local,src=/tmp/.buildx-cache
58+
cache-to: type=local,dest=/tmp/.buildx-cache-new
59+
60+
- name: Move Docker Build Cache
61+
run: |
62+
rm -rf /tmp/.buildx-cache
63+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache || true
64+
65+
- name: Install Helm
66+
run: |
67+
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
68+
69+
- name: Update chart version
70+
run: |
71+
TAG=$(echo ${{ steps.extract_tag.outputs.tag }} | sed 's/^v//')
72+
sed -i "s/VERSION/${TAG}/g" charts/${CHART_NAME}/Chart.yaml
73+
74+
- name: Helm registry login
75+
run: |
76+
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin
77+
78+
- name: Helm package chart
79+
run: |
80+
helm package charts/${CHART_NAME} --destination .
81+
82+
- name: Helm push chart to GHCR
83+
run: |
84+
CHART_VERSION=$(yq e '.version' charts/${CHART_NAME}/Chart.yaml)
85+
CHART_PKG=${CHART_NAME}-${CHART_VERSION}.tgz
86+
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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM golang:1.24 AS builder
2+
WORKDIR /app
3+
COPY . .
4+
RUN make release
5+
6+
FROM ubuntu:24.04
7+
COPY --from=builder /app/model-csi-driver /usr/bin/model-csi-driver
8+
ENTRYPOINT ["/usr/bin/model-csi-driver"]

charts/model-csi-driver/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.0
18+
version: "0.1.0"
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

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)