Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: add p2p proxy field in nydusd config #333

Merged
merged 1 commit into from
Mar 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 35 additions & 9 deletions docs/nydusd.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,12 @@ We are working on enabling cloud-hypervisor support for nydus.
// localfs | oss | registry
"type": "localfs",
"config": {
// Access remote storage backend via P2P proxy, e.g. Dragonfly client
"proxy": "http://p2p-proxy:65001",
// Fallback to remote storage backend if P2P proxy ping failed
"proxy_fallback": true,
// Endpoint of P2P proxy health check
"proxy_ping_url": "http://p2p-proxy:40901/server/ping",
// Interval of P2P proxy checking, in seconds
"proxy_check_interval": 5,
// Drop the read request once http request timeout, in seconds
"timeout": 5,
// Drop the read request once http connection timeout, in seconds
"connect_timeout": 5,
// Retry count when read request failed
"retry_limit": 0,
...
}
},
"cache": {
Expand Down Expand Up @@ -206,6 +197,41 @@ We are working on enabling cloud-hypervisor support for nydus.
}
```

##### Enable P2P Proxy for Storage Backend

Add `device.backend.config.proxy` field to enable HTTP proxy for storage backend. For example, use P2P distribution service to reduce network workload and latency in large scale container cluster using [Dragonfly](https://d7y.io/) (enable centralized dfdaemon mode).

```
{
"device": {
"backend": {
"type": "registry",
"config": {
"proxy": {
// Access remote storage backend via P2P proxy, e.g. Dragonfly dfdaemon server URL
"url": "http://p2p-proxy:65001",
// Fallback to remote storage backend if P2P proxy ping failed
"fallback": true,
// Endpoint of P2P proxy health checking
"ping_url": "http://p2p-proxy:40901/server/ping",
// Interval of P2P proxy health checking, in seconds
"check_interval": 5
},
...
}
},
...
},
...
}
```

Once the configuration is loaded successfully on nydusd starting, we will see the log as shown below:

```
INFO [storage/src/backend/connection.rs:136] backend config: CommonConfig { proxy: ProxyConfig { url: "http://p2p-proxy:65001", ping_url: "http://p2p-proxy:40901/server/ping", fallback: true, check_interval: 5 }, timeout: 5, connect_timeout: 5, retry_limit: 0 }
```

### Mount Bootstrap Via API

To mount a bootstrap via api, first launch nydusd without a bootstrap:
Expand Down