Skip to content

Commit 0ed2358

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

File tree

8 files changed

+132
-62
lines changed

8 files changed

+132
-62
lines changed

.github/workflows/e2e.yml

Lines changed: 3 additions & 17 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:
@@ -36,21 +26,16 @@ jobs:
3626
restore-keys: |
3727
${{ runner.os }}-docker-buildx-
3828
39-
- name: Set up QEMU
40-
uses: docker/setup-qemu-action@v3
41-
4229
- name: Set up Docker Buildx
4330
uses: docker/setup-buildx-action@v3
4431

4532
- name: Build Docker Image
4633
uses: docker/build-push-action@v5
4734
with:
4835
context: .
49-
file: build/Dockerfile.test
50-
build-args: |
51-
HOME=${{ env.HOME }}
36+
file: ./build/Dockerfile
37+
platforms: linux/amd64,linux/arm64
5238
tags: model-csi-driver:latest
53-
load: true
5439
push: false
5540
cache-from: type=local,src=/tmp/.buildx-cache
5641
cache-to: type=local,dest=/tmp/.buildx-cache-new
@@ -90,6 +75,7 @@ jobs:
9075
9176
- name: Deploy model-csi-driver chart
9277
run: |
78+
sed -i "s/VERSION/0.1.0/g" charts/model-csi-driver/Chart.yaml
9379
helm upgrade --install model-csi-driver ./charts/model-csi-driver --namespace model-csi --create-namespace
9480
9581
- name: Wait for model-csi-driver pods to be ready

.github/workflows/release.yml

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

build/Dockerfile.test

Lines changed: 0 additions & 11 deletions
This file was deleted.

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: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@ config:
66
# Unique service identifier of CSI registration
77
serviceName: model.csi.modelpack.org
88
# Root working directory for model storage and metadata,
9-
# must be writable and have enough disk space for model storage
9+
# must be writable and have enough disk space
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: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,66 +4,69 @@ Model CSI Driver is a Kubernetes CSI driver for serving OCI model artifacts, whi
44

55
## Overview
66

7-
The Model CSI Driver enables efficient deployment of model in Kubernetes by:
7+
The Model CSI Driver simplifies and accelerates model deployment in Kubernetes by:
88

9-
- Easily mount model artifact as volume into pod
10-
- Compatibility with older Kubernetes versions
11-
- Natively supports P2P accelerated distribution
9+
- Seamlessly mount model artifacts as volumes into pod
10+
- Compatible with older Kubernetes versions
11+
- Natively supports P2P-accelerated distribution
1212

1313
## Prerequisites
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

2422
### Helm Installation
2523

26-
1. Clone the repository:
27-
```bash
28-
git clone https://github.com/your-org/model-csi-driver.git
29-
cd model-csi-driver
30-
```
31-
32-
2. Create custom configuration:
24+
1. Create custom configuration:
3325

3426
```yaml
3527
# values-custom.yaml
3628
config:
3729
# Root working directory for model storage and metadata,
38-
# must be writable and have enough disk space for model storage
30+
# must be writable and have enough disk space
3931
rootDir: /var/lib/model-csi
32+
# Configuration for private registry auth
4033
registryAuths:
4134
# Registry host:port
4235
registry.example.com:
4336
# Based64 encoded username:password
4437
auth: dXNlcm5hbWU6cGFzc3dvcmQ=
4538
# Registry server scheme, http or https
4639
serverscheme: https
40+
image:
41+
# Model csi driver daemonset image
42+
repository: ghcr.io/modelpack/model-csi-driver
43+
pullPolicy: IfNotPresent
44+
tag: latest
4745
```
4846
49-
3. Install the driver using Helm:
47+
2. Install the driver using Helm:
5048
```bash
51-
helm install model-csi-driver ./charts/model-csi-driver \
49+
helm upgrade --install model-csi-driver \
50+
oci://ghcr.io/modelpack/charts/model-csi-driver \
5251
--namespace model-csi \
5352
--create-namespace \
5453
-f values-custom.yaml
5554
```
5655

57-
4. Verify the installation:
56+
3. Verify the installation:
5857
```bash
5958
kubectl get pods -n model-csi
6059
```
6160

6261
## Basic Usage
6362

63+
### Create Model Artifact with modctl
64+
65+
Follow the [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.
66+
6467
### Create a Pod with Model Volume
6568

66-
The Model CSI Driver uses inline volumes directly in pod specifications. Here's a basic example:
69+
The Model CSI Driver uses inline volume directly in pod spec, here's a basic example:
6770

6871
```yaml
6972
apiVersion: v1
@@ -84,14 +87,12 @@ spec:
8487
csi:
8588
driver: model.csi.modelpack.org
8689
volumeAttributes:
87-
modelRef: "registry.example.com/models/bert-base:latest"
90+
modelRef: "registry.example.com/models/qwen3-0.6b:latest"
8891
```
8992
9093
## Troubleshooting
9194
92-
### Common Issues
93-
94-
**Pod stuck in Pending or ContainerCreating**
95+
### Pod stuck in Pending or ContainerCreating
9596
```bash
9697
# Describe a pod with issues
9798
kubectl describe pod <pod-name>

0 commit comments

Comments
 (0)