-
Notifications
You must be signed in to change notification settings - Fork 206
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
storage: add new backend HttpProxy
#974
Conversation
@loheagn , a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/40296 |
@loheagn , The CI test is completed, please check result:
Congratulations, your test job passed! |
Thanks @loheagn for the contribution, it can make My suggestion is that maybe we should implement the content store backend with HTTP over unix domain socket instead of TCP, which is simpler and requires only implementing two distribution APIs:
It's very like |
@loheagn , the code has been updated, so a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/43987 |
@loheagn , the code has been updated, so a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/43988 |
@loheagn , the code has been updated, so a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/43992 |
api/src/config.rs
Outdated
@@ -427,6 +441,14 @@ pub struct S3Config { | |||
pub mirrors: Vec<MirrorConfig>, | |||
} | |||
|
|||
/// ContentProxyProxy configuration information to access blobs. | |||
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] | |||
pub struct LocalHttpProxyConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about LocalUdsConfig
?
We can define an APIs to retrieve blobs from Unix domain socket, no matter it's containerd content store or something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or ContainerdContentStoreProxy
? @imeoer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this backend driver only support http protocol now. I think LocalHttpProxy
may be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok for me if using HttpProxy
, maybe we can merge the feature with nydus-backend-proxy (not in this PR)? So that we can use HttpProxy
to request an HTTP server that can proxy to local blob directory/containerd content store.
@loheagn , the code has been updated, so a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/44026 |
@loheagn , the title has been updated, so a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/44027 |
@loheagn , the code has been updated, so a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/47782 |
@loheagn , The CI test is completed, please check result:
Sorry, your test job failed. Please get the details in the link. |
@loheagn , the code has been updated, so a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/47934 |
@loheagn , The CI test is completed, please check result:
Sorry, your test job failed. Please get the details in the link. |
docs/nydusd.md
Outdated
or | ||
|
||
``` | ||
// for remote usage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be for local usage
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed :)
This patch adds a new storage backend `HttpProxy` which can access blobs through a http proxy server. The http proxy server can be local (using unix socket) or remote (using `https://` or using `http://`). `HttpProxy` uses two API endpoints to access the blobs: - `HEAD /path/to/blobs` to get the blob size - `GET /path/to/blobs` to read the blob The http proxy server should respect [the `Range` header](https://www.rfc-editor.org/rfc/rfc9110.html#name-range) to compute the offset and length of the blob. The example config files for this new backend may be: ```jsonc // for remote usage { "backend": { "type": "http-proxy", "config": { "addr": "http://127.0.0.1:9977", "path": "/namespace/<repo>/blobs" } } } ``` or ```jsonc // for local unix socket { "backend": { "type": "http-proxy", "config": { "addr": "/path/to/unix/socket/file" } } } ``` There is also a test in `http_proxy.rs` to make sure `HttpProxy` works well, which setups a simple http server and generates a `HttpProxy` backend to get contents from the server. Signed-off-by: Nan Li <loheagn@icloud.com>
@loheagn , the code has been updated, so a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/48133 |
@loheagn , The CI test is completed, please check result:
Sorry, your test job failed. Please get the details in the link. |
need rebase to master since anolis test script is updated |
This pr adds a new storage backend
HttpProxy
which can access blobs through a http proxy server.The http proxy server can be local (using unix socket) or remote (using
https://
or usinghttp://
).HttpProxy
uses two API endpoints to access the blobs:HEAD /path/to/blobs
to get the blob sizeGET /path/to/blobs
to read the blobThe http proxy server should respect the
Range
header to compute the offset and length of the blob.The example config files for this new backend may be:
or
There is also a test in
http_proxy.rs
to make sureHttpProxy
works well, which setups a simple http server and generates aHttpProxy
backend to get contents from the server.Signed-off-by: Nan Li loheagn@icloud.com