-
Notifications
You must be signed in to change notification settings - Fork 29
168 lines (151 loc) · 5.26 KB
/
Copy pathe2e.yml
File metadata and controls
168 lines (151 loc) · 5.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: E2E Test
on:
push:
branches: [main, release-*]
paths-ignore: ["**.md", "**.png", "**.jpg", "**.svg", "**/docs/**"]
schedule:
- cron: "0 1 * * *"
workflow_dispatch:
inputs:
model:
description: "Model to test"
required: false
default: "Qwen/Qwen3-0.6B"
type: string
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
ORGANIZATION: ${{ github.repository_owner }}
MODEL: ${{ github.event.inputs.model || 'Qwen/Qwen3-0.6B' }}
MODEL_DIR: modctl-test-model
jobs:
build-modctl:
name: Build modctl
timeout-minutes: 60
runs-on: ubuntu-latest
env:
PACKAGE_DIR: modctl-test-package
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4.3.1
with:
submodules: recursive
- name: Install Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Create Cache Dir
run: |
mkdir -p ${{ env.PACKAGE_DIR }}
- name: Cache Package
id: cache-package
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ env.PACKAGE_DIR }}
key: modctl-test-packages
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y pkg-config
sudo DEBIAN_FRONTEND=noninteractive apt install -y build-essential \
cmake pkg-config libssl-dev libssh2-1-dev zlib1g-dev \
libhttp-parser-dev python3 wget tar git
mkdir -p ${{ env.PACKAGE_DIR }}
if [ ! -f "${{ env.PACKAGE_DIR }}/libgit2-v1.5.1.tar.gz" ]; then
wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.5.1.tar.gz -O ${{ env.PACKAGE_DIR }}/libgit2-v1.5.1.tar.gz
fi
tar -xzf ${{ env.PACKAGE_DIR }}/libgit2-v1.5.1.tar.gz
cd libgit2-1.5.1 && mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF
make -j$(nproc)
sudo make install
sudo ldconfig
env:
LIBGIT2_SYS_USE_PKG_CONFIG: "1"
- name: Build modctl
run: |
go build -tags "static system_libgit2 enable_libgit2"
- name: Upload modctl
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: modctl-artifact
path: modctl
download-model:
name: Download Model
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Cache model
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: cache-model
with:
path: ${{ env.MODEL_DIR }}
key: ${{env.MODEL_DIR}}-${{ env.MODEL }}
- name: Set up Python
if: steps.cache-model.outputs.cache-hit != 'true'
uses: actions/setup-python@4f41a90a1f38628c7ccc608d05fbafe701bc20ae # v6.1.0
with:
python-version: "3.10"
- name: Download HF Model
if: steps.cache-model.outputs.cache-hit != 'true'
run: |
pip install 'huggingface_hub'
hf auth login --token ${{ secrets.HF_TOKEN }}
hf download ${{ env.MODEL }} --local-dir ${{ env.MODEL_DIR }}
- name: Upload model
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: model-artifact
path: ${{ env.MODEL_DIR }}
test-modctl:
name: Run modctl test
timeout-minutes: 60
runs-on: ubuntu-latest
needs: [build-modctl, download-model]
steps:
- name: Download modctl artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: modctl-artifact
path: modctl
- name: Download model artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: model-artifact
path: ${{ env.MODEL_DIR }}
- name: Setup modctl
run: |
echo "Setting up modctl"
sudo cp modctl/modctl /bin/modctl
sudo chmod +x /bin/modctl
modctl version
modctl login -u ${{ github.actor }} \
-p ${{ secrets.GITHUB_TOKEN }} \
${{ env.REGISTRY }}
- name: Test modctl E2E
run: |
echo "generating modelfile for ${{ env.MODEL_DIR }}"
modctl modelfile generate \
--arch transformer \
--family qwen3 \
--format safetensors \
--param-size 0.6B \
.
echo "modelfile generated"
url=${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/${{ env.MODEL }}:latest
url_lower=$(echo "${url,,}")
echo "Building and pushing model to $url_lower"
modctl build -f Modelfile \
-t $url_lower \
--raw --output-remote --log-level debug \
.
echo "build/push completed"
mkdir download
echo "Pulling model from $url_lower"
modctl pull $url_lower \
--extract-dir download \
--log-level debug
echo "pull completed"