dragonflyoss / nydus

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

NAS support #1632

Open willprice-oracle opened 1 day ago

willprice-oracle commented 1 day ago

The README claims:

Compatible with Ecosystem: Storage backend support with Registry, OSS, NAS, Shared Disk, and P2P service. Compatible with the OCI images, and provide native eStargz images support.

But I can't find any documentation on what sort of network attached storage is supported. The configuration files indicates only local filesystems or block devices can be used, but is there existing support for using shared networked block volumes, NFS, or other similar technologies?

Many thanks

imeoer commented 1 day ago

It is better to mount NFS to the local directory and then configure nydus to use localfs as storage backend.

willprice-oracle commented 1 day ago

Hi @imeoer, Thanks for the feedback.

Q1: Am I right in understanding that you're suggesting configuring the nydusd backend like so:

{
  "device": {
    "backend": {
      "type": "localfs",
      "config": {
        "dir": "/var/lib/nydus/blobs"
      }
    },
    "cache": {
      "type": "dummycache",
    }
  },
  "mode": "direct",
  "digest_validate": false,
  "iostats_files": false,
  "enable_xattr": false
}

Where I have /var/lib/nydus/blobs as an NFS mount?

Some notes on the configuration:

Q2: If I assume my registry hosts are the only ones that are writing to the NFS share, am I correct in thinking that there won't be any trampling of state?

Q3: I'm assuming that I can't avoid the duplication of the nydus metadata files that the container hosts will download from the registry? In other words, there's not a way for me to store those metadata files on NFS too?

imeoer commented 1 day ago

A1: Right, the /var/lib/nydus/blobs directory should include all the blob files, for example, the sha256:xxx blob should name it xxx. A2: What's means trampling of state? The opened blob files by nydusd should be readonly. A3: Nydusd can mount a bootstrap (metadata) file from a local file, so we can also put it in a NAS mount directory.

willprice-oracle commented 18 hours ago

Great, thanks again for your answers @imeoer . And for A2, yes, I did mean nydusd clients writing to the NFS store, it's good to have confirmation it uses it readonly.

imeoer commented 17 hours ago

The files in device.backend.config.dir should be readonly, the cache dir (device.cache, but expect dummycache) should be writable.