# 目标 - 场景:OCI、nydus v6、基于workload优化的nydus v6(stargz也支持) - 指标:pull时间,create时间,run时间 # 测试步骤 对 nydus 镜像基于 workload 进行优化(文件粒度)还处于试验阶段,测试时可暂时使用以下仓库 nydus-image-performance-with-optimize-old 分支中的二进制文件optimize: https://github.com/sctb512/hello-bench.git - 环境安装 Nydus 和 nydus-snapshotter 环境安装参考: (1)https://github.com/dragonflyoss/image-service/blob/master/docs/nydusd.md (2)https://github.com/containerd/nydus-snapshotter/blob/main/docs/configure_nydus.md 确保 snapshotter 加载正常: ```shell= sudo ctr plugins ls | grep snapshotter ``` ![](https://i.imgur.com/u2NjDlr.png) ```shell= git clone https://github.com/sctb512/hello-bench.git cd hello-bench ``` ```shell= ./run.sh Usage: run.sh -o OPERATION -s SOURCE_REGISTRY -t TARGET_REGISTRY [other options] [-o operation] available options are [ push convert run all draw ] [-i images] images list [-p images path] file path that contains images list (line by line) [-s source registry] source registry for pulling image [-t target registry] arget registry for pushing image [-r round number] number of round to run hellobench [-d result directory] directory to store raw result data [-k skip finished test] skip images that already finisned (in $RESULT_DIR/$RESULT_FILE) ``` 需要测试的镜像列表位于 image_list.txt,可以通过-p指定存储镜像列表的文件路径(每行一个镜像文件名),也可以通过-i参数指定具体的镜像列表。 - 将 OCI 镜像 push 到内部仓库 ```shell= # 例如,对于 busybox 镜像 # 镜像地址为 local_registry/local_registry_namespace/busybox:latest ./run.sh -o push -i alpine busybox -t local_registry ``` 如果镜像列表放在image_list.txt文件中,不需要`-i`参数,下同: ```shell= ./run.sh -o push -t local_registry ``` - 转换为 nydus v6 镜像 ```shell= ./run.sh -o convert -i alpine busybox -t local_registry ``` - 转换为基于 workload 优化后的 nydus v6 镜像 ```shell= ./run.sh -o optimize -i alpine busybox -t local_registry ``` - 运行 hello bench(-n 表示运行次数,默认为运行 10 次) ```shell= ./run.sh -o run -i alpine busybox -t local_registry -r 1 ```