@@ -146,13 +146,13 @@ function optimize {
146
146
local DST=" ${2} "
147
147
local PLAINHTTP=" ${3} "
148
148
local OPTS=${@: 4}
149
- ctr-remote image pull --local - u " ${DUMMYUSER} :${DUMMYPASS} " " ${SRC} "
149
+ ctr-remote image pull -u " ${DUMMYUSER} :${DUMMYPASS} " " ${SRC} "
150
150
ctr-remote image optimize ${OPTS} --oci " ${SRC} " " ${DST} "
151
151
PUSHOPTS=
152
152
if [ " ${PLAINHTTP} " == " true" ] ; then
153
153
PUSHOPTS=--plain-http
154
154
fi
155
- ctr-remote image push --local ${PUSHOPTS} -u " ${DUMMYUSER} :${DUMMYPASS} " " ${DST} "
155
+ ctr-remote image push ${PUSHOPTS} -u " ${DUMMYUSER} :${DUMMYPASS} " " ${DST} "
156
156
}
157
157
158
158
function convert {
@@ -164,17 +164,17 @@ function convert {
164
164
if [ " ${PLAINHTTP} " == " true" ] ; then
165
165
PUSHOPTS=--plain-http
166
166
fi
167
- ctr-remote image pull --local - u " ${DUMMYUSER} :${DUMMYPASS} " " ${SRC} "
167
+ ctr-remote image pull -u " ${DUMMYUSER} :${DUMMYPASS} " " ${SRC} "
168
168
ctr-remote image convert ${OPTS} --oci " ${SRC} " " ${DST} "
169
- ctr-remote image push --local ${PUSHOPTS} -u " ${DUMMYUSER} :${DUMMYPASS} " " ${DST} "
169
+ ctr-remote image push ${PUSHOPTS} -u " ${DUMMYUSER} :${DUMMYPASS} " " ${DST} "
170
170
}
171
171
172
172
function copy {
173
173
local SRC=" ${1} "
174
174
local DST=" ${2} "
175
- ctr-remote image pull --local -- all-platforms " ${SRC} "
176
- ctr-remote image tag --local " ${SRC} " " ${DST} "
177
- ctr-remote image push --local - u " ${DUMMYUSER} :${DUMMYPASS} " " ${DST} "
175
+ ctr-remote image pull --all-platforms " ${SRC} "
176
+ ctr-remote image tag " ${SRC} " " ${DST} "
177
+ ctr-remote image push -u " ${DUMMYUSER} :${DUMMYPASS} " " ${DST} "
178
178
}
179
179
180
180
function copy_out_dir {
@@ -192,6 +192,11 @@ function copy_out_dir {
192
192
rm " ${TMPFILE} "
193
193
}
194
194
195
+ RPULL_COMMAND=" rpull"
196
+ if [ " ${USE_TRANSFER_SERVICE} " == " true" ] ; then
197
+ RPULL_COMMAND=" pull --snapshotter=stargz"
198
+ fi
199
+
195
200
function dump_dir {
196
201
local IMAGE=" ${1} "
197
202
local TARGETDIR=" ${2} "
@@ -201,9 +206,9 @@ function dump_dir {
201
206
202
207
reboot_containerd
203
208
if [ " ${REMOTE} " == " true" ] ; then
204
- run_and_check_remote_snapshots ctr-remote images rpull --user " ${DUMMYUSER} :${DUMMYPASS} " " ${IMAGE} "
209
+ run_and_check_remote_snapshots ctr-remote images ${RPULL_COMMAND} --user " ${DUMMYUSER} :${DUMMYPASS} " " ${IMAGE} "
205
210
else
206
- ctr-remote image pull --local -- snapshotter=" ${SNAPSHOTTER} " --user " ${DUMMYUSER} :${DUMMYPASS} " " ${IMAGE} "
211
+ ctr-remote image pull --snapshotter=" ${SNAPSHOTTER} " --user " ${DUMMYUSER} :${DUMMYPASS} " " ${IMAGE} "
207
212
fi
208
213
copy_out_dir " ${IMAGE} " " ${TARGETDIR} " " ${DEST} " " ${SNAPSHOTTER} "
209
214
}
@@ -244,6 +249,8 @@ if [ "${BUILTIN_SNAPSHOTTER}" != "true" ] ; then
244
249
[proxy_plugins.stargz]
245
250
type = "snapshot"
246
251
address = "/run/containerd-stargz-grpc/containerd-stargz-grpc.sock"
252
+ [proxy_plugins.stargz.exports]
253
+ enable_remote_snapshot_annotations = "true"
247
254
EOF
248
255
fi
249
256
@@ -277,9 +284,9 @@ optimize "${REGISTRY_HOST}/alpine:3.15.3" "${REGISTRY_ALT_HOST}:5000/alpine:esgz
277
284
# TODO: support external TOC suffix other than "-esgztoc"
278
285
optimize " ${REGISTRY_HOST} /ubuntu:22.04" " ${REGISTRY_HOST} /ubuntu:esgz-50000" " false" --estargz-min-chunk-size=50000
279
286
optimize " ${REGISTRY_HOST} /ubuntu:22.04" " ${REGISTRY_HOST} /ubuntu:esgz-ex" " false" --estargz-external-toc
280
- ctr-remote image push --local - u " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /ubuntu:esgz-ex-esgztoc"
287
+ ctr-remote image push -u " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /ubuntu:esgz-ex-esgztoc"
281
288
convert " ${REGISTRY_HOST} /ubuntu:22.04" " ${REGISTRY_HOST} /ubuntu:esgz-ex-keep-diff-id" " false" --estargz --estargz-external-toc --estargz-keep-diff-id
282
- ctr-remote image push --local - u " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /ubuntu:esgz-ex-keep-diff-id-esgztoc"
289
+ ctr-remote image push -u " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /ubuntu:esgz-ex-keep-diff-id-esgztoc"
283
290
284
291
if [ " ${BUILTIN_SNAPSHOTTER} " != " true" ] ; then
285
292
@@ -295,21 +302,21 @@ if [ "${BUILTIN_SNAPSHOTTER}" != "true" ] ; then
295
302
retry curl -X POST localhost:5001/api/v0/version > /dev/null 2>&1 # wait for up
296
303
297
304
# stargz snapshotter (default labels)
298
- ctr-remote image pull --local -- user " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /ubuntu:22.04"
305
+ ctr-remote image pull --user " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /ubuntu:22.04"
299
306
CID=$( ctr-remote i ipfs-push " ${REGISTRY_HOST} /ubuntu:22.04" )
300
307
reboot_containerd
301
308
run_and_check_remote_snapshots ctr-remote i rpull --ipfs " ${CID} "
302
309
copy_out_dir " ${CID} " " /usr" " ${USR_STARGZSN_IPFS} " " stargz"
303
310
304
311
# stargz snapshotter (containerd labels)
305
- ctr-remote image pull --local -- user " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /ubuntu:22.04"
312
+ ctr-remote image pull --user " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /ubuntu:22.04"
306
313
CID=$( ctr-remote i ipfs-push " ${REGISTRY_HOST} /ubuntu:22.04" )
307
314
reboot_containerd
308
315
run_and_check_remote_snapshots ctr-remote i rpull --use-containerd-labels --ipfs " ${CID} "
309
316
copy_out_dir " ${CID} " " /usr" " ${USR_STARGZSN_CTD_IPFS} " " stargz"
310
317
311
318
# overlayfs snapshotter
312
- ctr-remote image pull --local -- user " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /ubuntu:22.04"
319
+ ctr-remote image pull --user " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /ubuntu:22.04"
313
320
CID=$( ctr-remote i ipfs-push --estargz=false " ${REGISTRY_HOST} /ubuntu:22.04" )
314
321
reboot_containerd
315
322
ctr-remote i rpull --snapshotter=overlayfs --ipfs " ${CID} "
@@ -330,11 +337,11 @@ echo "Testing refreshing and mirror..."
330
337
331
338
reboot_containerd
332
339
echo " Getting image with normal snapshotter..."
333
- ctr-remote image pull --local -- user " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /alpine:esgz"
340
+ ctr-remote image pull --user " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /alpine:esgz"
334
341
copy_out_dir " ${REGISTRY_HOST} /alpine:esgz" " /usr" " ${USR_ORG} " " overlayfs"
335
342
336
343
echo " Getting image with stargz snapshotter..."
337
- run_and_check_remote_snapshots ctr-remote images rpull --user " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /alpine:esgz"
344
+ run_and_check_remote_snapshots ctr-remote images ${RPULL_COMMAND} --user " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /alpine:esgz"
338
345
339
346
REGISTRY_HOST_IP=$( getent hosts " ${REGISTRY_HOST} " | awk ' { print $1 }' )
340
347
REGISTRY_ALT_HOST_IP=$( getent hosts " ${REGISTRY_ALT_HOST} " | awk ' { print $1 }' )
@@ -474,7 +481,7 @@ diff --no-dereference -qr "${USR_NORMALSN_PLAIN_STARGZ}/" "${USR_STARGZSN_PLAIN_
474
481
475
482
# ###########
476
483
# Try to pull this image from different namespace.
477
- ctr-remote --namespace=dummy images rpull --user " ${DUMMYUSER} :${DUMMYPASS} " \
484
+ ctr-remote --namespace=dummy images ${RPULL_COMMAND} --user " ${DUMMYUSER} :${DUMMYPASS} " \
478
485
" ${REGISTRY_HOST} /ubuntu:esgz"
479
486
480
487
# ###########
@@ -489,7 +496,7 @@ mv /etc/containerd-stargz-grpc/config.toml_rm /etc/containerd-stargz-grpc/config
489
496
reboot_containerd
490
497
if [ " ${BUILTIN_SNAPSHOTTER} " != " true" ] ; then
491
498
# Snapshots should be available even after restarting the snapshotter with a signal
492
- run_and_check_remote_snapshots ctr-remote images rpull --user " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /alpine:esgz"
499
+ run_and_check_remote_snapshots ctr-remote images ${RPULL_COMMAND} --user " ${DUMMYUSER} :${DUMMYPASS} " " ${REGISTRY_HOST} /alpine:esgz"
493
500
ctr-remote run --rm --snapshotter=stargz " ${REGISTRY_HOST} /alpine:esgz" test echo hi
494
501
495
502
TARGET_SIGNALS=(SIGINT SIGTERM)
0 commit comments