dragonflyoss / nydus

Nydus - the Dragonfly image service, providing fast, secure and easy access to container images.
https://nydus.dev/
Apache License 2.0
1.18k stars 203 forks source link

Rafs config v2 compatibility #922

Open changweige opened 1 year ago

changweige commented 1 year ago

Nydusd that is started and configured by v1 config file has a deserialization problem.

nydusctl --sock /var/lib/containerd-nydus/socket/ce4qur458hm6mgircbag/api.sock info

Version:                "v2.1.0"
Status:                 "RUNNING"
Profile:                "release"
Commit:                 "9a3e2698380aed15da223523775b7666dadfd907"
Instances:
    Instance Mountpoint:  /1118
    Type:  Rafs
    Mounted Time:  2022-12-05 7:54:06.454605712 +00:00:00
Error: Invalid argument (os error 22)
jiangliu commented 1 year ago

Could you please help to attach an configuration file generated by snapshotter? So we can add a unit test case for it.

changweige commented 1 year ago

{ "device": { "backend": { "type": "registry", "config": { "readahead": false, "host": "", "repo": "vke/golang", "auth": "", "scheme": "https", "proxy": { "fallback": false }, "timeout": 5, "connect_timeout": 5, "retry_limit": 2 } }, "cache": { "type": "blobcache", "compressed": true, "config": { "work_dir": "/var/lib/containerd-nydus/cache", "disable_indexed_map": false } } }, "mode": "direct", "digest_validate": false, "enable_xattr": true, "fs_prefetch": { "enable": true, "prefetch_all": true, "threads_count": 8, "merging_size": 1048576, "bandwidth_rate": 0 } }

jiangliu commented 1 year ago

It turns out the the configuration v2 doesn't support an empty host. So is it legal to have an empty device.backend.config.host? The failure get fixed by setting a value to host, such as "localhost".

jiangliu commented 1 year ago

@changweige with the master, I can't reproduce the issue anymore. root@liujiang-ecs-dev:~/ws/image-service.git# target/debug/nydusctl --sock /var/lib/containerd-nydus/socket/cf3rgoupavj0bc7q791g/api.sock info

Version: "v2.2.0-rc.1-13-g99ba5000" Status: "RUNNING" Profile: "debug" Commit: "99ba5000a734315ac8549c8ec21cebfc61d26e7f" Instances: Instance Mountpoint: / Type: Rafs Mounted Time: 2023-01-30 2:29:04.387481445 +00:00:00 Mode: direct Prefetch: true Prefetch Merging Size: 0