发布时间:2025-12-09 21:35:29 浏览次数:5
Nydus是一个镜像加速器,主要通过容器启动时懒加载镜像提高启动速度, 大镜像可以秒级启动,后续的读写通过COW方式。以下是nydus的几个标签:
用Nydus对容器进行加速,当前可用,可以使用(k8s+)buildkit构建镜像,使用(k8s+)containerd进行发布, 使用skaffold进行CI(但路途坎坷,该文档内容主要为这部分);未来可期,使用fscache+erofs进行底层存储加速。
如果要落地Nydus,需要考虑如下几个问题:
当前k8s container runtime 如果是docker,则需要切换成containerd,切换需要注意
CI如何处理原有的docker build方式和现在buildkit构建方式
containerd功能相对简单,要用它来进行构建、运行等操作需要多个组件配合才行,要使用起来需要做不少操作:
⚠️性能问题,写时复制从远端拉取,例如从镜像仓库拉取的话需要考虑
⚠️容器化使用nydus-snapshotter有待改进
现在nydus-snapshotter容器故障之后由于和容器启动需要nydus-snapshotter这样的循环依赖,所以无法自愈,需要
在实践探索中主要有如下问题:
正在解决中的问题
| 内核 | 5.18.2-1.el7.elrepo.x86_64 | |
| containerd | containerd.io 1.6.6 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1 | |
| buildkit | github.com/moby/buildkit 76aeaa55.m 76aeaa55ff4e1c575644bffbf0a43bea92215fbe.m | 从https://github.com/nydusaccelerator/buildkit.git构建 |
| nydus-image | v2.2.1 | |
| containerd-nydus-grpc | v0.8.0 | |
| nerdctl | 1.3.1 |
nydus镜像: nydus格式的镜像,不同于现在的ociv1 ociv2,在使用时可进行懒加载,加快容器启动速度
nydus镜像构建
nydus镜像运行
buidlkit+nydus构建完镜像之后推送到仓库,可以是docker registry,也可以是harbor等
运行的时候每启动一个nydus镜像的容器,containerd会调用 nydus-snapshotter 去查看本地有没有缓存,如果没有的话启动 nydusd 进程去拉取,如果有的话启动nydusd fuse进程作为文件服务器提供给容器挂载,这里是懒加载的关键,容器需要什么nydusd就会从仓库拉什么,启动对应的snapshotter挂载进程。
架构图如下,这里用的是fuse文件系统, erofs的社区文档比较少,暂时先用fuse
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-jMiUFnzf-1686298186600)(null)]
如果用erofs
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-vg8EBgO4-1686298186840)(null)]
官方社区仓库是 moby/buildkit, 这里用的nydusaccelerator的项目,是因为当前bug/新功能会先在nydusaccelerator发布,所以暂时先用这个项目
git clone https://github.com/nydusaccelerator/buildkit.gitcd buildkitgo build -tags=nydus -o ./bin/buildkitd ./cmd/buildkitdmv ./bin/buildkitd /usr/bin/chmod +x /usr/bin/buildkitdbuildkit 配置2
cat > /etc/buildkit/buildkitd.toml <<EOFdebug = false[worker.oci]enabled = false[worker.containerd]enabled = true# 构建成功的之后的镜像存储位置namespace = "default"address = "/run/containerd/containerd.sock"enabled = trueplatforms = [ "linux/amd64", "linux/arm64" ]gc = true# gckeepstorage sets storage limit for default gc profile, in MB.gckeepstorage = 9000EOF cat > /etc/systemd/system/buildkitd.service << EOF[Unit]Description=BuildKitDocumentation=https://github.com/moby/buildkit[Service]Environment="NYDUS_BUILDER=/usr/bin/nydus-image"ExecStart=/usr/bin/buildkitd --config /etc/buildkit/buildkitd.toml[Install]WantedBy=multi-user.targetEOF systemctl enable buildkitdsystemctl start buildkitd构建一个简单的hello world镜像
编辑 main.go
package mainimport "fmt"func main() {fmt.Println("Hello, world!")}构建可执行文件
go build -o hello main.go编辑dockerfile
FROM ubuntu:20.04COPY hello /ENTRYPOINT [ "/hello" ]这里会构建一个nydus格式的镜像 名称为reg.harbor.com/hello/hello-k8s:v0.0.4, push 为 true 则构建完成之后推送远端仓库
buildctl build --progress=plain \--frontend=dockerfile.v0 \--local context=. \--local dockerfile=. \--output type=image,name=reg.harbor.com/hello/hello-k8s:v0.0.4,compression=nydus,oci-mediatypes=true,push=true这里我们构建出来了nydus镜像,可以校验一下
nydusify check --target reg.harbor.com/hello/hello-k8s:v0.0.4INFO[2023-05-24T10:59:56+08:00] Parsing image reg.harbor.com/hello/hello-k8s:v0.0.4INFO[2023-05-24T10:59:56+08:00] Dumping OCI and Nydus manifests to ./output...INFO[2023-05-24T10:59:57+08:00] Verified Nydus image reg.harbor.com/hello/hello-k8s:v0.0.4这里check的是远端镜像,一切符合预期,是nydus镜像3
cat output/nydus_manifest.json{"schemaVersion": 2,"mediaType": "application/vnd.oci.image.manifest.v1+json","config": {"mediaType": "application/vnd.oci.image.config.v1+json","digest": "sha256:3121880b13bcaf21d0748cc35139769cb353bdd8429e541da489d1833c0c9ea7","size": 6940},"layers": [{"mediaType": "application/vnd.oci.image.layer.nydus.blob.v1","digest": "sha256:e4aa28274bae00ca1bd04843009c93fba1f6cfae94fb9f60cc98e68e7dd0977a","size": 30779473,"annotations": {"containerd.io/snapshot/nydus-blob": "true"}...{"mediaType": "application/vnd.oci.image.layer.nydus.blob.v1","digest": "sha256:5fdd275fe4099c6b7b4a3f8be50c2dc89bad3ab771d5fe454b9746471c6daaab","size": 1067099,"annotations": {"containerd.io/snapshot/nydus-blob": "true"},{"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip","digest": "sha256:4c73ce0e2ddc066d200bc119cc2b6f39938fd136b93fb8d47a590788cc91c91c","size": 2258453,"annotations": {"containerd.io/snapshot/nydus-blob-ids": "[\"e4aa28274bae00ca1bd04843009c93fba1f6cfae94fb9f60cc98e68e7dd0977a\",\"15596146dcdb421faaf9881e63baa87731603f412d1f05aa78e2d8f5bb78f1d5\",\"68fb6d505c4733f3c39645876ab9ed30dbf46056b36630be2dafe48634af1e01\",\"32a3c81c8fb5b12c68d74e01b29cd02463d8e85c0296ac3e30874f0f38412ec9\",\"89fe8a5a29e872cb9afbdeffeb9307498e67f42a0d3fdeca754b7a55b8849083\",\"43f9d24cfd0900b5ccbc7030559df305d237932f5383f592128d165c723ca553\",\"5fdd275fe4099c6b7b4a3f8be50c2dc89bad3ab771d5fe454b9746471c6daaab\"]","containerd.io/snapshot/nydus-bootstrap": "true","containerd.io/snapshot/nydus-fs-version": ""}}]}本地镜像暂时无法使用,使用会报错(这里是部署了nydus snapshotter之后)
nerdctl run --rm reg.harbor.com/hello/hello-k8s:v0.0.4 --snapshotter=nydus INFO[0000] apply failure, attempting cleanup error="failed to extract layer sha256:e4aa28274bae00ca1bd04843009c93fba1f6cfae94fb9f60cc98e68e7dd0977a: failed to get reader from content store: content digest sha256:e4aa28274bae00ca1bd04843009c93fba1f6cfae94fb9f60cc98e68e7dd0977a: not found" key="extract-504360049-gvw0 sha256:e4aa28274bae00ca1bd04843009c93fba1f6cfae94fb9f60cc98e68e7dd0977a"FATA[0000] failed to extract layer sha256:e4aa28274bae00ca1bd04843009c93fba1f6cfae94fb9f60cc98e68e7dd0977a: failed to get reader from content store: content digest sha256:e4aa28274bae00ca1bd04843009c93fba1f6cfae94fb9f60cc98e68e7dd0977a: not found这里应该应该是nydus+fuse的bug,解决方法为在构建完成之后把本地镜像删除掉, 使用时通过远端拉取
nerdctl rmi reg.harbor.com/hello/hello-k8s:v0.0.4本地镜像构建出来的manifest和远端一致,这里不能用是因为存储的时候少存储了snapshotter,具体问题待社区确认
编辑containerd配置 /etc/containerd/config.toml
version = 2state = "/run/containerd"[grpc]address = "/run/containerd/containerd.sock"uid = 0gid = 0max_recv_message_size = 16777216max_send_message_size = 16777216[timeouts]"io.containerd.timeout.shim.cleanup" = "5s""io.containerd.timeout.shim.load" = "5s""io.containerd.timeout.shim.shutdown" = "3s""io.containerd.timeout.task.state" = "2s"[plugins][plugins."io.containerd.grpc.v1.cri"]# k8s原来用的container runtime是docker,则需要配置pause镜像,否则runtime改编之后k8s原有pod无法启动sandbox_image = "reg.harbor.com/kubernetes/pause:3.6"[plugins."io.containerd.grpc.v1.cri".cni]# cni插件路径bin_dir = "/opt/cni/bin"conf_dir = "/etc/cni/net.d"max_conf_num = 1conf_template = ""[plugins."io.containerd.grpc.v1.cri".registry][plugins."io.containerd.grpc.v1.cri".registry.mirrors][plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]endpoint = ["https://registry-1.docker.io"]# Nydus插件主要配置[proxy_plugins][proxy_plugins.nydus]type = "snapshot"address = "/run/containerd-nydus/containerd-nydus-grpc.sock"[plugins."io.containerd.grpc.v1.cri".containerd]snapshotter = "nydus"disable_snapshot_annotations = falsediscard_unpacked_layers = false修改完毕重启containerd
systemctl restart containerdcontainerd也有类似docker的命令行 nerdctl
默认使用 nydus-snapshotter
cat > /etc/nerdctl/nerdctl.toml <<EOFdebug = falsedebug_full = falseaddress = "unix:///var/run/containerd/containerd.sock"namespace = "default"snapshotter = "nydus"experimental = trueEOF先删除本地镜像 nerdctl rmi reg.harbor.com/hello/hello-k8s:v0.0.4
nerdctl run --rm reg.harbor.com/hello/hello-k8s:v0.0.4# 输出reg.harbor.com/hello/hello-k8s:v0.0.4: resolved |++++++++++++++++++++++++++++++++++++++|manifest-sha256:c6ab4a56b80d503312322bda42fc31b038d6f6989d8d9e801c991787b8301132: exists |++++++++++++++++++++++++++++++++++++++|config-sha256:3121880b13bcaf21d0748cc35139769cb353bdd8429e541da489d1833c0c9ea7: exists |++++++++++++++++++++++++++++++++++++++|layer-sha256:4c73ce0e2ddc066d200bc119cc2b6f39938fd136b93fb8d47a590788cc91c91c: done |++++++++++++++++++++++++++++++++++++++|elapsed: 0.6 s total: 2.2 Mi (3.6 MiB/s)Hello, world!使用 nerdctl 命令时可能会遇到 failed to call cni.Setup: plugin type=\"bridge\" failed (add): incompatible CNI versions; config is \"1.0.0\", plugin supports [\"0.1.0\" \"0.2.0\" \"0.3.0\" \"0.3.1\" \"0.4.0\"]" cni不支持的问题,需要升级cni
https://github.com/containernetworking/plugins/releases/download/v1.1.1/cni-plugins-linux-arm64-v1.1.1.tgztar zxf cni-plugins-linux-amd64-v1.1.1.tgz -C /opt/cni/bin升级完毕即可用
到这里使用nydus加速containerd容器启动,基本完成。使用erofs待探索
| k8s | v1.22.10 | |
| containerd | containerd.io 1.6.6 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1 | |
| buildkitd | github.com/moby/buildkit 76aeaa55.m 76aeaa55ff4e1c575644bffbf0a43bea92215fbe.m | 从https://github.com/nydusaccelerator/buildkit.git构建 |
| nydus-snapshotter | v0.6.1 | 通过helm部署5,生产用的话需要更新下 |
首先需要一个 container runtime为containerd的集群
kubectl describe nodes |grep -i runtimeContainer Runtime Version: docker://20.10.8Container Runtime Version: docker://20.10.8Container Runtime Version: docker://20.10.8如果是docker,则需要更改为containerd
此处操作比较粗糙,生产切换请慎重
编辑/etc/systemd/system/kubelet.service.d/10-kubeadm.conf
增加/在KUBELET_EXTRA_ARGS追加如内容
Environment="KUBELET_EXTRA_ARGS=--container-runtime=remote --container-runtime-endpoint=unix:///run/containerd/containerd.sock"新建 ``
version = 2state = "/run/containerd"[plugins][plugins."io.containerd.grpc.v1.cri"]sandbox_image = "reg.harbor.com/kubernetes/pause:3.6"You have new mail in /var/spool/mail/root重启containerd kubelet服务
systemctl daemon-reloadsystemctl restart containerd kubelet如果 kubelet 启动失败,请查看日志做对应处理 journalctl -xu kubelet -f
启动成功之后检查如下输出之后说明切换成功
kubectl describe nodes |grep -i runtime# 三个节点Container Runtime Version: containerd://1.6.6Container Runtime Version: containerd://1.6.6Container Runtime Version: containerd://1.6.6社区的镜像不支持nydus,需要构建镜像
git clone https://github.com/nydusaccelerator/buildkit.gitcd buildkit修改 Dockerfile
diff --git a/Dockerfile b/Dockerfileindex 8869138b..b006e584 100644--- a/Dockerfile+++ b/Dockerfile@@ -97,7 +97,7 @@ ARG TARGETPLATFORMRUN --mount=target=. --mount=target=/root/.cache,type=cache \--mount=target=/go/pkg/mod,type=cache \--mount=source=/tmp/.ldflags,target=/tmp/.ldflags,from=buildkit-version \- CGO_ENABLED=0 xx-go build -ldflags "$(cat /tmp/.ldflags) -extldflags '-static'" -tags "osusergo netgo static_build seccomp ${BUILDKITD_TAGS}" -o /usr/bin/buildkitd ./cmd/buildkitd && \+ CGO_ENABLED=0 xx-go build -ldflags "$(cat /tmp/.ldflags) -extldflags '-static'" -tags "osusergo netgo nydus static_build seccomp ${BUILDKITD_TAGS}" -o /usr/bin/buildkitd ./cmd/buildkitd && \xx-verify --static /usr/bin/buildkitdFROM scratch AS binaries-linux-helper@@ -176,6 +176,7 @@ ARG ROOTLESSKIT_VERSIONRUN git clone https://github.com/rootless-containers/rootlesskit.git /go/src/github.com/rootless-containers/rootlesskitWORKDIR /go/src/github.com/rootless-containers/rootlesskitARG TARGETPLATFORM+ENV GOPROXY "https://goproxy.cn,direct"RUN --mount=target=/root/.cache,type=cache \git checkout -q "$ROOTLESSKIT_VERSION" && \CGO_ENABLED=0 xx-go build -o /rootlesskit ./cmd/rootlesskit && \@@ -203,6 +204,7 @@ RUN mkdir -p /out/nydus-static && tar xzvf nydus-static-$NYDUS_VERSION-$TARGETOSFROM buildkit-export AS buildkit-linuxCOPY --link --from=binaries / /usr/bin/+COPY --from=nydus /out/nydus-static/* /usr/bin/ENTRYPOINT ["buildkitd"]FROM binaries AS buildkit-darwin主要有三处修改:
会构建出两个镜像,我们只使用非rootless的 moby/buildkit:local
这里使用deployment+service.privileged 6
编辑 deployment+service.privileged.yaml,去掉了tls配置,增加了NYDUS_BUILDER环境变量,最终如下
镜像 shoery/buildkit:76aeaa55
apiVersion: apps/v1kind: Deploymentmetadata:labels:app: buildkitdname: buildkitdspec:replicas: 1selector:matchLabels:app: buildkitdtemplate:metadata:labels:app: buildkitdspec:containers:- name: buildkitdenv:- name: NYDUS_BUILDERvalue: /usr/bin/nydus-imageimage: shoery/buildkit:76aeaa55args:- --addr- unix:///run/buildkit/buildkitd.sock- --addr- tcp://0.0.0.0:1234# the probe below will only work after Release v0.6.3readinessProbe:exec:command:- buildctl- debug- workersinitialDelaySeconds: 5periodSeconds: 30# the probe below will only work after Release v0.6.3livenessProbe:exec:command:- buildctl- debug- workersinitialDelaySeconds: 5periodSeconds: 30securityContext:privileged: trueports:- containerPort: 1234---apiVersion: v1kind: Servicemetadata:labels:app: buildkitdname: buildkitdspec:ports:- port: 1234protocol: TCPselector:app: buildkitd部署
kubectl apply -f examples/kubernetes/deployment+service.privileged.yaml构建镜像时仅需客户端有 buildctl 即可, 通过 --addr tcp://0.0.0.0:1234 连接到 buildkitd
run_nydus_in_kubernetes
这里注意用 v0.8.2 以上的镜像版本
这里没太多修改的地方, 两个地方需要修改,其他按文档部署即可
git clone https://github.com/dragonflyoss/helm-charts.gitcd helm-charts新建 config-nydus.yaml
name: nydus-snapshotterimage: ghcr.io/containerd/nydus-snapshottertag: v0.8.2pullPolicy: IfNotPresenthostNetwork: truedragonfly:enable: falsecontainerRuntime:containerd:enable: true如果不增加nydus.toml配置,懒加载不会生效
编辑 charts/nydus-snapshotter/templates/nydus-snapshotter/snapshotter-configmap.yaml
apiVersion: v1kind: ConfigMapmetadata:name: {{ template "nydus-snapshotter.fullname" . }}labels:app: {{ template "nydus-snapshotter.fullname" . }}chart: {{ .Chart.Name }}-{{ .Chart.Version }}release: {{ .Release.Name }}heritage: {{ .Release.Service }}component: {{ .Values.name }}data:config.json: |-{"device": {"backend": {"type": "registry","config": {{{- if .Values.dragonfly.enable }}"mirrors": {{ mustToJson .Values.dragonfly.mirrorConfig }},{{- end }}"timeout": 5,"connect_timeout": 5,"retry_limit": 2}},"cache": {"type": "blobcache","config": {"work_dir": "/var/lib/nydus/cache/"}}},"mode": "direct","digest_validate": false,"iostats_files": false,"enable_xattr": true,"fs_prefetch": {"enable": true,"threads_count": 8,"merging_size": 1048576,"prefetch_all": true}}nydus.toml: |-version = 1address = "/run/containerd-nydus/containerd-nydus-grpc.sock"daemon_mode = "multiple"cleanup_on_close = false[system]enable = trueaddress = "/run/containerd-nydus/system.sock"[system.debug]daemon_cpu_profile_duration_secs = 5pprof_address = ""[daemon]nydusd_path = "/usr/local/bin/nydusd"nydusimage_path = "/usr/local/bin/nydus-image"fs_driver = "fusedev"recover_policy = "restart"nydusd_config = "/etc/nydus/config.json"threads_number = 10[log]log_to_stdout = falselevel = "debug"log_rotation_compress = truelog_rotation_local_time = truelog_rotation_max_age = 7log_rotation_max_backups = 5log_rotation_max_size = 1[metrics]address = ":9110"[remote]convert_vpc_registry = false[remote.mirrors_config]dir = ""[remote.auth]enable_kubeconfig_keychain = falsekubeconfig_path = ""enable_cri_keychain = falseimage_service_address = ""[snapshot]enable_nydus_overlayfs = falsesync_remove = false[cache_manager]disable = falsegc_period = "24h"[image]public_key_file = ""validate_signature = false[experimental]enable_stargz = falseenable_referrer_detect = false安装
helm install --wait --timeout 10m --dependency-update \--create-namespace --namespace nydus-system \-f config-nydus.yaml \nydus-snapshotter charts/nydus-snapshotter后续维护中可能会有重启 nydus-snapshotter 的需求
由于修改containerd配置使用nyduys snapshotter之后, containerd和snapshotter会互相依赖,重启nydus-snapshotter容器会起不来,所以,每次重启都先把 /etc/containerd/config.toml 中如下部分去掉
[plugins."io.containerd.grpc.v1.cri".containerd]discard_unpacked_layers = falsedisable_snapshot_annotations = falsesnapshotter = "nydus"[proxy_plugins][proxy_plugins.nydus]type = "snapshot"address = "/run/containerd-nydus/containerd-nydus-grpc.sock"重启 containerd
重新创建 nydus-snapshotter pod
验证点: 在pod中构建nydus格式的镜像,使用pod启动nydus镜像容器
要挂载 /root/.docker, 否则push镜像可能会没权限
挂载golang-helloworld的目的是将 hello 和 Dockerfile挂载进去
创建 build-nydus-image.yaml
apiVersion: v1kind: Podmetadata:name: build-podspec:restartPolicy: Nevercontainers:- name: build-containerimage: buildkit:localcommand: ["buildctl", "--addr", "tcp://buildkitd.default:1234", "build", "--progress=plain", "--frontend=dockerfile.v0", "--local", "context=.", "--local", "dockerfile=.", "--output", "type=image,name=reg.harbor.com/hello/hello-k8s:v0.0.6,compression=nydus,oci-mediatypes=true,push=true"]volumeMounts:- name: host-path-volumemountPath: /opt/golang-helloworld- name: docker-config-volumemountPath: /root/.dockerworkingDir: /opt/golang-helloworldvolumes:- name: host-path-volumehostPath:path: /home/elrond/nydus/golang-helloworld- name: docker-config-volumehostPath:path: /root/.docker命令说明
buildctl \# buildkitd的svc:port--addr tcp://default.buildkitd:1234 \build \# 输出的详细程度--progress=plain \# build frontend 类型--frontend=dockerfile.v0 \# 指定本地context路径--local context=. \# 制定本地dockerfile路径--local dockerfile=. \# 指定dockerfile文件,如果为空,默认值为Dockerfile--opt filename=hello.dockerfile# 镜像tag与类型、是否推送到远端--output type=image,name=reg.harbor.com/hello/hello-k8s:v0.0.6,compression=nydus,oci-mediatypes=true,push=true开始构建
kubectl apply -f build-nydus-image.yaml构建成功
k get poNAME READY STATUS RESTARTS AGEbuild-pod 0/1 Completed 0 23s创建 nydus-pod.yaml
apiVersion: v1kind: Podmetadata:name: nydus-podspec:containers:- name: helloimage: reg.harbor.com/hello/hello-k8s:v0.0.6imagePullPolicy: Alwayscommand: ["sh", "-c"]args:- tail -f /dev/null运行
kubectl apply -f nydus-pod.yaml这里可能会因为构建的镜像不正常,导致pod起不来,可以使用标准镜像 ghcr.io/dragonflyoss/image-service/nginx:nydus-latest 做测试
到这里在k8s上完成了nydus镜像的构建,和nydus镜像格式容器的启动
参照docker-env-setup
docker-nydus-graphdriver 尚在 Experimental 状态,且k8s在转向containerd,云原生社区对docker支持变弱,所以后续不考虑使用docker
编辑 skaffold.yaml
apiVersion: skaffold/v4beta4kind: Configbuild:tagPolicy:envTemplate:template: "{{.FOO}}"artifacts:- image: reg.harbor.com/hello/hello-k8scustom:buildCommand: buildctl --addr tcp://10.233.98.169:1234 build --progress=plain --frontend=dockerfile.v0 --local context=. --local dockerfile=. --output type=image,name=reg.harbor.com/hello/hello-k8s:"{{.FOO}}",compression=nydus,oci-mediatypes=true,push=true --opt filename=hello.dockerfilelocal:push: true入参:
其他都是默认值
| wordpress | 12.26946259s | 1.879414943s |
先把镜像拉下来,推送到自己的仓库,然后转化一下推送到自己的仓库,用镜像启动k8s pod
docker pull wordpress:latestdocker tag wordpress:latest reg.harbor.com/hello/wordpress:latestnydusify -D convert --nydus-image /usr/local/bin/nydus-image \--source reg.harbor.com/hello/wordpress:latest \--target reg.harbor.com/hello/wordpress:latest-nydus新建 wordpress-ociv1.yaml
apiVersion: v1kind: Podmetadata:name: wordpress-ociv1spec:containers:- name: wordpressimage: reg.harbor.com/hello/wordpress:latestimagePullPolicy: Alwayscommand:- sleep- "36000000000"resources:limits:cpu: "0.5"memory: "256Mi" kubectl apply -f wordpress-ociv1.yamlkubectl describe po wordpress-ociv1 Normal Pulling 3m20s kubelet Pulling image "reg.harbor.com/hello/wordpress:latest"Normal Pulled 3m7s kubelet Successfully pulled image "reg.harbor.com/hello/wordpress:latest" in 12.26946259s新建 wordpress-nydus.yaml
apiVersion: v1kind: Podmetadata:name: wordpress-nydusspec:containers:- name: wordpressimage: reg.harbor.com/hello/wordpress:latest-nydusimagePullPolicy: Alwayscommand:- sleep- "36000000000"resources:limits:cpu: "0.5"memory: "256Mi" Normal Pulling 40s kubelet Pulling image "reg.harbor.com/hello/wordpress:latest-nydus"Normal Pulled 39s kubelet Successfully pulled image "reg.harbor.com/hello/wordpress:latest-nydus" in 1.879414943scontainer与task7
主要用nerdctl工具
# 启动容器ctr run -d docker.io/library/nginx:alpine my-container# 容器列表ctr -n default c ls# task列表ctr -n default task ls# 删除容器ctr -n default delete xxxxx# 容器交互式命令ctr task exec --tty --exec-id my-container my-container bash# 镜像列表ctr -n default images ls# 获取contanierd镜像的manifest 先找到RepoDigests sha256nerdctl inspect d88ba62a3cbbcat /opt/docker/io.containerd.content.v1.content/blobs/sha256/d88ba62a3cbb999055927cbd8a3dfcb2396abc2ea168c44a9e4e16df03f1b3a3# 转换镜像并推送到仓库nydusify -D convert --nydus-image /usr/local/bin/nydus-image --source reg.harbor.com:443/library/golang@sha256:4b5cc6ca083856af8f58ab332f279b4401e1e46cc6d999957d5f88c563df24a7 --target reg.harbor.com:443/library/golang:1.18.7-nydusnydusify -D convert --nydus-image /usr/local/bin/nydus-image --source ghcr.io/dragonflyoss/image-service/ubuntu:nydus-nightly-v5 --target reg.harbor.com/hello/ubuntu:nydus-nightly-v6解决 升级cni到v1.1.1
如何判断一个镜像是否是nydus镜像8
如果镜像在containerd上
nerdctl inspect d88ba62a3cbb# 找到RepoDigests sha256 d88ba62a3cbb999055927cbd8a3dfcb2396abc2ea168c44a9e4e16df03f1b3a3 [{"Id": "sha256:13afb147bdb4382b43a833b646765dca8bc6fca92cc2a60b02e4fc718b356d97","RepoTags": ["reg.harbor.com/hello/helloworld:v0.0.1"],"RepoDigests": ["reg.harbor.com/hello/helloworld@sha256:d88ba62a3cbb999055927cbd8a3dfcb2396abc2ea168c44a9e4e16df03f1b3a3"],"Comment": "buildkit.dockerfile.v0","Created": "2023-05-16T20:28:18.501558103+08:00","Author": "","Config": {"AttachStdin": false,"Env": ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"],"Entrypoint": ["/hello"],"Labels": {"org.opencontainers.image.ref.name": "ubuntu","org.opencontainers.image.version": "22.04"}},"Architecture": "amd64","Os": "linux","Size": 79822848,"RootFS": {"Type": "layers","Layers": ["sha256:f9ebd7c08b04c9dca8fd40cf8855097fb0f5285992224bfaa58afdf0cba82cca","sha256:95fc9a6f9c1a1ef74f6545d70c96011577f05741079cd8793aa134f4b1f51006","sha256:719749732676f2e82e3baa4e1b0f5ea9cfa6aa83dde0c929a5ef8e78cacc7e24","sha256:ed593dc031518310cd5ea3a5b20bfb2c73f6108badffb30b080de9edc251476d"]},"Metadata": {"LastTagTime": "0001-01-01T00:00:00Z"}}]查看manifest
# containerd的默认是/var/lib/containerdcat /var/lib/containerd/io.containerd.content.v1.content/blobs/sha256/d88ba62a3cbb999055927cbd8a3dfcb2396abc2ea168c44a9e4e16df03f1b3a3mediaType是nydus就是nydus镜像
{"mediaType": "application/vnd.oci.image.manifest.v1+json","schemaVersion": 2,"config": {"mediaType": "application/vnd.oci.image.config.v1+json","digest": "sha256:13afb147bdb4382b43a833b646765dca8bc6fca92cc2a60b02e4fc718b356d97","size": 2137},"layers": [{"mediaType": "application/vnd.oci.image.layer.nydus.blob.v1","digest": "sha256:f9ebd7c08b04c9dca8fd40cf8855097fb0f5285992224bfaa58afdf0cba82cca","size": 32571260,"annotations": {"containerd.io/snapshot/nydus-blob": "true"}},{"mediaType": "application/vnd.oci.image.layer.nydus.blob.v1","digest": "sha256:95fc9a6f9c1a1ef74f6545d70c96011577f05741079cd8793aa134f4b1f51006","size": 295017,"annotations": {"containerd.io/snapshot/nydus-blob": "true"}},{"mediaType": "application/vnd.oci.image.layer.nydus.blob.v1","digest": "sha256:719749732676f2e82e3baa4e1b0f5ea9cfa6aa83dde0c929a5ef8e78cacc7e24","size": 1067099,"annotations": {"containerd.io/snapshot/nydus-blob": "true"}},{"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip","digest": "sha256:bb55b253c36e5a008051aad37f2554a65ec6661476a08666d76e5ee1b84dbf4c","size": 297871,"annotations": {"containerd.io/snapshot/nydus-blob-ids": "[\"f9ebd7c08b04c9dca8fd40cf8855097fb0f5285992224bfaa58afdf0cba82cca\",\"95fc9a6f9c1a1ef74f6545d70c96011577f05741079cd8793aa134f4b1f51006\",\"719749732676f2e82e3baa4e1b0f5ea9cfa6aa83dde0c929a5ef8e78cacc7e24\"]","containerd.io/snapshot/nydus-bootstrap": "true","containerd.io/snapshot/nydus-fs-version": ""}}]}查看nydus manifest
cat output/nydus_manifest.json {"schemaVersion": 2,"mediaType": "application/vnd.oci.image.manifest.v1+json","config": {"mediaType": "application/vnd.oci.image.config.v1+json","digest": "sha256:f259d1eb0bf769d60aac8c78e4811a8eeefd811a27c24f6db6c36f72ac5c2324","size": 2137},"layers": [{"mediaType": "application/vnd.oci.image.layer.nydus.blob.v1","digest": "sha256:f9ebd7c08b04c9dca8fd40cf8855097fb0f5285992224bfaa58afdf0cba82cca","size": 32571260,"annotations": {"containerd.io/snapshot/nydus-blob": "true"}},{"mediaType": "application/vnd.oci.image.layer.nydus.blob.v1","digest": "sha256:ae29dc152fabfc7e6239b3a1f83501b5a48875711b7f53e6ebf7d96b22ad4129","size": 295018,"annotations": {"containerd.io/snapshot/nydus-blob": "true"}},{"mediaType": "application/vnd.oci.image.layer.nydus.blob.v1","digest": "sha256:5fdd275fe4099c6b7b4a3f8be50c2dc89bad3ab771d5fe454b9746471c6daaab","size": 1067099,"annotations": {"containerd.io/snapshot/nydus-blob": "true"}},{"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip","digest": "sha256:e26163305101a9bc6d05ad80945a8d360d99a48b0d3ef070cf0c2137655b6115","size": 297868,"annotations": {"containerd.io/snapshot/nydus-blob-ids": "[\"f9ebd7c08b04c9dca8fd40cf8855097fb0f5285992224bfaa58afdf0cba82cca\",\"ae29dc152fabfc7e6239b3a1f83501b5a48875711b7f53e6ebf7d96b22ad4129\",\"5fdd275fe4099c6b7b4a3f8be50c2dc89bad3ab771d5fe454b9746471c6daaab\"]","containerd.io/snapshot/nydus-bootstrap": "true","containerd.io/snapshot/nydus-fs-version": ""}}]}可能是有另一个 nydus-snapshotter进程在启动 ps -ef|grep containerd-nydus-grpc
/usr/local/bin/containerd-nydus-grpc --root /opt/docker/io.containerd.snapshotter.v1.nydus --config-path /etc/nydus/nydusd-config.fusedev.json --config /etc/nydus/config.toml --log-to-stdout --log-level traceINFO[2023-05-17T15:08:33.047605411+08:00] Start nydus-snapshotter. PID 25641 Version v0.8.0 FsDriver fusedev DaemonMode multipleFATA[2023-05-17T15:08:37.018373244+08:00] failed to start nydus-snapshotter error="failed to initialize snapshotter: create database: timeout"ßnydus-image log
time="2023-05-17T15:34:24+08:00" level=debug msg="saved dapdgw7aeqou4bbcymhfxc94n as context:context:" span="[internal] load build context" spanID=7108c9f5c020f1dd traceID=3841af58efa9339c11d3c4107ad1e65atime="2023-05-17T15:34:24+08:00" level=error msg="/moby.buildkit.v1.Control/Solve returned error: rpc error: code = Unknown desc = failed to compute cache key: failed to get stream processor for application/vnd.oci.image.layer.nydus.blob.v1: no processor for media-type: unknown"failed to compute cache key: failed to get stream processor for application/vnd.oci.image.layer.nydus.blob.v1: no processor for media-type: unknown20015 0.0.0+unknown buildkitd --config /etc/buildkit/buildkitd.tomlgithub.com/moby/buildkit/solver.(*edge).createInputRequests.func1.1/root/buildkit/solver/edge.go:839github.com/moby/buildkit/solver/internal/pipe.NewWithFunction.func2/root/buildkit/solver/internal/pipe/pipe.go:82runtime.goexit/root/sdk/go1.18/src/runtime/asm_amd64.s:157120015 0.0.0+unknown buildkitd --config /etc/buildkit/buildkitd.tomlmain.unaryInterceptor.func1/root/buildkit/cmd/buildkitd/main.go:576github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1/root/buildkit/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1/root/buildkit/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34github.com/moby/buildkit/api/services/control._Control_Solve_Handler/root/buildkit/api/services/control/control.pb.go:2440google.golang.org/grpc.(*Server).processUnaryRPC/root/buildkit/vendor/google.golang.org/grpc/server.go:1340google.golang.org/grpc.(*Server).handleStream/root/buildkit/vendor/google.golang.org/grpc/server.go:1713google.golang.org/grpc.(*Server).serveStreams.func1.2/root/buildkit/vendor/google.golang.org/grpc/server.go:965runtime.goexit/root/sdk/go1.18/src/runtime/asm_amd64.s:1571使用 nydusaccelerator/buildkit 构建buildkit之后未复现
原因未知
本地镜像存储问题 删除本地镜像即可,具体问题尚未可知
buildkit打的nydus镜像无法run ,run ghcr.io/dragonflyoss/image-service/ubuntu:nydus-nightly-v5 没问题
使用nerdctl命令运行也一样
错误输出
INFO[0000] apply failure, attempting cleanup error="failed to extract layer sha256:ae29dc152fabfc7e6239b3a1f83501b5a48875711b7f53e6ebf7d96b22ad4129: failed to get stream processor for application/vnd.oci.image.layer.nydus.blob.v1: no processor for media-type: unknown" key="extract-962072102-FeAw sha256:f5294af206581b011d1423a0b7c580b44338d6fb790eaf0ebdcc838fcb107d29"ctr: failed to extract layer sha256:ae29dc152fabfc7e6239b3a1f83501b5a48875711b7f53e6ebf7d96b22ad4129: failed to get stream processor for application/vnd.oci.image.layer.nydus.blob.v1: no processor for media-type: unknown构建完使用 nerdctl命令查看有告警信息
nerdctl imagesWARN[0000] failed to get unpacked size of image "reg.harbor.com/hello/helloworld:v0.0.10-nydus-nightly-v5" for platform "linux/amd64" error="snapshot sha256:66e2cbc88c92b00741c687d56bedd11654d45c08dec2fcb38406683fb2695135 does not exist: not found"REPOSITORY TAG IMAGE ID CREATED PLATFORM SIZE BLOB SIZExxxx/hello/helloworld v0.0.10-nydus-nightly-v5 b3faf19db1a6 11 minutes ago linux/amd64 0.0 B 32.6 MiBcontainerd配置
[proxy_plugins][proxy_plugins.nydus]type = "snapshot"address = "/run/containerd-nydus/containerd-nydus-grpc.sock"[plugins."io.containerd.grpc.v1.cri".containerd]snapshotter = "nydus"disable_snapshot_annotations = falsediscard_unpacked_layers = false环境说明
本地镜像存储问题 删除本地镜像即可,问题同上,nydus-snapshotter+fusedev的问题,具体尚未可知,删除本地镜像使用远端镜像即可
使用nydus zran artifact
使用zran artifact镜像启动容器导致nydusd进程d状态
oci ref 要求 nydus-image/nydusd 2.2
nydus镜像容器创建时最开始只会加载最后一层,所以会很快
{"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip","digest": "sha256:ff67b2807cdb0005ac0137bb8d5a4cf453fead83247082f56351fa2ecc3acba0","size": 1134668,"annotations": {"containerd.io/snapshot/nydus-bootstrap": "true","containerd.io/snapshot/nydus-fs-version": "6"}}对比的时候记得把已经在本地的镜像删除掉
去掉 /etc/containerd/config.toml 中的
[plugins."io.containerd.grpc.v1.cri".containerd]discard_unpacked_layers = falsedisable_snapshot_annotations = falsesnapshotter = "nydus"[proxy_plugins][proxy_plugins.nydus]type = "snapshot"address = "/run/containerd-nydus/containerd-nydus-grpc.sock"重启 containerd
systemctl restart containerddelete nydus-snapshot容器
再次创建即可
nydus镜像会有.rs 输出,这部分是nydus代码用rust编写
time="2023-05-26T11:04:29.478658593Z" level=info msg="[Mounts] snapshot k8s.io/699/987c0c48cdfcbd8b451e7c892d2b922305c3c2fa07e2741ae5d003792dff96f9 ID 457 Kind Active"time="2023-05-26T11:04:29.838641967Z" level=info msg="[Commit] snapshot with key \"k8s.io/700/extract-821649751-v57_ sha256:17f262ebfabe0a80a19356d4acdde01515c6488b4baf9f474ba805b205be6bcd\" snapshot id 458"time="2023-05-26T11:04:29.862232365Z" level=info msg="[Commit] snapshot with key \"k8s.io/701/extract-848480697-roQj sha256:4969b12a639d311e01eb2997dca25b3ff4c15297cf1c4332246efc3da416ed90\" snapshot id 459"time="2023-05-26T11:04:29.884272468Z" level=info msg="[Commit] snapshot with key \"k8s.io/702/extract-875046240-ES_o sha256:eea7439600aea67d552929f639492138db7736625ce46442b556a6773a7e65ad\" snapshot id 460"time="2023-05-26T11:04:29.902972106Z" level=info msg="[Commit] snapshot with key \"k8s.io/703/extract-893877298-M0p7 sha256:995607f2a156cd5d860cc6cf21d5924430eea1497344c187cef6d8cb5958f08d\" snapshot id 461"time="2023-05-26T11:04:29.930234997Z" level=info msg="[Commit] snapshot with key \"k8s.io/704/extract-921174867-zDfC sha256:977a5025ef78849159b33940f21f7bc078a4b449a197bf5a84809d18eafa2ecc\" snapshot id 462"time="2023-05-26T11:04:29.953002744Z" level=info msg="[Commit] snapshot with key \"k8s.io/705/extract-940269515-m4B7 sha256:5008756b9b3af58134566161e811ab255d360cb9f6c03db6be9d1a82b10ea1ce\" snapshot id 463"time="2023-05-26T11:04:29.985446333Z" level=info msg="[Commit] snapshot with key \"k8s.io/706/extract-963184826-zC2V sha256:dbb29c913fcddebd164aff00387b0cf2ae2605ca7c3ff8ae7fc81e3770c09d6d\" snapshot id 464"time="2023-05-26T11:04:30.009608437Z" level=info msg="[Commit] snapshot with key \"k8s.io/707/extract-994808807-KS4S sha256:1dc2d75a8c5b4572fcaeb4ee74ee4a34f1f557cf380d85560bea88ddf8e656f1\" snapshot id 465"time="2023-05-26T11:04:30.034452304Z" level=info msg="[Commit] snapshot with key \"k8s.io/708/extract-19386797-sAab sha256:2e352e3c2a94ff6a53bda70e8c78f1c0061bc5c09918d42f10ee42ca0ea6e05d\" snapshot id 466"time="2023-05-26T11:04:30.051992401Z" level=info msg="[Commit] snapshot with key \"k8s.io/709/extract-43376118-0fYc sha256:c4655b7ee2454381d27aae6af1bbf99061da67f84943ebf11657db9841d2ce34\" snapshot id 467"time="2023-05-26T11:04:30.069947216Z" level=info msg="[Commit] snapshot with key \"k8s.io/710/extract-61015950-IVNU sha256:c1775d8affc2abbc45ed4051e72fa8083f624f1a52f938e3dd4017ff2a551216\" snapshot id 468"time="2023-05-26T11:04:30.088621057Z" level=info msg="[Commit] snapshot with key \"k8s.io/711/extract-79602317-8xBS sha256:7cd39c27735b21390c4f959ca1e12d38c2b73a5f173f5ffd1ee313fee85e317e\" snapshot id 469"time="2023-05-26T11:04:30.107545892Z" level=info msg="[Commit] snapshot with key \"k8s.io/712/extract-98392114-LQ31 sha256:e835052588cf3a25d66b8a4f683b381ec2314cd293a61d7405861aedce7f1d8f\" snapshot id 470"time="2023-05-26T11:04:30.138067726Z" level=info msg="[Commit] snapshot with key \"k8s.io/713/extract-129097712-x2We sha256:413163a369a3f699e6971333b345cb9655d22d8850e1713e20766dcc5fc6cf2d\" snapshot id 471"time="2023-05-26T11:04:30.158431236Z" level=info msg="[Commit] snapshot with key \"k8s.io/714/extract-148574340-w72W sha256:856e93d9260062e3351e85ff977859c11f1c6fcaf4d7de56c50a4a40936ea6dc\" snapshot id 472"time="2023-05-26T11:04:30.181674205Z" level=info msg="[Commit] snapshot with key \"k8s.io/715/extract-170870922-OaK7 sha256:bfdfb86a11099f8dfdcecb08a46dee87408cb00dedbb69d8c41bd4524e661fb6\" snapshot id 473"time="2023-05-26T11:04:30.202089436Z" level=info msg="[Commit] snapshot with key \"k8s.io/716/extract-192117639-MjNO sha256:205b438eb857a4428cdfc1a492c3e9e445a7f6aad780f69b082e28471216c9a2\" snapshot id 474"time="2023-05-26T11:04:30.224765412Z" level=info msg="[Commit] snapshot with key \"k8s.io/717/extract-214032149-U7eo sha256:a72248b4d79a6915f529bb00b97b576fec938895d81c0ebb125a02dd76f91169\" snapshot id 475"time="2023-05-26T11:04:30.244866341Z" level=info msg="[Commit] snapshot with key \"k8s.io/718/extract-234486897-32MC sha256:f0fc4ec3e74f3762cc5c68435c8c93fb92fcac6ae34053cae00ae90dcafceab6\" snapshot id 476"time="2023-05-26T11:04:30.428447831Z" level=info msg="[Commit] snapshot with key \"k8s.io/719/extract-255443005-VBbE sha256:3be1111cf1b2f35366acf9d164434690af4860fe8415c7be30faae3de1fde0f3\" snapshot id 477"time="2023-05-26T11:04:30.495389473Z" level=info msg="Prepares active snapshot k8s.io/721/a779624ddf92028254a90857bb598a256a309433088bde9e57c23b0a214a5481, nydusd should start afterwards" key=k8s.io/721/a779624ddf92028254a90857bb598a256a309433088bde9e57c23b0a214a5481 parent="k8s.io/720/sha256:3be1111cf1b2f35366acf9d164434690af4860fe8415c7be30faae3de1fde0f3"time="2023-05-26T11:04:30.501028169Z" level=info msg="nydusd command: /usr/local/bin/nydusd fuse --config /var/lib/containerd-nydus/config/cho94flp707i10bb5ddg/config.json --bootstrap /var/lib/containerd-nydus/snapshots/477/fs/image/image.boot --mountpoint /var/lib/containerd-nydus/snapshots/477/mnt --apisock /var/lib/containerd-nydus/socket/cho94flp707i10bb5ddg/api.sock --log-level debug"[2023-05-26 11:04:30.503482 +00:00] INFO [app/src/lib.rs:74] Program Version: v2.1.5, Git Commit: "ef2033c2e21d36938410069f07d32a5095a19398", Build Time: "2023-03-09T10:09:03.563891101Z", Profile: "release", Rustc Version: "rustc 1.61.0 (fe5b13d68 2022-05-18)"[2023-05-26 11:04:30.503560 +00:00] INFO [src/bin/nydusd/main.rs:514] Set rlimit-nofile to 1000000, maximum 1048576[2023-05-26 11:04:30.504138 +00:00] INFO [rafs/src/metadata/md_v6.rs:47] rafs superblock features: DIGESTER_BLAKE3 | EXPLICIT_UID_GID | HAS_XATTR | COMPRESS_ZSTD | PRESERVED_INLINED_CHUNK_DIGEST[2023-05-26 11:04:30.504414 +00:00] INFO [storage/src/backend/connection.rs:263] backend config: ConnectionConfig { proxy: ProxyConfig { url: "", ping_url: "", fallback: false, check_interval: 5, use_http: false }, mirrors: [], skip_verify: false, timeout: 5, connect_timeout: 5, retry_limit: 2 }[2023-05-26 11:04:30.631601 +00:00] INFO [storage/src/backend/registry.rs:271] cached bearer auth, next time: 1685100870[2023-05-26 11:04:30.647334 +00:00] INFO [storage/src/backend/registry.rs:271] cached bearer auth, next time: 1685100870[2023-05-26 11:04:30.668014 +00:00] INFO [storage/src/backend/registry.rs:271] cached bearer auth, next time: 1685100870[2023-05-26 11:04:30.918676 +00:00] INFO [src/bin/nydusd/fs_service.rs:206] Rafs imported[2023-05-26 11:04:30.920073 +00:00] INFO [src/bin/nydusd/fs_service.rs:102] Rafs mounted at /[2023-05-26 11:04:30.920318 +00:00] INFO [/cargo/registry/src/github.com-1ecc6299db9ec823/fuse-backend-rs-0.9.6/src/transport/fusedev/linux_session.rs:337] mount source rafs dest /var/lib/containerd-nydus/snapshots/477/mnt with fstype fuse opts default_permissions,allow_other,fd=3,rootmode=40000,user_id=0,group_id=0 fd 3[2023-05-26 11:04:30.920759 +00:00] INFO [src/bin/nydusd/daemon.rs:330] State machine(pid=32141): from Init to Ready, input [Mount], output [None][2023-05-26 11:04:30.921167 +00:00] INFO [src/bin/nydusd/daemon.rs:330] State machine(pid=32141): from Ready to Running, input [Start], output [Some(StartService)][2023-05-26 11:04:30.921189 +00:00] INFO [src/bin/nydusd/fusedev.rs:318] start 4 fuse servers[2023-05-26 11:04:30.930559 +00:00] INFO [/cargo/registry/src/github.com-1ecc6299db9ec823/fuse-backend-rs-0.9.6/src/api/server/sync_io.rs:614] FUSE INIT major 7 minor 23[2023-05-26 11:04:30.930808 +00:00] INFO [src/bin/nydusd/main.rs:660] Fuse daemon started![2023-05-26 11:04:30.931000 +00:00] INFO [src/bin/nydusd/api_server_glue.rs:406] HTTP API server running at /var/lib/containerd-nydus/socket/cho94flp707i10bb5ddg/api.sock[2023-05-26 11:04:30.931090 +00:00] INFO [api/src/http.rs:911] http server started[2023-05-26 11:04:30.961941 +00:00] INFO [api/src/http.rs:816] <--- Get Uri { string: "/api/v1/daemon" }[2023-05-26 11:04:30.962087 +00:00] INFO [api/src/http.rs:821] ---> Get Status Code: OK, Elapse: Ok(146.605µs), Body Size: 866time="2023-05-26T11:04:30.962507763Z" level=info msg="Nydus remote snapshot 477 is ready"time="2023-05-26T11:04:30.962543380Z" level=info msg="remote mount options [workdir=/var/lib/containerd-nydus/snapshots/478/work upperdir=/var/lib/containerd-nydus/snapshots/478/fs lowerdir=/var/lib/containerd-nydus/snapshots/477/mnt]"time="2023-05-26T11:04:30.964003080Z" level=info msg="Subscribe daemon cho94flp707i10bb5ddg liveness event, path=/var/lib/containerd-nydus/socket/cho94flp707i10bb5ddg/api.sock."time="2023-05-26T11:04:30.969335490Z" level=info msg="[Mounts] snapshot k8s.io/721/a779624ddf92028254a90857bb598a256a309433088bde9e57c23b0a214a5481 ID 478 Kind Active"time="2023-05-26T11:04:30.969369349Z" level=info msg="Nydus remote snapshot 477 is ready"time="2023-05-26T11:04:30.969416607Z" level=info msg="remote mount options [workdir=/var/lib/containerd-nydus/snapshots/478/work upperdir=/var/lib/containerd-nydus/snapshots/478/fs lowerdir=/var/lib/containerd-nydus/snapshots/477/mnt]"time="2023-05-26T11:04:31.124174858Z" level=info msg="[Mounts] snapshot k8s.io/721/a779624ddf92028254a90857bb598a256a309433088bde9e57c23b0a214a5481 ID 478 Kind Active"time="2023-05-26T11:04:31.124228061Z" level=info msg="Nydus remote snapshot 477 is ready"time="2023-05-26T11:04:31.124290212Z" level=info msg="remote mount options [workdir=/var/lib/containerd-nydus/snapshots/478/work upperdir=/var/lib/containerd-nydus/snapshots/478/fs lowerdir=/var/lib/containerd-nydus/snapshots/477/mnt]"time="2023-05-26T11:04:31.355843306Z" level=info msg="[Mounts] snapshot k8s.io/721/a779624ddf92028254a90857bb598a256a309433088bde9e57c23b0a214a5481 ID 478 Kind Active"time="2023-05-26T11:04:31.355922313Z" level=info msg="Nydus remote snapshot 477 is ready"time="2023-05-26T11:04:31.355974771Z" level=info msg="remote mount options [workdir=/var/lib/containerd-nydus/snapshots/478/work upperdir=/var/lib/containerd-nydus/snapshots/478/fs lowerdir=/var/lib/containerd-nydus/snapshots/477/mnt]"time="2023-05-26T11:04:31.558021456Z" level=info msg="[Mounts] snapshot k8s.io/721/a779624ddf92028254a90857bb598a256a309433088bde9e57c23b0a214a5481 ID 478 Kind Active"time="2023-05-26T11:04:31.558049891Z" level=info msg="Nydus remote snapshot 477 is ready"time="2023-05-26T11:04:31.558096530Z" level=info msg="remote mount options [workdir=/var/lib/containerd-nydus/snapshots/478/work upperdir=/var/lib/containerd-nydus/snapshots/478/fs lowerdir=/var/lib/containerd-nydus/snapshots/477/mnt]"参考链接
主要涉及的github项目
nydus-snapshotter ↩︎
buildkitd.toml ↩︎
nydus-design ↩︎
nydus ↩︎
run_nydus_in_kubernetes ↩︎
buildkit-k8s-example ↩︎
How-to-understand-the-‘task’-concept-in-containerd ↩︎
how-to-check-image-manifest-in-containerd? ↩︎
opencontainers/image-spec ↩︎