Skip to content

Commit

Permalink
Merge pull request #14 from geduo-hub/dev-1.10.x
Browse files Browse the repository at this point in the history
Platform added component documentation modifications:
  • Loading branch information
pchyuan authored Nov 22, 2024
2 parents 80cf1cd + 5e4a062 commit 57c41fa
Show file tree
Hide file tree
Showing 36 changed files with 147 additions and 72 deletions.
30 changes: 2 additions & 28 deletions docs/all-in-one/center_deploy/node_installation_guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ kuscia gateway port: 18080->1080 -p 参数
```

配置参数详解:
- n:节点名称,平台页面的计算节点ID
- m:master节点地note
- n:节点名称,平台页面的计算节点ID,注意双方节点不能相同
- m:master节点地址
- 协议:与—P参数对应关系
- notls->http
- (tls、mtls)->https
Expand Down Expand Up @@ -87,32 +87,6 @@ kuscia gateway port: 18080->1080 -p 参数

![Node_step7](../imgs/login_img.png)

由于本次新增节点的数据管理功能暂不能直接拖csv文件进行注册,所以需要将文件放到指定目录下才能进行注册,新注册的节点数据管理edge平台界面操作如下:

![Node_step8](../imgs/node_step8.png)

# 数据添加:手动上传文件到服务器指定目录

目前kuscia 使用 docker 部署,docker有磁盘挂载点,算子数据源和结果目前都在 docker容器的/home/kuscia/var/storage/data 目录下

使用命令

```shell
docker ps
```

![Node_step9](../imgs/node_step9.png)

如上图,可以看到宿主机 目录是 /root/kuscia/data/test-inf8eutnhifwod1i

我们就把实体数据文件上传到该目录下

```shell
rz
```

上传文件名字要和创建的时候一致 比如 haha-alice.csv

# 注意事项:机器关闭导致节点不可用

- 若机器关闭重启导致IP改变后节点会变成不可用状态,则需要进到节点的容器里改一下配置将③masterIP改为最新的ip;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ cd

### 第4步:安装完成

看到“web server started successfully”即为部署成功
看到“All components started successfully, time spend: xxx second”即为部署成功

![Successful_Img](../imgs/successful2_img.png)

Expand All @@ -94,5 +94,5 @@ cd

![Login_Img](../imgs/login_img.png)

若在部署过程中有相关的问题或者建议,可提交![Git_Img](../imgs/git_img.png)[issue](https://github.com/secretflow/secretflow/issues)
若在部署过程中有相关的问题或者建议,可提交![Git_Img](../imgs/git_img.png)[issue](https://github.com/secretflow/secretpad/issues)
反馈。
2 changes: 1 addition & 1 deletion docs/all-in-one/history_download.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
[点此下载 arm_64 安装包](https://secretflow-public.oss-cn-hangzhou.aliyuncs.com/mvp-packages/secretflow-allinone-linux-aarch_64-v1.8.0.tar.gz)
## v1.9.0
[点此下载 x86_64 安装包](https://secretflow-public.oss-cn-hangzhou.aliyuncs.com/mvp-packages/secretflow-allinone-linux-x86_64-v1.9.0.tar.gz)
[点此下载 arm_64 安装包](https://secretflow-public.oss-cn-hangzhou.aliyuncs.com/mvp-packages/secretflow-allinone-linux-aarch_64-v1.9.0.tar.gz)
[点此下载 arm_64 安装包](https://secretflow-public.oss-cn-hangzhou.aliyuncs.com/mvp-packages/secretflow-allinone-linux-aarch_64-v1.9.0.tar.gz)
Binary file added docs/all-in-one/imgs/autonomy_node1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/autonomy_node2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/autonomy_node3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/autonomy_node4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/autonomy_node5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/autonomy_node6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/autonomy_node6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/all-in-one/imgs/cooperation_p2p4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/data13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/data14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/data15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/data16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/data17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/data18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/data19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/all-in-one/imgs/import_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/all-in-one/imgs/import_data2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/all-in-one/imgs/successful2_img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/all-in-one/imgs/successful_img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/timecycle1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/timecycle2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/timecycle3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/timecycle4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/all-in-one/imgs/timecycle5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 21 additions & 20 deletions docs/all-in-one/more_tutorials/new_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ def ss_compare_eval_fn(
from secretflow.component.component import CompEvalError
from secretflow.component.data_utils import (
DistDataType,
load_table,
)
from secretflow.component.dataframe import (
CompDataFrame,
)
from secretflow.data import FedNdarray, PartitionWay
from secretflow.device.device.pyu import PYU
Expand All @@ -327,7 +329,7 @@ def ss_compare_eval_fn(
# only local fs is supported at this moment.
data_dir = ctx.data_dir
#local_fs_wd = ctx.local_fs_wd
# get spu config from ctx
if ctx.spu_configs is None or len(ctx.spu_configs) == 0:
raise CompEvalError("spu config is not found.")
Expand Down Expand Up @@ -355,14 +357,14 @@ def ss_compare_eval_fn(
bob = PYU(bob_party)
spu = SPU(spu_config["cluster_def"], spu_config["link_desc"])
input_df = load_table(
input_df = CompDataFrame.from_distdata(
ctx,
input_table,
load_labels=True,
load_features=True,
load_ids=True,
load_labels=True,
col_selects=input_table_alice_value + input_table_bob_value,
)
).to_pandas(check_null=False)
# pass inputs from alice and bob PYUs to SPU
alice_input_spu_object = input_df.partitions[alice].data.to(spu)
Expand Down Expand Up @@ -398,14 +400,15 @@ def ss_compare_eval_fn(
x.to_csv(path, index=False)
alice_id_df = load_table(
alice_id_df = CompDataFrame.from_distdata(
ctx,
input_table,
load_labels=False,
load_features=False,
load_ids=True,
load_labels=False,
col_selects=alice_ids,
)
).to_pandas(check_null=False)
wait(
alice(save)(
Expand All @@ -417,14 +420,14 @@ def ss_compare_eval_fn(
)
)
bob_id_df = load_table(
bob_id_df = CompDataFrame.from_distdata(
ctx,
input_table,
load_labels=False,
load_features=False,
load_ids=True,
load_labels=False,
col_selects=bob_ids,
)
).to_pandas(check_null=False)
wait(
bob(save)(
Expand Down Expand Up @@ -590,19 +593,17 @@ docker image inspect secretflow/sf-dev-anolis8:test_compare

```shell

