iSulad/0166-supplementary-registry-design-documentation.patch

102 lines
33 KiB
Diff
Raw Permalink Normal View History

From 3e0cafd68cf238646c9a2fad065898d2575501fb Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Tue, 10 Dec 2024 23:53:53 +1400
Subject: [PATCH 08/19] supplementary registry design documentation
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
.../detailed/Image/registry_degisn_zh.md | 41 +++++++++++++++++++
docs/images/pull_detail.svg | 16 ++++++++
2 files changed, 57 insertions(+)
create mode 100644 docs/images/pull_detail.svg
diff --git a/docs/design/detailed/Image/registry_degisn_zh.md b/docs/design/detailed/Image/registry_degisn_zh.md
index ac351d9a..df1061a0 100644
--- a/docs/design/detailed/Image/registry_degisn_zh.md
+++ b/docs/design/detailed/Image/registry_degisn_zh.md
@@ -2,6 +2,7 @@
| ------ | ---------------------------------------------- |
| Date | 2020-05-28 |
| Email | [wangfengtu@huawei.com](wangfengtu@huawei.com) |
+| Update | 钟涛 2024/12/10 新增约束限制以及流程图 |
# 1.方案目标
@@ -70,6 +71,45 @@ void free_registry_login_options(registry_login_options *options);
## **Registry模块**
+### 流程图
+![driver_init](../../../images/pull_detail.svg)
+
+pull涉及多个线程图中蓝色的方框为线程只有fetch_layer时存在多线程同时拉取的情况各个线程之间的顺序由condition与complete变量保障已在上图中标记。
+
+g_shared->mutex保护多个下载线程操作g_shared->cached_layers的并发性以及操作condition与complete变量的原子性。
+
+### 支持限制
+拉取容器镜像支持的Media Types类型如下
+
+1.支持的manifest Media Types类型。
+
+ (1) Docker规范镜像格式。
+ - Image Manifest Version 2, Schema 1
+ - application/vnd.docker.distribution.manifest.v1+json
+ - application/vnd.docker.distribution.manifest.v1+prettyjws
+ - Image Manifest Version 2, Schema 2
+ - application/vnd.docker.distribution.manifest.v2+json
+ - application/vnd.docker.distribution.manifest.list.v2+json
+
+ (2) OCI规范镜像格式。
+ application/vnd.oci.image.manifest.v1+json
+
+2.支持的layer Media Types类型。
+
+ (1) Docker规范镜像格式。
+ - Image Manifest Version 2, Schema 1
+ - application/vnd.docker.image.rootfs.diff.tar.gzip
+ - Image Manifest Version 2, Schema 2
+ - application/vnd.docker.image.rootfs.diff.tar.gzip
+ - application/vnd.docker.image.rootfs.foreign.diff.tar.gzip
+
+ (2) OCI规范镜像格式。
+ - application/vnd.oci.image.layer.v1.tar+gzip
+ - application/vnd.oci.image.layer.v1.tar
+ - application/vnd.oci.image.layer.nondistributable.v1.tar
+ - application/vnd.oci.image.layer.nondistributable.v1.tar+gzip
+### 详细步骤
+
Registry模块调用registry apiv2模块下载镜像相关文件并进行解压/合法性校验后调store的接口注册成镜像并对Manager模块提供调用接口。
登录操作直接调用registry apiv2模块提供的接口实现。
@@ -388,3 +428,4 @@ libcurl提供了实现请求的原子命令该模块需要基于libcurl提供
4、自定义消息头信息
+**注意**: iSulad目前仅支持从遵循HTTP 1.1协议的镜像仓库拉取镜像尚不支持从遵循HTTP 2.0协议的镜像仓库拉取。
diff --git a/docs/images/pull_detail.svg b/docs/images/pull_detail.svg
new file mode 100644
index 00000000..25f61e39
--- /dev/null
+++ b/docs/images/pull_detail.svg
@@ -0,0 +1,16 @@
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1716.7187754377894 755.7398799633647" width="1716.7187754377894" height="755.7398799633647">
+ <!-- svg-source:excalidraw -->
+
+ <defs>
+ <style class="style-fonts">
+ @font-face {
+ font-family: "Virgil";
+ src: url("https://excalidraw.com/Virgil.woff2");
+ }
+ @font-face {
+ font-family: "Cascadia";
+ src: url("https://excalidraw.com/Cascadia.woff2");
+ }
+ </style>
+ </defs>
+ <rect x="0" y="0" width="1716.7187754377894" height="755.7398799633647" fill="#ffffff"></rect><g stroke-linecap="round" transform="translate(10 10) rotate(0 139 39)"><path d="M19.5 0 M19.5 0 C90.12 -1.19, 159.19 -0.76, 258.5 0 M19.5 0 C78.71 1.62, 137.37 1.57, 258.5 0 M258.5 0 C271.63 1.86, 276.21 6.76, 278 19.5 M258.5 0 C270.28 2, 277.52 6.23, 278 19.5 M278 19.5 C276.6 31.61, 278.78 39.7, 278 58.5 M278 19.5 C278.13 28.06, 278.48 36.44, 278 58.5 M278 58.5 C277.52 69.6, 270.66 77.17, 258.5 78 M278 58.5 C279.02 69.79, 272.97 78.42, 258.5 78 M258.5 78 C180.83 77.89, 102.41 79.07, 19.5 78 M258.5 78 C184.87 77.34, 113.29 77.44, 19.5 78 M19.5 78 C6.17 77.83, -1.54 70.48, 0 58.5 M19.5 78 C8.36 76.58, 1.74 72.37, 0 58.5 M0 58.5 C-0.3 42.14, 1.03 30.84, 0 19.5 M0 58.5 C-0.04 44.58, 0.51 28.51, 0 19.5 M0 19.5 C-0.43 8.25, 7.15 0.19, 19.5 0 M0 19.5 C-2.25 5.35, 4.59 1.87, 19.5 0" stroke="#000000" stroke-width="1" fill="none"></path></g><g transform="translate(87.5 36.5) rotate(0 61.5 12.5)"><text x="61.5" y="18" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#000000" text-anchor="middle" style="white-space: pre;" direction="ltr">registry_pull</text></g><g stroke-linecap="round" transform="translate(18.147989908854015 193.70363023545997) rotate(0 139 39)"><path d="M19.5 0 M19.5 0 C95.75 -0.5, 171.25 -1.08, 258.5 0 M19.5 0 C102.73 1.09, 186.41 2.49, 258.5 0 M258.5 0 C271.61 -0.33, 277.83 4.96, 278 19.5 M258.5 0 C270.32 1.86, 276.58 8.24, 278 19.5 M278 19.5 C277.55 32.36, 276.3 46.87, 278 58.5 M278 19.5 C278.41 33.1, 278.92 47.53, 278 58.5 M278 58.5 C276.26 71.07, 273.25 78.65, 258.5 78 M278 58.5 C278.22 69.25, 270.35 76.09, 258.5 78 M258.5 78 C168.06 77.46, 75.29 78.28, 19.5 78 M258.5 78 C170.87 77.75, 83.6 76.4, 19.5 78 M19.5 78 C7.87 77.85, 0.73 72.3, 0 58.5 M19.5 78 C5.99 78.59, 0.03 71.76, 0 58.5 M0 58.5 C1.82 49.81, 1.54 41.04, 0 19.5 M0 58.5 C0.91 49.46, 0.41 40.44, 0 19.5 M0 19.5 C1.45 5.51, 7.04 -1.15, 19.5 0 M0 19.5 C0.88 7.87, 6.09 0.41, 19.5 0" stroke="#000000" stroke-width="1" fill="none"></path></g><g transform="translate(85.64798990885402 220.20363023545997) rotate(0 71.5 12.5)"><text x="71.5" y="18" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#000000" text-anchor="middle" style="white-space: pre;" direction="ltr">registry_fetch</text></g><g stroke-linecap="round" transform="translate(14.722222222222399 358.2037319607207) rotate(0 136.5 34.5)"><path d="M17.25 0 M17.25 0 C70.45 1.67, 123.66 0.01, 255.75 0 M17.25 0 C88.98 1.15, 160.94 1.24, 255.75 0 M255.75 0 C268.22 -0.39, 274.76 6.3, 273 17.25 M255.75 0 C265.77 -2.3, 275.14 5.87, 273 17.25 M273 17.25 C273.23 25.54, 270.75 34.42, 273 51.75 M273 17.25 C273.47 25.6, 272.53 34.19, 273 51.75 M273 51.75 C272.61 64.21, 268.07 69.57, 255.75 69 M273 51.75 C271.61 64.63, 268.9 69.19, 255.75 69 M255.75 69 C159.96 68.52, 66.6 69.07, 17.25 69 M255.75 69 C181.53 69.33, 106.28 69.64, 17.25 69 M17.25 69 C7.27 70.53, 0.54 64.83, 0 51.75 M17.25 69 C8 67.99, -2.26 64.69, 0 51.75 M0 51.75 C0.26 42.93, 1.11 30.86, 0 17.25 M0 51.75 C-0.03 43.3, 0.6 36.63, 0 17.25 M0 17.25 C1.89 6.31, 5.46 -0.45, 17.25 0 M0 17.25 C-0.65 6.54, 3.56 -0.72, 17.25 0" stroke="#000000" stroke-width="1" fill="none"></path></g><g transform="translate(79.2222222222224 380.2037319607207) rotate(0 72 12.5)"><text x="72" y="18" font-family="Virgil, Segoe UI Emoji" font-size="20px" fill="#000000" text-anchor="middle" style="white-space: pre;" direction="ltr">register_image</text></g><g stroke-linecap="round"><g transform="translate(152.70368109809033 89.00001695420997) rotate(0 0.5532208919897812 50.27837848758941)"><path d="M-0.43 0.93 C-0.37 17.55, 0.78 83.63, 0.91 100.18 M1.54 0.38 C1.48 16.63, 0.74 82.21, 0.44 98.54" stroke="#000000" stroke-width="1" fill="none"></path></g><g transform="translate(152.70368109809033 89.00001695420997) rotate(0 0.5532208919897812 50.27837848758941)"><path d="M-7.86 71.72 C-4.38 80.53, -0.94 91.7, -0.44 96.58 M-8.45 70.32 C-5.5 81.02, -3.14 90.07, -0.01 97.63" stroke="#000000" stroke-width="1" fill="none"></path></g><g transform="translate(152.70368109809
\ No newline at end of file
--
2.23.0