-
Notifications
You must be signed in to change notification settings - Fork 11
290 lines (245 loc) · 9.28 KB
/
Copy pathdocker-api-e2e.yml
File metadata and controls
290 lines (245 loc) · 9.28 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
name: Docker API E2E Tests
on:
# Disabled: GitHub Actions macos runners lack Virtualization.framework.
# Re-enable when a self-hosted Apple Silicon runner is available.
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
# Basic API tests that don't require VM
api-compatibility:
name: Docker API Compatibility
# GitHub-hosted, so no Virtualization.framework — fine for this job,
# which is the VM-free half. The comment above explains why the whole
# workflow stays dispatch-only until a self-hosted runner exists.
runs-on: macos-26
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Install Protobuf compiler
run: |
brew install protobuf
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build arcbox daemon
run: cargo build --release -p arcbox-daemon
- name: Start arcbox daemon
run: |
# Create test directories
mkdir -p /tmp/arcbox-e2e-data
# Start daemon in background (without VM support for basic API tests)
./target/release/arcbox-daemon \
--socket /tmp/arcbox-e2e.sock \
--data-dir /tmp/arcbox-e2e-data \
&
DAEMON_PID=$!
echo "DAEMON_PID=$DAEMON_PID" >> $GITHUB_ENV
# Wait for socket
for i in {1..30}; do
if [ -S /tmp/arcbox-e2e.sock ]; then
echo "Daemon started successfully"
break
fi
sleep 0.5
done
if [ ! -S /tmp/arcbox-e2e.sock ]; then
echo "Failed to start daemon"
exit 1
fi
- name: Test /_ping endpoint
run: |
response=$(curl -s --unix-socket /tmp/arcbox-e2e.sock http://localhost/_ping)
echo "Response: $response"
echo "$response" | grep -q "OK" || exit 1
- name: Test /version endpoint
run: |
response=$(curl -s --unix-socket /tmp/arcbox-e2e.sock http://localhost/version)
echo "Response: $response"
echo "$response" | jq .
echo "$response" | jq -e '.ApiVersion' || exit 1
- name: Test /info endpoint
run: |
response=$(curl -s --unix-socket /tmp/arcbox-e2e.sock http://localhost/info)
echo "Response: $response"
echo "$response" | jq .
echo "$response" | jq -e '.ServerVersion' || exit 1
- name: Test /v1.43/containers/json endpoint
run: |
response=$(curl -s --unix-socket /tmp/arcbox-e2e.sock "http://localhost/v1.43/containers/json")
echo "Response: $response"
echo "$response" | jq .
# Should return an empty array or array of containers
echo "$response" | jq -e 'type == "array"' || exit 1
- name: Test /v1.43/containers/json?all=true endpoint
run: |
response=$(curl -s --unix-socket /tmp/arcbox-e2e.sock "http://localhost/v1.43/containers/json?all=true")
echo "Response: $response"
echo "$response" | jq .
echo "$response" | jq -e 'type == "array"' || exit 1
- name: Test /v1.43/containers/json?all=1 endpoint (numeric boolean)
run: |
response=$(curl -s --unix-socket /tmp/arcbox-e2e.sock "http://localhost/v1.43/containers/json?all=1")
echo "Response: $response"
echo "$response" | jq .
echo "$response" | jq -e 'type == "array"' || exit 1
- name: Test /v1.43/images/json endpoint
run: |
response=$(curl -s --unix-socket /tmp/arcbox-e2e.sock "http://localhost/v1.43/images/json")
echo "Response: $response"
echo "$response" | jq .
echo "$response" | jq -e 'type == "array"' || exit 1
- name: Test /v1.43/networks endpoint
run: |
response=$(curl -s --unix-socket /tmp/arcbox-e2e.sock "http://localhost/v1.43/networks")
echo "Response: $response"
echo "$response" | jq .
# Should have at least the bridge network
echo "$response" | jq -e 'type == "array"' || exit 1
- name: Test /v1.43/volumes endpoint
run: |
response=$(curl -s --unix-socket /tmp/arcbox-e2e.sock "http://localhost/v1.43/volumes")
echo "Response: $response"
echo "$response" | jq .
echo "$response" | jq -e '.Volumes' || exit 1
- name: Test volume create and delete
run: |
# Create volume
response=$(curl -s -X POST \
--unix-socket /tmp/arcbox-e2e.sock \
-H "Content-Type: application/json" \
-d '{"Name": "test-volume"}' \
"http://localhost/v1.43/volumes/create")
echo "Create response: $response"
echo "$response" | jq -e '.Name == "test-volume"' || exit 1
# Inspect volume
response=$(curl -s --unix-socket /tmp/arcbox-e2e.sock \
"http://localhost/v1.43/volumes/test-volume")
echo "Inspect response: $response"
echo "$response" | jq -e '.Name == "test-volume"' || exit 1
# Delete volume
response=$(curl -s -X DELETE \
--unix-socket /tmp/arcbox-e2e.sock \
"http://localhost/v1.43/volumes/test-volume")
echo "Delete response: $response"
- name: Test network create and delete
run: |
# Create network
response=$(curl -s -X POST \
--unix-socket /tmp/arcbox-e2e.sock \
-H "Content-Type: application/json" \
-d '{"Name": "test-network", "Driver": "bridge"}' \
"http://localhost/v1.43/networks/create")
echo "Create response: $response"
network_id=$(echo "$response" | jq -r '.Id')
echo "Network ID: $network_id"
# Inspect network
response=$(curl -s --unix-socket /tmp/arcbox-e2e.sock \
"http://localhost/v1.43/networks/$network_id")
echo "Inspect response: $response"
echo "$response" | jq -e '.Name == "test-network"' || exit 1
# Delete network
response=$(curl -s -X DELETE \
--unix-socket /tmp/arcbox-e2e.sock \
"http://localhost/v1.43/networks/$network_id")
echo "Delete response: $response"
- name: Install Docker CLI
run: |
brew install docker
- name: Test with Docker CLI
continue-on-error: true
run: |
export DOCKER_HOST="unix:///tmp/arcbox-e2e.sock"
export DOCKER_API_VERSION="1.43"
echo "=== docker version ==="
docker version
echo ""
echo "=== docker info ==="
docker info
echo ""
echo "=== docker ps -a ==="
docker ps -a
echo ""
echo "=== docker images ==="
docker images
echo ""
echo "=== docker network ls ==="
docker network ls
echo ""
echo "=== docker volume ls ==="
docker volume ls
- name: Stop daemon
if: always()
run: |
if [ -n "$DAEMON_PID" ]; then
kill $DAEMON_PID 2>/dev/null || true
fi
rm -f /tmp/arcbox-e2e.sock
rm -rf /tmp/arcbox-e2e-data
# API version compatibility tests
api-versions:
name: API Version Compatibility
runs-on: macos-26
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Protobuf compiler
run: |
brew install protobuf
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build arcbox daemon
run: cargo build --release -p arcbox-daemon
- name: Start daemon
run: |
mkdir -p /tmp/arcbox-e2e-data
./target/release/arcbox-daemon \
--socket /tmp/arcbox-e2e.sock \
--data-dir /tmp/arcbox-e2e-data &
sleep 3
- name: Test API versions 1.24 to 1.43
run: |
for version in 1.24 1.25 1.30 1.35 1.40 1.41 1.42 1.43; do
echo "Testing API version $version..."
response=$(curl -s --unix-socket /tmp/arcbox-e2e.sock \
"http://localhost/v$version/containers/json")
if echo "$response" | jq -e 'type == "array"' > /dev/null; then
echo " v$version: OK"
else
echo " v$version: FAILED"
echo " Response: $response"
exit 1
fi
done
- name: Stop daemon
if: always()
run: |
pkill -f "arcbox-daemon" || true
rm -f /tmp/arcbox-e2e.sock
rm -rf /tmp/arcbox-e2e-data