feat: preheat add content (#23)

This commit is contained in:
Zhaoxinxin 2023-10-26 14:24:41 +08:00 committed by GitHub
parent fd482a0469
commit ea5a923e1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 106 additions and 7 deletions

View File

@ -3,9 +3,13 @@ id: preheat
title: Preheat
---
Use preheat api for preheating. First create a POST request for preheating.
There are two ways to preheat, one is to preheat through the Open API, and the other is to preheat through the console.
## Configuration
## Open API
Use Open API to preheat.
### Configuration
If the client is `containerd`, it is recommended to configure `proxy.defaultFilter` in dfget.yaml and set it to `Expires&Signature&ns`,
because containerd will add `ns` query params to the blobs download URL,
@ -18,12 +22,14 @@ proxy:
defaultFilter: 'Expires&Signature&ns'
```
## Create Personal Access Token
### Create Personal Access Token
Please create personal access Token before calling Open API, and select `job` for access scopes,
refer to [personal-access-tokens](./personal-access-tokens.md).
## Operation
### Operation
Use preheat api for preheating. First create a POST request for preheating.
If the `scheduler_cluster_ids` does not exist,
it means to preheat all scheduler clusters.
@ -81,3 +87,48 @@ If the status is `SUCCESS`, the preheating is successful.
}
}
```
## Console
Use console for preheating, for file preheating.
### Preheat
Display all of the preheat tasks.
![preheats](../resource/preheat/preheats.png)
### Create Preheat
Click the `ADD PREHEAT` button to create preheat task.
**Description**: Set a description.
**Clusters**: Used for clusters that need to be preheat.
**URL**: URL address used to specify the resource to be preheat.
**Tag**: When the URL of the preheat task are the same but the Tag are different, they will be distinguished based on the
tag and the generated preheat task will be different.
**Filter**: By setting the filter parameter, you can specify the file type of the resource that needs to be preheated.
The filter is used to generate a unique preheat task and filter unnecessary query parameters in the URL.
![create-preheat](../resource/preheat/create-preheat.png)
Click the `SAVE` to generate the preheat task,the generated preheat task will not return results immediately and
you need to wait.
![penging-preheat](../resource/preheat/penging-preheat.png)
### Preheat Success
If the status is `SUCCESS`, the preheating is successful.
![success-preheat](../resource/preheat/preheat-success.png)
### Preheat Failure
If the status is `FAILURE`, the preheating is failure and an error log is displayed.
![failure-preheat](../resource/preheat/preheat-failure.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -3,7 +3,13 @@ id: preheat
title: 预热
---
## 配置
可以使用两种方式预热,一种是通过 Open API 预热,一种是通过控制台预热。
## Open API
使用 Open API 进行预热。
### 配置
如果客户端为 containerd建议将 dfget.yaml 配置 `proxy.defaultFilter` 设置为 `Expires&Signature&ns`,
因为 containerd 会将 blobs 下载 URL 增加 `ns` query params,
@ -16,11 +22,11 @@ proxy:
defaultFilter: 'Expires&Signature&ns'
```
## 申请 Personal Access Token
### 申请 Personal Access Token
调用 Open API 之前请先申请 Personal Access Token并且 Access Scopes 选择为 `job`,参考文档 [personal-access-tokens](./personal-access-tokens.md)。
## 操作
### 操作
用户使用 api 进行预热。首先发送 POST 请求创建预热任务。
@ -79,3 +85,45 @@ curl --request GET 'http://dragonfly-manager:8080/oapi/v1/jobs/1' \
}
}
```
## 控制台
使用控制台进行预热,用于文件预热。
### 展示预热信息
展示所有预热任务信息列表。
![preheats](../resource/preheat/preheats.png)
### 创建预热任务
点击 `ADD PREHEAT` 按钮创建预热任务。
**Description**: 添加说明来描述预热的用途。
**Clusters**: 至少选择一个或多个 Cluster 进行预热。
**URL**: 需要进行预热资源的 URL 地址。
**Tag**: 当预热任务的 URL 相同但 Tag 不同时,会根据 Tag 进行区分,生成的预热任务也会不同。
**Filter**: 通过设置 Filter 参数,可以指定需要预热的资源的文件类型,过滤器用于生成唯一的任务 ID过滤 URL 中不必要的查询参数。
![create-preheat](../resource/preheat/create-preheat.png)
点击 `SAVE` 创建完成后,生成的预热任务不会立即返回结果,该预热任务会一直轮询直到返回结果。
![penging-preheat](../resource/preheat/penging-preheat.png)
### 预热成功
显示预热任务详细信息,`status` 属性显示预热任务是否成功。
![success-preheat](../resource/preheat/preheat-success.png)
### 预热失败
如果返回预热任务状态为 `FAILURE`,表示预热失败,并且可以查看失败日志。
![failure-preheat](../resource/preheat/preheat-failure.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB