Skip to content

Commit 8a6f39d

Browse files
committed
ci: add release pipeline and getting-started doc
Signed-off-by: imeoer <[email protected]>
1 parent a502f37 commit 8a6f39d

File tree

7 files changed

+114
-29
lines changed

7 files changed

+114
-29
lines changed

.github/workflows/e2e.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ jobs:
1818
- name: Checkout code
1919
uses: actions/checkout@v4
2020

21-
- name: Cache Go modules
22-
uses: actions/cache@v4
23-
with:
24-
path: |
25-
~/.cache/go-build
26-
~/go/pkg/mod
27-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
28-
restore-keys: |
29-
${{ runner.os }}-go-
30-
3121
- name: Cache Docker layers
3222
uses: actions/cache@v4
3323
with:
@@ -46,7 +36,7 @@ jobs:
4636
uses: docker/build-push-action@v5
4737
with:
4838
context: .
49-
file: build/Dockerfile.test
39+
file: build/Dockerfile
5040
build-args: |
5141
HOME=${{ env.HOME }}
5242
tags: model-csi-driver:latest

.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.
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
# syntax=docker/dockerfile:1.4
2+
13
FROM golang:1.24 AS builder
24
WORKDIR /app
3-
45
COPY . .
5-
RUN --mount=type=cache,target=$HOME/.cache/go-build \
6-
--mount=type=cache,target=$HOME/go/pkg/mod \
6+
RUN --mount=type=cache,target=/go/pkg/mod \
7+
--mount=type=cache,target=/root/.cache/go-build \
78
make release
89

910
FROM ubuntu:24.04

charts/model-csi-driver/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ 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: "VERSION"
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
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "0.1.0"
24+
appVersion: "VERSION"

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: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ The Model CSI Driver enables efficient deployment of model in Kubernetes by:
1414

1515
Before getting started, ensure you have:
1616

17-
- Kubernetes cluster (v1.20+)
18-
- `kubectl` configured to access your cluster
17+
- `kubectl` configured to access your Kubernetes cluster
1918
- Helm v3.x (recommended for installation)
20-
- Container runtime with CSI support (containerd, CRI-O)
2119

2220
## Installation
2321

@@ -37,18 +35,25 @@ config:
3735
# Root working directory for model storage and metadata,
3836
# must be writable and have enough disk space for model storage
3937
rootDir: /var/lib/model-csi
38+
# Configuration for private registry auth
4039
registryAuths:
4140
# Registry host:port
4241
registry.example.com:
4342
# Based64 encoded username:password
4443
auth: dXNlcm5hbWU6cGFzc3dvcmQ=
4544
# Registry server scheme, http or https
4645
serverscheme: https
46+
image:
47+
# Model csi driver daemonset image
48+
repository: ghcr.io/modelpack/model-csi-driver
49+
pullPolicy: IfNotPresent
50+
tag: latest
4751
```
4852
4953
3. Install the driver using Helm:
5054
```bash
51-
helm install model-csi-driver ./charts/model-csi-driver \
55+
helm upgrade --install model-csi-driver \
56+
oci://ghcr.io/imeoer/charts/model-csi-driver \
5257
--namespace model-csi \
5358
--create-namespace \
5459
-f values-custom.yaml
@@ -61,6 +66,10 @@ kubectl get pods -n model-csi
6166

6267
## Basic Usage
6368

69+
### Create model artifact with modctl
70+
71+
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.
72+
6473
### Create a Pod with Model Volume
6574

6675
The Model CSI Driver uses inline volumes directly in pod specifications. Here's a basic example:
@@ -84,7 +93,7 @@ spec:
8493
csi:
8594
driver: model.csi.modelpack.org
8695
volumeAttributes:
87-
modelRef: "registry.example.com/models/bert-base:latest"
96+
modelRef: "registry.example.com/models/qwen3-0.6b:latest"
8897
```
8998
9099
## Troubleshooting

0 commit comments

Comments
 (0)