# ${USER}: 表示部署secretpad时使用的用户名称,可以通过命令"docker ps"查看secretpad容器名称
docker cp ${USER}-kuscia-secretpad:/app/scripts/update-sf-components.sh . && chmod +x update-sf-components.sh
#获取脚本('pad容器id'替换为真实pad容器id)
docker cp pad容器id:/app/scripts/update-sf-components.sh . && chmod +x update-sf-components.sh
```

### 1.2. 运行工具脚本

```shell
# -u: 指定 ${USER}。若不指定,则使用系统默认${USER},通过命令echo ${USER}查看
# -i: 指定自定义Secretflow组件镜像为 "secretflow/sf-dev-anolis8:test_compare"
# 中心化部署
sed -i 's/SECRETPAD_CONTAINER_NAME="${DEPLOY_USER}-kuscia-secretpad"/SECRETPAD_CONTAINER_NAME="${DEPLOY_USER}-kuscia-master-secretpad"/g' update-sf-components.sh
./update-sf-components.sh -u ${USER} -i secretflow/sf-dev-anolis8:test_compare
# P2P部署
#更新组件('pad容器id'替换为真实pad容器id)
sed -i 's/SECRETPAD_CONTAINER_NAME="${DEPLOY_USER}-kuscia-secretpad"/SECRETPAD_CONTAINER_NAME="pad容器id"/g' update-sf-components.sh
./update-sf-components.sh -u ${USER} -i secretflow/sf-dev-anolis8:test_compare

# 查看更多帮助信息
Expand All @@ -611,7 +612,7 @@ sed -i 's/SECRETPAD_CONTAINER_NAME="${DEPLOY_USER}-kuscia-secretpad"/SECRETPAD_C

## 2. 在Kuscia中注册自定义算法镜像

有关将自定义Secretflow组件镜像注册到Kuscia ,请参考[注册自定义算法镜像](https://www.secretflow.org.cn/docs/kuscia/latest/zh-Hans/development/register_custom_image)
有关将自定义Secretflow组件镜像注册到Kuscia ,请参考[注册自定义算法镜像](https://www.secretflow.org.cn/docs/kuscia/latest/zh-Hans/development/register_custom_image#id6)

⚠️**注意事项**

Expand All @@ -635,11 +636,11 @@ sed -i 's/SECRETPAD_CONTAINER_NAME="${DEPLOY_USER}-kuscia-secretpad"/SECRETPAD_C

📎[bob_bank_account.csv](https://www.yuque.com/attachments/yuque/0/2023/csv/29690418/1692964412445-26b38397-cac9-4223-938e-9c08ca4e612e.csv)

请在alice节点导入alice_bank_account
请在alice节点导入alice_bank_account,deposit_alice字段改为string

![Import_Data](../imgs/import_data.png)

然后在bob节点导入bob_bank_account
请在 bob 节点导入 bob_bank_account,deposit_bob字段改为string

![Import_Data2](../imgs/import_data2.png)

Expand Down
39 changes: 39 additions & 0 deletions docs/all-in-one/p2p_deploy/autonomy_node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 添加autonomy_node节点

可以通过<添加autonomy_node节点>来实现一个机构多节点的功能。

## step1:新增计算节点

点击<新增计算节点>

![Autonomy_node1](../imgs/autonomy_node1.png)

输入节点名称

![Autonomy_node2](../imgs/autonomy_node2.png)

可以看到如下节点,点击alice-isv-01节点,可以看到节点相关信息,此时节点状态为不可用。

![Autonomy_node3](../imgs/autonomy_node3.png)
![Autonomy_node4](../imgs/autonomy_node4.png)

## step2:在宿主机上进行安装部署

与安装autonomy节点不同点在于执行脚本命令不同,脚本执行后操作步骤相同,这里仅提供相关部署命令。

```shell
# -n:平台节点Id,上图中“mklfcfwy”
# -m:secretpad页面入口地址,宿主机真实ip(ifconfig查看本机ip)和宿主机端口(docker ps查看secretpad容器8080在宿主机映射的端口)
# -t:从页面节点信息中复制获取,如上图
# -p,-k,-g,-q,-x,-P和autonomy节点部署含义相同,此处不再过多介绍

./install.sh autonomy-node -n mklfcfwy -m 'http://xxxxx:8080' -t xdeploy-tokenx -p 38080 -g 38081 -k 38082 -q 38083 -x 38084 -P notls
```

脚本执行过程如下

![Autonomy_node5](../imgs/autonomy_node5.png)

当安装成功后,刷新web页面,可以看到新增的节点已经可用。

![Autonomy_node6](../imgs/autonomy_node6.png)
14 changes: 8 additions & 6 deletions docs/all-in-one/p2p_deploy/cooperation_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ ifconfig

![Cooperation1](../imgs/cooperation_p2p1.png)

根据本机真实IP(ifconfig获取),部署时-p指定的端口(docker ps 查看kuscia容器1080在宿主机映射的端口),修改通讯地址

推荐用“节点认证码”用于给其他方进行<添加合作节点>操作。

![Cooperation2](../imgs/cooperation_p2p2.png)

## Step2:添加合作节点

Step1:点击<添加合作节点>

Step2:输入要添加的合作节点的节点认证码(输入后点击<识别解析>
默认填充合作节点名称、ID、通讯地址、公钥),点击确定即可建立合作关系;也可以手动输入合作节点的名称、节点ID、通讯地址和公钥.
点击<添加合作节点>
![Cooperation3](../imgs/cooperation_p2p3.png)

1.输入要添加的合作节点的节点认证码
2.输入后点击<识别解析>
3.修改为本机IP,并选择对应的协议
<font color=#DF2A3F>重要:合作双方需分别添加对应合作节点</font>

![Cooperation3](../imgs/cooperation_p2p3.png)
![Cooperation4](../imgs/cooperation_p2p4.png)
![Cooperation4](../imgs/cooperation_p2p4.png)
Tips:节点通讯地址协议是根据平台安装时「-P 参数(默认是TLS)」自动生成,NOTLS对应http,TLS和MTLS对应https。
34 changes: 31 additions & 3 deletions docs/all-in-one/p2p_deploy/function_description/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

上传数据后,可设置数据表名称、输入数据表描述及特征描述后点击“提交”。

<font color=#DF2A3F>重要:特征名称需和实际文件的schame名称保持一致。</font>
<font color=#DF2A3F>重要:特征名称需和实际文件的 schame 名称保持一致。</font>

![Data3](../../imgs/data12.png)

Expand All @@ -41,8 +41,36 @@
![Data5](../../imgs/data5.png)
![Data6](../../imgs/data6.png)

## 5. 取消授权
## 5. 安全配置

如需对某一项目取消数据授权,点击“授权管理”—“取消授权”即可
在数据授权的时候,启用了数据表安全设置功能,针对表字段增加关联键,分组列,保护开关配置,目前安全配置仅适用于 SCQL 联合分析组件,可以根据实际情况进行配置,以下将会以隐私求交相关组件为例。

![Data13](../../imgs/data13.png)
![Data14](../../imgs/data14.png)

点击安全配置说明可以查看具体配置规则

![Data15](../../imgs/data15.png)

安全配置包含:
**关联键**:注意选择关联键时,保护开关会自动打开,且无法同时选择分组列。
**分组列**:注意选择分组列时,保护开关会自动打开,且无法同时选择关联键。

![Data16](../../imgs/data16.png)

保护开关:如果关闭,字段将不被保护,字段数值可以明文透出在结果中,字段可以任意操作;当打开时,经比较函数、聚合函数处理后,才能出现在SELECT的分析结果中;注意保护开关可以单独打开。

隐私求交仅使用了求交键,打开id1的保护开关。

![Data17](../../imgs/data17.png)
![Data18](../../imgs/data18.png)

其它具体配置场景,建议在配置授权时,查看安全配置说明。

![Data19](../../imgs/data19.png)

## 6. 取消授权

如需对某项目取消数据授权,点击“授权管理”—“取消授权”即可

![Data7](../../imgs/data7.png)
1 change: 1 addition & 0 deletions docs/all-in-one/p2p_deploy/function_description/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
data
project
result
timecycle_task
message
33 changes: 33 additions & 0 deletions docs/all-in-one/p2p_deploy/function_description/timecycle_task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 定时周期任务

## 1.模块说明

本模块主要是对部署周期任务进行说明,包括使用说明和配置说明。

## 2.部署周期任务

部署周期任务,需要首先执行成功一次任务流,并且周期任务选择的样本表,通常是分区表,如下:

![Timecycle1](../../imgs/timecycle1.png)

新建周期任务需要填写如下信息:任务描述,调度时间范围,调度周期,指定日期,指定时刻。

![Timecycle2](../../imgs/timecycle2.png)

**任务ID**:由前端调用SecretPad后端生成,随机字符串和时间戳(并非是在kuscia中查看的jobId)
**调度时间**:范围需要大于等于24小时
**调度周期**:分为日,周,月维度,日维度代表每天执行,没有指定日期选项,周维度可以指定周中某一天或某几天,月维度可以指定月中某一天或某几天
**指定时刻**:任务具体的执行时间
本文将以日维度介绍周期任务

定时任务设置完成保存之后,可以在画布上的周期任务列表中看到发布的周期任务。

![Timecycle3](../../imgs/timecycle3.png)

点击任务ID可以看到具体执行的任务。

![Timecycle4](../../imgs/timecycle4.png)

调度历史中包含任务执行记,本次示例是以日维度,每天14:13执行任务,运行成功后,如下图:

![Timecycle5](../../imgs/timecycle5.png)
1 change: 1 addition & 0 deletions docs/all-in-one/p2p_deploy/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ P2P部署模式

platform_installation_guidelines
cooperation_node
autonomy_node
modeling_tasks
model_deployment
./function_description/index
2 changes: 1 addition & 1 deletion docs/all-in-one/p2p_deploy/model_deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

![Step3.2](../imgs/model_deployment6.png)

点击确定后,模型即可发布成功,可查看模型,并使用模型ID和endpoints构建特征服务API,详见:https://www.secretflow.org.cn/zh-CN/docs/kuscia/v0.6.0b0/tutorial/run_sf_serving_with_api_cn
点击确定后,模型即可发布成功,可查看模型,并使用模型ID和endpoints构建特征服务API,详见:https://www.secretflow.org.cn/zh-CN/docs/kuscia/main/tutorial/run_sf_serving_with_api_cn#id5

![Step3.3](../imgs/model_deployment7.png)

Expand Down
Loading

0 comments on commit 57c41fa

Please sign in to comment.