diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-service/Dockerfile" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-service/Dockerfile"
new file mode 100644
index 0000000000000000000000000000000000000000..ce0f38995189c3b7825c8c080b3235194fad41e1
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-service/Dockerfile"
@@ -0,0 +1,11 @@
+FROM wefe_java_base
+
+WORKDIR /opt/service
+
+COPY board-service.jar /opt/service/board-service.jar
+
+COPY start.sh /opt/service/start.sh
+
+# RUN chmod +x /opt/service/start.sh
+
+CMD ["sh", "/opt/service/start.sh"]
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-service/board-service.md" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-service/board-service.md"
new file mode 100644
index 0000000000000000000000000000000000000000..d6ab8dcb8715709651ceb97732d7aa876e80bea7
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-service/board-service.md"
@@ -0,0 +1,92 @@
+#打jar包
+```shell
+mvn clean install -Dmaven.test.skip=true -am -pl board/board-service
+```
+#Dockerfile手动打镜像并且保存为离线版
+```shell
+FROM wefe_java_base
+
+WORKDIR /opt/service
+
+COPY board-service.jar /opt/service/board-service.jar
+
+COPY start.sh /opt/service/start.sh
+
+# RUN chmod +x /opt/service/start.sh
+
+CMD ["sh", "/opt/service/start.sh"]
+
+```
+
+#启动脚本start.sh
+```shell
+java -jar -Dconfig.path=config.properties board-service.jar
+```
+
+#镜像构建
+```shell
+sudo docker build -t wefe_board_service:$WEFE_VERSION .
+sudo docker save -o wefe_board_service_$WEFE_VERSION.tar wefe_board_service:$WEFE_VERSION
+```
+
+#docker-compose.yml
+```shell
+version: "3"
+services:
+
+ wefe_board_service:
+ image: wefe_board_service:v.2.2 # wefe_version
+ ports:
+ - 8080:8080 # service_port
+ restart: always
+ privileged: true
+ networks:
+ - network
+ volumes:
+ - "/data/wefe/docker-compose/logs/service:/data/logs/wefe-board-service" # service_logs
+ - "./mount/start.sh:/opt/service/start.sh"
+ - "./mount/config.properties:/opt/service/config.properties"
+ - "./mount/application.properties:/opt/service/application.properties"
+ - "./mount/board-service.jar:/opt/service/board-service.jar"
+
+networks:
+ network:
+ driver: bridge
+```
+#启动脚本wefe_board_service_start.sh
+```shell
+#!/bin/bash
+
+# 导入配置
+source ../wefe.cfg
+
+# 修改服务启动配置
+sed -i "/service_logs/s@-.*:@- \"$DATA_PATH/logs/service:@g" ./resources/docker-compose.yml
+sed -i "/wefe_version/s/service:.*#/service:$WEFE_VERSION #/g" ./resources/docker-compose.yml
+
+# 修改镜像文件配置
+sed -i "/service_port/s/-.*:/- $BOARD_SERVICE_PORT:/g" ./resources/docker-compose.yml
+
+# 加载本地离线镜像包
+echo "开始加载 board-service 离线镜像"
+docker load < resources/wefe_board_service_${WEFE_VERSION}\.tar
+echo "加载 board-service 离线镜像完成"
+
+docker-compose -p $WEFE_ENV -f resources/docker-compose.yml up -d
+
+```
+#停止脚本wefe_board_service_stop.sh
+```shell
+#!/bin/bash
+
+docker-compose -p wefe -f resources/docker-compose.yml down
+
+```
+
+
+
+在界面上成员信息配置各自的gateway地址:
+10.10.178.147:50051
+10.10.178.148:50051
+在界面上系统配置信息配置
+
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-service/config.properties" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-service/config.properties"
new file mode 100644
index 0000000000000000000000000000000000000000..842494a2dda20e3bc2bf0218ec7231721904439e
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-service/config.properties"
@@ -0,0 +1,147 @@
+# ************************************************
+# The configuration for job
+# ************************************************
+
+# Environment name, different configuration files for different environments .
+# Enums: prod銆乨ev銆乫at銆乶one
+# Default is none
+env.name=prod
+
+# Different branches have different functions
+# Enums: master銆乷nline_demo
+env.branch=master
+
+# 鏂囦欢涓婁紶鐩稿叧鍔熻兘浼氬皢鏂囦欢缁熶竴涓婁紶鍒版鐩綍
+wefe.file.upload.dir=/data/wefe_file_upload_dir
+
+# base url of union
+wefe.union.base-url=https://wefe.tianmiantech.com/union-service/
+
+# base url of serving
+wefe.serving.base-url=
+
+# Working mode of modeling tasks
+# Use integer type definition: Cluster mode=1, stand-alone mode=0
+# If work_mode=1 is used, multi-party interaction needs to go through the gateway
+# work_mode=SPARK
+wefe.job.work_mode=1
+
+# ************************************************
+# The configuration for storing data
+# ************************************************
+
+# The type of database which data is stored in CLICKHOUSE or LMDB
+# LMDB is suitable for the stand-alone mode, and clickhouse is suitable for the cluster mode
+db.storage.type=CLICKHOUSE
+
+# If CLICKHOUSE is used, the following configuration is included
+# In general, you need to change the url銆乭ost銆乸ort銆乽sername銆乸assword , the other use by default
+db.storage.clickhouse.driverClassName=ru.yandex.clickhouse.ClickHouseDriver
+db.storage.clickhouse.url=jdbc:clickhouse://10.10.178.147:8122
+db.storage.clickhouse.host=10.10.178.147
+db.storage.clickhouse.tcp.port=9900
+db.storage.clickhouse.username=wefe
+db.storage.clickhouse.password=wefe2020
+db.storage.clickhouse.initialSize=1
+db.storage.clickhouse.maxActive=50
+db.storage.clickhouse.minIdle=1
+db.storage.clickhouse.maxWait=60000
+db.storage.clickhouse.testWhileIdle=true
+db.storage.clickhouse.validationQuery=SELECT 1
+db.storage.clickhouse.timeBetweenEvictionRunsMillis=5000
+db.storage.clickhouse.minEvictableIdleTimeMillis=10000
+db.storage.clickhouse.removeAbandoned=true
+db.storage.clickhouse.removeAbandonedTimeout=300
+db.storage.clickhouse.logAbandoned=true
+# The batch size of written to CLICKHOUSE in bulk锛孶nits: M(support for sub-counts)
+db.storage.clickhouse.optimal.insert.byte.size=1
+
+# If LMDB is used, the following configuration is included
+lmdb.database.name=lmdbtest
+lmdb.max.size=256
+lmdb.database.count=10
+lmdb.path=/data/lmdb
+lmdb.partitions=8
+
+# ************************************************
+# The configuration for business database mysql
+# mysql is used to save modeling processes, modeling information, member information, and more
+# ************************************************
+
+db.mysql.url=jdbc:mysql://10.10.178.147:4406/wefe_board?serverTimezone=GMT%2B8
+db.mysql.host=10.10.178.147
+db.mysql.port=4406
+db.mysql.database=wefe_board
+db.mysql.username=wefe
+db.mysql.password=wefe2020
+
+# ************************************************
+# The configuration for flow
+# ************************************************
+
+# The root of the flow log, which supports relative paths
+flow.log.root.path=./logs
+
+wefe.job.backend=SPARK
+
+# ************************************************
+# If you are using the spark backend, the following configuration is required
+# ************************************************
+
+flow.spark.submit.default.driver.memory=15g
+flow.spark.submit.default.driver.maxResultSize=2g
+flow.spark.submit.default.num.executors=6
+flow.spark.submit.default.executor.memory=2g
+flow.spark.submit.default.executor.cores=1
+flow.spark.default.num.slices=32
+
+# ************************************************
+# If you are using the fc backend, the following configuration is required
+# ************************************************
+
+# the type of intermediate data in function calculates锛宱nly ots is supported
+fc.storage.type=oss
+
+# the region of function calculates
+fc.region=cn-shenzhen
+
+# the alias for the function call
+fc.qualifier=LATEST
+
+# the service name for the function call
+fc.service.name=wefe-fc
+
+# the account ID for the function call
+fc.account_id=xxx
+
+# the access key id for the function call
+fc.access_key_id=xxx
+
+# the access key secret for the function call
+fc.access_key_secret=xxx
+
+# the end point for the function call
+fc.end_point=https://xxx.cn-shenzhen.fc.aliyuncs.com
+
+# instance name of ots
+fc.ots.instance_name=fc-***
+
+# the end point of the ots internal and external network
+fc.ots.internal_end_point=https://fc-***.cn-shenzhen.ots.aliyuncs.com
+fc.ots.end_point=https://fc-***.cn-shenzhen.ots.aliyuncs.com
+
+# Used to send intermediate data generated during calculations at oss
+fc.cloud_store.temp_auth_internal_end_point=https://oss-cn-shenzhen-internal.aliyuncs.com
+fc.cloud_store.temp_auth_end_point=https://oss-cn-shenzhen.aliyuncs.com
+fc.cloud_store.temp_auth_role_arn=acs:ram::xxx:role/wefe-fc-ossread
+fc.cloud_store.temp_auth_role_session_name=tianmian
+fc.cloud_store.temp_auth_duration_seconds=36000
+
+
+# ************************************************
+# oss configuration for fc
+# ************************************************
+fc.oss.bucket_name=xxx
+fc.oss.endpoint=http://oss-cn-shenzhen.aliyuncs.com
+fc.oss.internal_endpoint=http://oss-cn-shenzhen-internal.aliyuncs.com
+
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-service/img.png" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-service/img.png"
new file mode 100644
index 0000000000000000000000000000000000000000..2b78c258a748465947a0e490742d890b87200643
Binary files /dev/null and "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-service/img.png" differ
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-service/start.sh" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-service/start.sh"
new file mode 100644
index 0000000000000000000000000000000000000000..84394559c7f9379f82a2ca6857933183a6c0607f
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-service/start.sh"
@@ -0,0 +1 @@
+java -jar -Dconfig.path=config.properties board-service.jar
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-website/board-website.md" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-website/board-website.md"
new file mode 100644
index 0000000000000000000000000000000000000000..c3d556766f1c380e5cce01331fefbadf4220ad94
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/board-website/board-website.md"
@@ -0,0 +1,97 @@
+#前端打包
+```shell
+npm build
+```
+#打前端镜像
+```shell
+FROM nginx:1.19.2
+
+WORKDIR /opt/website
+
+ADD html.tar /opt/website/
+```
+
+#打前端镜像
+```shell
+sudo docker build -t wefe_board_website:$WEFE_VERSION .
+sudo docker save -o wefe_board_website_$WEFE_VERSION.tar wefe_board_website:$WEFE_VERSION
+```
+
+#docker-compose
+```shell
+version: "3"
+services:
+
+ wefe_board_website:
+ image: wefe_board_website:v.2.2 # wefe_version
+ ports:
+ - 80:80 # website_port
+ restart: always
+ privileged: true
+ networks:
+ - network
+ volumes:
+ - "./mount/index.html:/opt/website/html/board-website/index.html"
+ - "./mount/default.conf:/etc/nginx/conf.d/default.conf"
+ - "./mount/html:/opt/website/html"
+
+networks:
+ network:
+ driver: bridge
+```
+
+#nginx配置
+```shell
+server {
+
+ listen 80;
+ server_name 10.10.178.147;
+
+ root /opt/website/html;
+
+ client_max_body_size 100m;
+
+ location /board-website/ {
+ try_files $uri /board-website/index.html;
+ }
+
+ location /board-service/ {
+ add_header Access-Control-Allow-Origin *;
+ add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
+ add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
+
+ if ($request_method = 'OPTIONS') {
+ return 204;
+ }
+
+ proxy_pass http://10.10.178.147:8080/board-service/;
+ proxy_read_timeout 1800;
+ }
+
+}
+
+```
+#启动脚本wefe_board_website_start.sh
+```shell
+#!/bin/bash
+
+# 导入配置
+source ../wefe.cfg
+
+# Nginx 配置文件修改
+sed -i "/server_name/s/server_name.*;/server_name $EXTRANET_IP;/g" ./resources/mount/default.conf
+sed -i "/proxy_pass/s@proxy_pass.*;@proxy_pass http://$EXTRANET_IP:$BOARD_SERVICE_PORT/board-service/;@g" ./resources/mount/default.conf
+
+# 修改静态文件
+sed -i "s@baseUrl.*/board-service@baseUrl: \"http://$EXTRANET_IP:$NGINX_PORT/board-service@g" ./resources/mount/index.html
+sed -i "/wefe_version/s/website:.*#/website:$WEFE_VERSION #/g" ./resources/docker-compose.yml
+sed -i "/website_port/s/-.*:/- $NGINX_PORT:/g" ./resources/docker-compose.yml
+
+echo "开始加载 board-website 离线镜像"
+docker load < resources/wefe_board_website_${WEFE_VERSION}\.tar
+echo "加载 board-website 离线镜像完成"
+
+docker-compose -p $WEFE_ENV -f resources/docker-compose.yml up -d
+
+```
+#停止脚本wefe_board_website_stop.sh
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/gateway/Dockerfile" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/gateway/Dockerfile"
new file mode 100644
index 0000000000000000000000000000000000000000..8012615aab027ca2356900101d627c3795f19442
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/gateway/Dockerfile"
@@ -0,0 +1,11 @@
+FROM wefe_java_base
+
+WORKDIR /opt/gateway
+
+COPY gateway.jar /opt/gateway/gateway.jar
+
+COPY start.sh /opt/gateway/start.sh
+
+# RUN chmod +x /opt/gateway/start.sh
+
+CMD ["sh", "/opt/gateway/start.sh"]
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/gateway/config.properties" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/gateway/config.properties"
new file mode 100644
index 0000000000000000000000000000000000000000..842494a2dda20e3bc2bf0218ec7231721904439e
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/gateway/config.properties"
@@ -0,0 +1,147 @@
+# ************************************************
+# The configuration for job
+# ************************************************
+
+# Environment name, different configuration files for different environments .
+# Enums: prod銆乨ev銆乫at銆乶one
+# Default is none
+env.name=prod
+
+# Different branches have different functions
+# Enums: master銆乷nline_demo
+env.branch=master
+
+# 鏂囦欢涓婁紶鐩稿叧鍔熻兘浼氬皢鏂囦欢缁熶竴涓婁紶鍒版鐩綍
+wefe.file.upload.dir=/data/wefe_file_upload_dir
+
+# base url of union
+wefe.union.base-url=https://wefe.tianmiantech.com/union-service/
+
+# base url of serving
+wefe.serving.base-url=
+
+# Working mode of modeling tasks
+# Use integer type definition: Cluster mode=1, stand-alone mode=0
+# If work_mode=1 is used, multi-party interaction needs to go through the gateway
+# work_mode=SPARK
+wefe.job.work_mode=1
+
+# ************************************************
+# The configuration for storing data
+# ************************************************
+
+# The type of database which data is stored in CLICKHOUSE or LMDB
+# LMDB is suitable for the stand-alone mode, and clickhouse is suitable for the cluster mode
+db.storage.type=CLICKHOUSE
+
+# If CLICKHOUSE is used, the following configuration is included
+# In general, you need to change the url銆乭ost銆乸ort銆乽sername銆乸assword , the other use by default
+db.storage.clickhouse.driverClassName=ru.yandex.clickhouse.ClickHouseDriver
+db.storage.clickhouse.url=jdbc:clickhouse://10.10.178.147:8122
+db.storage.clickhouse.host=10.10.178.147
+db.storage.clickhouse.tcp.port=9900
+db.storage.clickhouse.username=wefe
+db.storage.clickhouse.password=wefe2020
+db.storage.clickhouse.initialSize=1
+db.storage.clickhouse.maxActive=50
+db.storage.clickhouse.minIdle=1
+db.storage.clickhouse.maxWait=60000
+db.storage.clickhouse.testWhileIdle=true
+db.storage.clickhouse.validationQuery=SELECT 1
+db.storage.clickhouse.timeBetweenEvictionRunsMillis=5000
+db.storage.clickhouse.minEvictableIdleTimeMillis=10000
+db.storage.clickhouse.removeAbandoned=true
+db.storage.clickhouse.removeAbandonedTimeout=300
+db.storage.clickhouse.logAbandoned=true
+# The batch size of written to CLICKHOUSE in bulk锛孶nits: M(support for sub-counts)
+db.storage.clickhouse.optimal.insert.byte.size=1
+
+# If LMDB is used, the following configuration is included
+lmdb.database.name=lmdbtest
+lmdb.max.size=256
+lmdb.database.count=10
+lmdb.path=/data/lmdb
+lmdb.partitions=8
+
+# ************************************************
+# The configuration for business database mysql
+# mysql is used to save modeling processes, modeling information, member information, and more
+# ************************************************
+
+db.mysql.url=jdbc:mysql://10.10.178.147:4406/wefe_board?serverTimezone=GMT%2B8
+db.mysql.host=10.10.178.147
+db.mysql.port=4406
+db.mysql.database=wefe_board
+db.mysql.username=wefe
+db.mysql.password=wefe2020
+
+# ************************************************
+# The configuration for flow
+# ************************************************
+
+# The root of the flow log, which supports relative paths
+flow.log.root.path=./logs
+
+wefe.job.backend=SPARK
+
+# ************************************************
+# If you are using the spark backend, the following configuration is required
+# ************************************************
+
+flow.spark.submit.default.driver.memory=15g
+flow.spark.submit.default.driver.maxResultSize=2g
+flow.spark.submit.default.num.executors=6
+flow.spark.submit.default.executor.memory=2g
+flow.spark.submit.default.executor.cores=1
+flow.spark.default.num.slices=32
+
+# ************************************************
+# If you are using the fc backend, the following configuration is required
+# ************************************************
+
+# the type of intermediate data in function calculates锛宱nly ots is supported
+fc.storage.type=oss
+
+# the region of function calculates
+fc.region=cn-shenzhen
+
+# the alias for the function call
+fc.qualifier=LATEST
+
+# the service name for the function call
+fc.service.name=wefe-fc
+
+# the account ID for the function call
+fc.account_id=xxx
+
+# the access key id for the function call
+fc.access_key_id=xxx
+
+# the access key secret for the function call
+fc.access_key_secret=xxx
+
+# the end point for the function call
+fc.end_point=https://xxx.cn-shenzhen.fc.aliyuncs.com
+
+# instance name of ots
+fc.ots.instance_name=fc-***
+
+# the end point of the ots internal and external network
+fc.ots.internal_end_point=https://fc-***.cn-shenzhen.ots.aliyuncs.com
+fc.ots.end_point=https://fc-***.cn-shenzhen.ots.aliyuncs.com
+
+# Used to send intermediate data generated during calculations at oss
+fc.cloud_store.temp_auth_internal_end_point=https://oss-cn-shenzhen-internal.aliyuncs.com
+fc.cloud_store.temp_auth_end_point=https://oss-cn-shenzhen.aliyuncs.com
+fc.cloud_store.temp_auth_role_arn=acs:ram::xxx:role/wefe-fc-ossread
+fc.cloud_store.temp_auth_role_session_name=tianmian
+fc.cloud_store.temp_auth_duration_seconds=36000
+
+
+# ************************************************
+# oss configuration for fc
+# ************************************************
+fc.oss.bucket_name=xxx
+fc.oss.endpoint=http://oss-cn-shenzhen.aliyuncs.com
+fc.oss.internal_endpoint=http://oss-cn-shenzhen-internal.aliyuncs.com
+
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/gateway/gateway.md" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/gateway/gateway.md"
new file mode 100644
index 0000000000000000000000000000000000000000..1661bfa0bb4fea2c15c38886db15136d0d6a2b30
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/gateway/gateway.md"
@@ -0,0 +1,48 @@
+#打jar包
+```shell
+mvn clean install -Dmaven.test.skip=true -am -pl gateway
+```
+#手动打镜像并且保存为离线版
+```shell
+FROM wefe_java_base
+
+WORKDIR /opt/gateway
+
+COPY gateway.jar /opt/gateway/gateway.jar
+
+COPY start.sh /opt/gateway/start.sh
+
+# RUN chmod +x /opt/gateway/start.sh
+
+CMD ["sh", "/opt/gateway/start.sh"]
+
+
+```
+
+#sh
+```shell
+#!/bin/bash
+java -jar gateway.jar
+```
+#制作镜像
+```shell
+
+sudo docker build -t wefe_gateway_service:$WEFE_VERSION .
+sudo docker save -o wefe_gateway_service_$WEFE_VERSION.tar wefe_gateway_service:$WEFE_VERSION
+```
+
+#Dockerfile
+```shell
+FROM wefe_java_base
+
+WORKDIR /opt/gateway
+
+COPY gateway.jar /opt/gateway/gateway.jar
+COPY config.properties /opt/gateway/config.properties
+COPY start.sh /opt/gateway/start.sh
+
+# RUN chmod +x /opt/gateway/start.sh
+
+CMD ["sh", "/opt/gateway/start.sh"]
+
+```
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/gateway/satrt.sh" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/gateway/satrt.sh"
new file mode 100644
index 0000000000000000000000000000000000000000..9863fec4ce53e4bd5e0d52186c00fc144360fd9e
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/gateway/satrt.sh"
@@ -0,0 +1,2 @@
+#!/bin/bash
+java -jar gateway.jar
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/java-base/java-base.md" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/java-base/java-base.md"
new file mode 100644
index 0000000000000000000000000000000000000000..44344d2cabf0a703ed2d5f4445fe0fbb40923d49
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/java-base/java-base.md"
@@ -0,0 +1,24 @@
+```dockerfile
+# 指定基础镜像
+FROM centos:centos7.5.1804
+#语言编码设置
+RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
+ENV LC_ALL zh_CN.UTF-8
+# 修改时区
+RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' > /etc/timezone
+# 指定构建镜像时的工作目录
+WORKDIR /opt/docker_jdk
+# 复制文件到镜像中
+ADD jdk-8u261-linux-x64.tar.gz /opt/docker_jdk/
+# 配置环境变量
+ENV JAVA_HOME=/opt/docker_jdk/jdk1.8.0_261
+ENV CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
+ENV PATH=$JAVA_HOME/bin:$PATH
+
+```
+
+#镜像构建
+```dockerfile
+ sudo docker build -t wefe_java_base .
+```
+
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/middleware-service/middleware-service.md" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/middleware-service/middleware-service.md"
new file mode 100644
index 0000000000000000000000000000000000000000..2048b5df59f0007bbdf78034e38954e15819ec72
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/middleware-service/middleware-service.md"
@@ -0,0 +1,45 @@
+#docker-compose.yml
+```shell
+version: "3"
+services:
+
+ wefe_middleware_service_clickhouse:
+ image: yandex/clickhouse-server:20.6.5.8
+ restart: always
+ ports:
+ - 8122:8123 # clickhouse_port
+ - 9900:9000 # clickhouse_tcp_port
+ privileged: true
+ networks:
+ - network
+ volumes:
+ - "/data/wefe/docker-compose/clickhouse:/var/lib/clickhouse" # clickhouse_data
+ - "./mount/clickhouse/config.xml:/etc/clickhouse-server/config.xml"
+ - "./mount/clickhouse/users.xml:/etc/clickhouse-server/users.xml"
+ - "./mount/clickhouse/clickhouse_init_db.sh:/docker-entrypoint-initdb.d/init-db.sh"
+ wefe_middleware_service_mysql:
+ image: mysql:5.7.24
+ environment:
+ MYSQL_ROOT_PASSWORD: "wefe2020"
+ MYSQL_USER: "wefe"
+ MYSQL_PASSWORD: "wefe2020"
+ MYSQL_DATABASE: "wefe_board"
+ command: [
+ '--character-set-server=utf8mb4',
+ '--collation-server=utf8mb4_unicode_ci',
+ '--default-time-zone=+8:00'
+ ]
+ ports:
+ - 4406:3306 # mysql_port
+ restart: always
+ privileged: true
+ networks:
+ - network
+ volumes:
+ - '/data/wefe/docker-compose/mysql:/var/lib/mysql' # mysql_data
+ - './mount/sql/wefe_board.sql:/docker-entrypoint-initdb.d/wefe_board.sql'
+
+networks:
+ network:
+ driver: bridge
+```
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-base/python-base.md" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-base/python-base.md"
new file mode 100644
index 0000000000000000000000000000000000000000..d9a1a69007252a98fba9916cbabb86ea76d7839d
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-base/python-base.md"
@@ -0,0 +1,195 @@
+#手动打镜,替换为自己的spark,Dockerfile
+
+```shell
+#基础镜像为centos,版本为7,build镜像时会自动下载
+FROM centos:centos7.5.1804
+
+#语言编码设置
+RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
+ENV LC_ALL zh_CN.UTF-8
+
+# 修改时区
+RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' > /etc/timezone \
+&& yum -y install gcc gcc-c++ make openssl-devel gmp-devel mpfr-devel libmpc-devel libaio numactl \
+autoconf automake libtool libffi-devel snappy snappy-devel zlib zlib-devel bzip2 bzip2-devel lz4-devel \
+libasan lsof sysstat telnet psmisc python3-devel wget less vim
+
+# 本地环境路径
+ARG LOCAL_ENV_BASE=.
+
+# 镜像环境路径
+ARG ENV_BASE=/data/environment
+ARG MINICONDA_DIR=$ENV_BASE/miniconda3
+ARG PYTHON_DIR=$ENV_BASE/miniconda3/envs/wefe-python37
+ARG SPARK_DIR=$ENV_BASE/spark-3.2.0-bin-hadoop2.7
+ARG JDK_DIR=$ENV_BASE/jdk1.8.0_241
+ARG OSSUTIL_DIR=$ENV_BASE/ossutil
+ARG NODEJS_DIR=$ENV_BASE/nodejs
+ARG FUN_ENVIRONMENT_DIR=$ENV_BASE/.s/python
+
+# 在镜像创建目录
+RUN mkdir -p $MINICONDA_DIR \
+&& mkdir -p $SPARK_DIR \
+&& mkdir -p $JDK_DIR \
+&& mkdir -p $OSSUTIL_DIR \
+&& mkdir -p $NODEJS_DIR \
+&& mkdir -p $FUN_ENVIRONMENT_DIR
+
+
+# 复制 miniconda 的 python 环境
+COPY $LOCAL_ENV_BASE/miniconda3 $MINICONDA_DIR/
+
+# 复制 spark 环境
+COPY $LOCAL_ENV_BASE/spark-3.2.0-bin-hadoop2.7 $SPARK_DIR/
+
+# 复制 jdk 环境
+COPY $LOCAL_ENV_BASE/jdk1.8.0_241 $JDK_DIR/
+
+# 复制 ossutil
+COPY $LOCAL_ENV_BASE/ossutil $OSSUTIL_DIR
+
+# 复制 nodejs 环境,包含 serverless devs 工具
+COPY $LOCAL_ENV_BASE/nodejs $NODEJS_DIR
+
+# 复制函数计算依赖
+#COPY $LOCAL_ENV_BASE/python $FUN_ENVIRONMENT_DIR
+
+# 配置环境变量
+ENV JAVA_HOME $JDK_DIR
+ENV PATH $JAVA_HOME/bin:$PATH
+# Spark
+ENV SPARK_HOME $SPARK_DIR
+ENV PATH $SPARK_HOME/bin:$PATH
+ENV LD_LIBRARY_PATH $SPARK_HOME/jars
+
+ENV PYTHON_HOME $PYTHON_DIR
+ENV PATH $PYTHON_HOME/bin:$PATH
+
+ENV NODE_HOME $NODEJS_DIR
+ENV PATH $NODE_HOME/bin:$PATH
+ENV NODE_PATH $NODE_HOME/lib/node_modules
+```
+
+
+#镜像构建
+```shell
+sudo docker build -t wefe_python_base .
+```
+
+#flow/service.sh
+```shell
+#!/bin/bash
+
+#!/bin/bash
+export PYTHONPATH=/opt/welab/wefe
+export SPARK_HOME=/data/environment/spark-3.2.0-bin-hadoop2.7
+# export PYSPARK_PYTHON=/data/spark-2.4.5-bin-hadoop2.7/python
+# PYTHON_ROOT=$(dirname "$PWD")
+PYTHON_ROOT=/opt/welab/wefe
+#log_dir=${PYTHON_ROOT}/logs
+log_dir=/data/logs/flow_server
+
+#venv=/data/environment/venv
+venv=/data/environment/miniconda3/envs/wefe-python37
+flowUrl=http://0.0.0.0:5000
+
+getpid() {
+ pid=$(ps -ef|grep python|grep app_launcher.py|grep -v grep|awk '{print $2}')
+
+ if [[ -n ${pid} ]]; then
+ return 1
+ else
+ return 0
+ fi
+}
+
+mklogsdir() {
+ if [[ ! -d $log_dir ]]; then
+ mkdir -p $log_dir
+ fi
+}
+
+status() {
+ getpid
+ if [[ -n ${pid} ]]; then
+ echo "status:
+ `ps aux | grep ${pid} | grep -v grep`"
+ return 1
+ else
+ echo "service not running"
+ return 0
+ fi
+}
+
+clean_pyc(){
+ find $PYTHON_ROOT -name '*.pyc' -type f -exec rm {} \;
+}
+
+start() {
+ getpid
+ if [[ $? -eq 0 ]]; then
+
+ mklogsdir
+ # clean_pyc
+
+ source ${venv}/bin/activate
+
+ pip install -r ${PYTHON_ROOT}/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
+
+ python3 ${PYTHON_ROOT}/flow/service/config/fill_config_shell_service.py
+ nohup python3 ${PYTHON_ROOT}/flow/app_launcher.py >> "${log_dir}/console.log" 2>>"${log_dir}/error.log" &
+
+ sleep 3
+ getpid
+ if [[ -n ${pid} ]]; then
+ echo "service start sucessfully. pid: ${pid}"
+ else
+ echo "service start failed, please check ${log_dir}/error.log and ${log_dir}/console.log"
+ fi
+ else
+ echo "service already started. pid: ${pid}"
+ fi
+}
+
+stop() {
+ getpid
+ if [[ -n ${pid} ]]; then
+ echo "killing:
+ `ps aux | grep ${pid} | grep -v grep`"
+ kill -9 ${pid}
+ kill -9 $(ps -ef|grep wefe|grep task_executor|grep -v grep|awk '{print $2}')
+ if [[ $? -eq 0 ]]; then
+ echo "killed"
+ else
+ echo "kill error"
+ fi
+ else
+ echo "service not running"
+ fi
+}
+
+case "$1" in
+ start)
+ start
+ status
+ ;;
+
+ stop)
+ stop
+ ;;
+ status)
+ status
+ ;;
+
+ restart)
+ stop
+ start
+ status
+ ;;
+ *)
+ echo "usage: $0 {start|stop|status|restart}"
+ exit -1
+esac
+
+
+```
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-base/service.sh" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-base/service.sh"
new file mode 100644
index 0000000000000000000000000000000000000000..7521b6276f38fcd81481360872dd44b8252dcece
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-base/service.sh"
@@ -0,0 +1,112 @@
+#!/bin/bash
+
+#!/bin/bash
+export PYTHONPATH=/opt/welab/wefe
+export SPARK_HOME=/data/environment/spark-3.2.0-bin-hadoop2.7
+# export PYSPARK_PYTHON=/data/spark-2.4.5-bin-hadoop2.7/python
+# PYTHON_ROOT=$(dirname "$PWD")
+PYTHON_ROOT=/opt/welab/wefe
+#log_dir=${PYTHON_ROOT}/logs
+log_dir=/data/logs/flow_server
+
+#venv=/data/environment/venv
+venv=/data/environment/miniconda3/envs/wefe-python37
+flowUrl=http://0.0.0.0:5000
+
+getpid() {
+ pid=$(ps -ef|grep python|grep app_launcher.py|grep -v grep|awk '{print $2}')
+
+ if [[ -n ${pid} ]]; then
+ return 1
+ else
+ return 0
+ fi
+}
+
+mklogsdir() {
+ if [[ ! -d $log_dir ]]; then
+ mkdir -p $log_dir
+ fi
+}
+
+status() {
+ getpid
+ if [[ -n ${pid} ]]; then
+ echo "status:
+ `ps aux | grep ${pid} | grep -v grep`"
+ return 1
+ else
+ echo "service not running"
+ return 0
+ fi
+}
+
+clean_pyc(){
+ find $PYTHON_ROOT -name '*.pyc' -type f -exec rm {} \;
+}
+
+start() {
+ getpid
+ if [[ $? -eq 0 ]]; then
+
+ mklogsdir
+ # clean_pyc
+
+ source ${venv}/bin/activate
+
+ pip install -r ${PYTHON_ROOT}/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
+
+ python3 ${PYTHON_ROOT}/flow/service/config/fill_config_shell_service.py
+ nohup python3 ${PYTHON_ROOT}/flow/app_launcher.py >> "${log_dir}/console.log" 2>>"${log_dir}/error.log" &
+
+ sleep 3
+ getpid
+ if [[ -n ${pid} ]]; then
+ echo "service start sucessfully. pid: ${pid}"
+ else
+ echo "service start failed, please check ${log_dir}/error.log and ${log_dir}/console.log"
+ fi
+ else
+ echo "service already started. pid: ${pid}"
+ fi
+}
+
+stop() {
+ getpid
+ if [[ -n ${pid} ]]; then
+ echo "killing:
+ `ps aux | grep ${pid} | grep -v grep`"
+ kill -9 ${pid}
+ kill -9 $(ps -ef|grep wefe|grep task_executor|grep -v grep|awk '{print $2}')
+ if [[ $? -eq 0 ]]; then
+ echo "killed"
+ else
+ echo "kill error"
+ fi
+ else
+ echo "service not running"
+ fi
+}
+
+case "$1" in
+ start)
+ start
+ status
+ ;;
+
+ stop)
+ stop
+ ;;
+ status)
+ status
+ ;;
+
+ restart)
+ stop
+ start
+ status
+ ;;
+ *)
+ echo "usage: $0 {start|stop|status|restart}"
+ exit -1
+esac
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-service/python-service.md" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-service/python-service.md"
new file mode 100644
index 0000000000000000000000000000000000000000..a674cb0419aefd0a3b038b7395928eb55c48fe6e
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-service/python-service.md"
@@ -0,0 +1,48 @@
+
+#Dockerfile
+#ntos,版本为7,build镜像时会自动下载
+```shell
+FROM wefe_python_base
+
+#语言编码设置
+RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
+ENV LC_ALL zh_CN.UTF-8
+
+# 修改时区
+RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' > /etc/timezone
+
+# 项目位置
+ENV CODE_DIR=/opt/welab/wefe
+
+# 在镜像创建目录
+RUN mkdir -p $CODE_DIR
+
+# 将项目模块放入 docker 镜像
+COPY ./python_project $CODE_DIR/
+```
+
+#镜像构建
+```shell
+sudo docker build -t wefe_python_service:$WEFE_VERSION .
+sudo docker save -o wefe_python_service_$WEFE_VERSION.tar wefe_python_service:$WEFE_VERSION
+```
+
+
+#进入容器,客户机安装krb5
+```shell
+yum install krb5-workstation krb5-libs krb5-auth-dialog
+配置这些主机上的/etc/krb5.conf, krb5.conf拿去覆盖
+sudo docker cp /work/wefeonhand/wefe/krb5.conf e7b8b9fd56e6:/etc/
+添加hosts
+172.21.72.165 host165
+172.21.72.166 host166
+172.21.72.167 host167
+172.21.72.164 host164
+kinit -kt 密钥 principal
+kinit -kt ./bdp.keytab bdp/admin@NBDP.COM
+
+
+klist
+
+sc.textFile("hdfs://nameservice1:8020/user/bdp/liuyan/testdata.txt").flatMap(_.split(" ")).map((_,1)).reduceByKey(_ + _).collect
+```
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/README_CLUSTER.md" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/README_CLUSTER.md"
new file mode 100644
index 0000000000000000000000000000000000000000..b58e7a7771c05c5f1684a86c287b6ba252d29569
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/README_CLUSTER.md"
@@ -0,0 +1,157 @@
+Wefe Spark 闆嗙兢鐗堢浉鍏抽厤缃笌閮ㄧ讲鏂规銆
+
+master 鍜 worker 閮芥槸 wefe 鐨勫熀浜 docker 鍚姩鐨 WeFe PythonProject锛屽悇闆嗙兢鑺傜偣閮介渶瑕佹湁鐩稿叧鐨勮繍琛岀幆澧冧互鍙婇」鐩唬鐮併
+#Oocker鐜
+master,worker涓绘満閮介渶瑕侀儴缃瞕ocker鐜
+
+# 鍏嶅瘑鐧婚檰
+
+閮ㄧ讲 WeFe 闆嗙兢鐗堟湰闇瑕侀厤缃富浠庢満鍣ㄩ棿鍙繘琛 Root 鍏嶅瘑鐧婚檰銆
+
+**鍏瀵嗛挜**
+
+鑻 A 闇瑕 SSH 鍏嶅瘑鐧婚檰 B锛屽垯 A 闇瑕佺敓鎴愬叕閽ュ拰绉侀挜锛岃 B 闇瑕佹湁 A 鐨勫叕閽ャ
+## 鏈哄櫒 A鎿嶄綔
+```shell
+sudo su root
+# 榛樿涓ゆ鍥炶溅鐢熸垚鍏挜鍜岀閽
+ssh-keygen -t rsa -P ""
+cat ~/.ssh/id_rsa.pub
+```
+鍏挜澶嶅埗
+```shell
+# 澶嶅埗 A 鐨勫叕閽ュ埌192.168.18.63鍜岃嚜宸192.168.18.62锛屽涓嬶細
+ssh-copy-id root@192.168.18.63
+ssh-copy-id root@192.168.18.62
+```
+
+## 鏈哄櫒 B鎿嶄綔
+```shell
+#鍘籦绔涓嬬洰褰曟煡鐪
+cat ~/.ssh/authorized_keys
+```
+
+sshd 閰嶇疆
+```shell
+#SSH 鏈嶅姟榛樿鏄笉鍏佽 Root 瑙掕壊鐨勫厤瀵嗙櫥闄嗙殑锛岄渶瑕佷慨鏀瑰叾榛樿閰嶇疆鏂囦欢 /etc/ssh/sshd_config
+# 淇敼鏈哄櫒 B 鐨 SSH 鏈嶅姟閰嶇疆
+PermitRootLogin yes
+```
+
+鍏嶅瘑鐧婚檰娴嬭瘯
+
+```shell
+# A 鐧婚檰 B
+#63
+ssh root@[B IP]
+#62鑷繁
+ssh root@[B IP]
+```
+
+
+
+#Docker璺ㄥ涓绘満
+
+Docker 瀹瑰櫒涓殑鍚勮妭鐐归渶瑕佽法涓绘満閫氫俊锛岃繖閲屼娇鐢 Docker 銆
+
+瑕佸疄鐜 Overlay 缃戠粶锛岄渶瑕佷竴涓彂鐜版湇鍔★紝杩欓噷浣跨敤 Consul 杩涜鏈嶅姟鍙戠幇銆
+
+## Consul 閮ㄧ讲閰嶇疆
+
+Consul 闇瑕侀儴缃插湪 master 鏈哄櫒涓娿
+
+###master
+
+涓嬭浇 Consul 闀滃儚骞跺惎鍔紝榛樿鍚姩鍦 8500 绔彛銆
+
+```shell
+docker pull consul:1.9.10
+docker run -d -p 8500:8500 -h consul --name consul consul:1.9.10
+```
+
+璁块棶鍦板潃 `[master ip]:8500`锛岃嫢鏈嶅姟鍚姩鎴愬姛锛屽垯鍙甯歌闂 Consul WebUI 椤甸潰銆
+
+淇敼 master 鏈哄櫒涓婄殑 Docker 閰嶇疆鏂囦欢 /etc/docker/daemon.json锛屾坊鍔犱互涓嬮厤缃細
+
+```json
+{
+ "live-restore": true,
+ "cluster-store": "consul://[master ip]:8500",
+ "cluster-advertise": "[master ip]:2375"
+ }
+#淇敼瀹 Docker 鐨 daemon.json 閰嶇疆鏂囦欢鍚庨噸鍚 docker 鏈嶅姟
+systemctl restart docker
+```
+
+###worker
+淇敼 worker 鏈哄櫒涓婄殑 Docker 閰嶇疆鏂囦欢 /etc/docker/daemon.json锛屾坊鍔犱互涓嬮厤缃細
+
+```json
+{
+ "live-restore": true,
+ "cluster-store": "consul://[master ip]:8500",
+ "cluster-advertise": "[worker ip]:2375"
+}
+#淇敼瀹 Docker 鐨 daemon.json 閰嶇疆鏂囦欢鍚庨噸鍚 docker 鏈嶅姟
+systemctl restart docker
+```
+
+
+## Overlay 缃戠粶妯″紡
+###master
+鍦 master 鏈哄櫒涓婂垱寤 Docker Overlay 缃戠粶銆
+
+闇瑕佹敞鎰忕殑鏄紝姝ゅ鎸囧畾鐨勭綉缁 subnet 闇瑕佷笌 wefe.cfg 涓厤缃殑 CONTAINER_SUBNET 涓鑷达紙榛樿鏄竴鑷寸殑锛夈
+
+```shell
+docker network create -d overlay --subnet 10.101.0.0/24 spark_overlay
+```
+
+###鏌ョ湅缃戠粶鏄惁鍒涘缓鎴愬姛
+```shell
+docker network ls
+NETWORK ID NAME DRIVER SCOPE
+769154a98055 bridge bridge local
+8c5cbe459b08 host host local
+f2360fcee185 none null local
+35bb09768374 spark_overlay overlay global
+```
+鍦 worker 鏈嶅姟鍣ㄦ煡鐪嬪湪 master 鍒涘缓鐨 Global Overlay 绫诲瀷鐨勭綉缁 wefe_overlay 鏄惁琚垚鍔熷悓姝ャ
+```shell
+docker network ls
+NETWORK ID NAME DRIVER SCOPE
+eeb10ebaadf8 bridge bridge local
+1bb6fcbb2787 host host local
+41f556e18465 none null local
+35bb09768374 spark_overlay overlay global
+```
+
+鑻ュ湪 worker 鐨勬湇鍔″櫒涓婅兘鐪嬪埌鍒涘缓鐨 Global Overlay 绫诲瀷鐨勭綉缁 spark_overlay锛屽垯缃戠粶鍚屾鎴愬姛锛岀綉缁滈厤缃垚鍔熴
+
+# 閰嶇疆涓庨儴缃
+
+閮ㄧ讲 Spark 闆嗙兢鐗堬紝闇瑕佹寜闇淇敼 Spark 鐩稿叧閰嶇疆锛岄粯璁ら厤缃涓嬨
+
+```
+# 閰嶇疆鏂囦欢浣嶄簬椤圭洰鏍圭洰褰曚笅鐨 wefe.cfg 鏂囦欢涓
+
+# SPARK 鍚姩妯″紡 LOCAL / STANDALONE锛屽叾涓 STANDALONE 涓 spark 鐨勯泦缇ゆā寮
+SPARK_MODE=LOCAL
+# 鑻ラ噰鐢ㄩ泦缇ゆā寮忥紝闇瑕侀厤缃 MASTER 鍙 WORKER 鍙傛暟锛屼笖淇濊瘉鍚勬満鍣ㄩ棿宸查厤缃 SSH 鍏嶅瘑鐧诲綍浠ュ強 Overlay 缃戠粶
+# 鐩墠鍙敮鎸佸崟涓 master锛岃嫢骞蹭釜 worker 鐨勬ā寮
+SPARK_MASTER=192.168.18.61
+# 濉啓鏈哄櫒鐨勫唴缃 IP锛岄楀彿鍒嗛殧
+SPARK_WORKERS=192.168.18.61,192.168.18.61
+SPARK_SUBMIT_PORT=7077
+SPARK_MASTER_UI_PORT=8082
+# 鐩稿簲鐨 worker 鐨 worker_ui_port 涔熼渶瑕佸涓厤缃
+SPARK_WORKER_UI_PORTS=8081,8083
+SPARK_CLUSTER_DATA_PATH=/data/wefe/wefe_spark_cluster/
+# 闆嗙兢 SPARK 瀹瑰櫒鐨勭綉娈 IP锛堣櫄鎷熺綉娈碉紝涓嶅缓璁慨鏀癸級
+CONTAINER_SUBNET=10.101.0.0
+```
+
+
+
+
+
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/config.properties" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/config.properties"
new file mode 100644
index 0000000000000000000000000000000000000000..a7d48895d3af4a773a2cc23e201edd7efb99e484
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/config.properties"
@@ -0,0 +1,150 @@
+# ************************************************
+# The configuration for job
+# ************************************************
+
+# Environment name, different configuration files for different environments .
+# Enums: prod銆乨ev銆乫at銆乶one
+# Default is none
+env.name=prod
+
+# Different branches have different functions
+# Enums: master銆乷nline_demo
+env.branch=master
+
+# 鏂囦欢涓婁紶鐩稿叧鍔熻兘浼氬皢鏂囦欢缁熶竴涓婁紶鍒版鐩綍
+wefe.file.upload.dir=/data/wefe_file_upload_dir
+
+# base url of union
+wefe.union.base-url=https://wefe.tianmiantech.com/union-service/
+
+# base url of serving
+wefe.serving.base-url=
+
+# Working mode of modeling tasks
+# Use integer type definition: Cluster mode=1, stand-alone mode=0
+# If work_mode=1 is used, multi-party interaction needs to go through the gateway
+# work_mode=0 is only used in stand-alone mode锛寃ithout gateway interaction, the transmitted data is directly written to mysql锛宱ften used with "wefe.job.backend=LOCAL"
+wefe.job.work_mode=1
+
+# ************************************************
+# The configuration for storing data
+# ************************************************
+
+# The type of database which data is stored in CLICKHOUSE or LMDB
+# LMDB is suitable for the stand-alone mode, and clickhouse is suitable for the cluster mode
+db.storage.type=CLICKHOUSE
+
+# If CLICKHOUSE is used, the following configuration is included
+# In general, you need to change the url銆乭ost銆乸ort銆乽sername銆乸assword , the other use by default
+db.storage.clickhouse.driverClassName=ru.yandex.clickhouse.ClickHouseDriver
+db.storage.clickhouse.url=jdbc:clickhouse://127.0.0.1:8153
+db.storage.clickhouse.host=127.0.0.1
+db.storage.clickhouse.tcp.port=9030
+db.storage.clickhouse.username=welab
+db.storage.clickhouse.password=pwd
+db.storage.clickhouse.initialSize=1
+db.storage.clickhouse.maxActive=50
+db.storage.clickhouse.minIdle=1
+db.storage.clickhouse.maxWait=60000
+db.storage.clickhouse.testWhileIdle=true
+db.storage.clickhouse.validationQuery=SELECT 1
+db.storage.clickhouse.timeBetweenEvictionRunsMillis=5000
+db.storage.clickhouse.minEvictableIdleTimeMillis=10000
+db.storage.clickhouse.removeAbandoned=true
+db.storage.clickhouse.removeAbandonedTimeout=300
+db.storage.clickhouse.logAbandoned=true
+# The batch size of written to CLICKHOUSE in bulk锛孶nits: M(support for sub-counts)
+db.storage.clickhouse.optimal.insert.byte.size=1
+
+# If LMDB is used, the following configuration is included
+lmdb.database.name=lmdbtest
+lmdb.max.size=256
+lmdb.database.count=10
+lmdb.path=/data/lmdb
+lmdb.partitions=8
+
+# ************************************************
+# The configuration for business database mysql
+# mysql is used to save modeling processes, modeling information, member information, and more
+# ************************************************
+
+db.mysql.url=jdbc:mysql://127.0.0.1:3306/wefe_board?characterEncoding=UTF-8&useSSL=false&useUnicode=true&serverTimezone=GMT%2B8
+db.mysql.host=127.0.0.1
+db.mysql.port=3306
+db.mysql.database=wefe_board
+db.mysql.username=wefe
+db.mysql.password=******
+
+# ************************************************
+# The configuration for flow
+# ************************************************
+
+# The root of the flow log, which supports relative paths
+flow.log.root.path=./logs
+
+wefe.job.backend=SPARK
+
+# ************************************************
+# If you are using the spark backend, the following configuration is required
+# ************************************************
+
+flow.spark.submit.default.driver.memory=1g
+flow.spark.submit.default.driver.maxResultSize=1g
+flow.spark.submit.default.num.executors=1
+flow.spark.submit.default.executor.memory=1g
+flow.spark.submit.default.executor.cores=1
+flow.spark.default.num.slices=1
+
+# ************************************************
+# If you are using the fc backend, the following configuration is required
+# ************************************************
+
+# the type of intermediate data in function calculates锛宱nly ots is supported
+fc.storage.type=oss
+
+# the region of function calculates
+fc.region=cn-shenzhen
+
+# the alias for the function call
+fc.qualifier=LATEST
+
+# the service name for the function call
+fc.service.name=wefe-fc
+
+# the account ID for the function call
+fc.account_id=294***9042
+
+# the access key id for the function call
+fc.access_key_id=LTA***ND7
+
+# the access key secret for the function call
+fc.access_key_secret=nxL***sfv
+
+# fc account type: api or admin
+fc.account_type=admin
+
+# the end point for the function call
+fc.end_point=https://145******.cn-shenzhen.fc.aliyuncs.com
+
+# instance name of ots
+fc.ots.instance_name=fc-***
+
+# the end point of the ots internal and external network
+fc.ots.internal_end_point=https://fc-***.cn-shenzhen.ots.aliyuncs.com
+fc.ots.end_point=https://fc-***.cn-shenzhen.ots.aliyuncs.com
+
+# Used to send intermediate data generated during calculations at oss
+fc.cloud_store.temp_auth_internal_end_point=https://oss-cn-shenzhen-internal.aliyuncs.com
+fc.cloud_store.temp_auth_end_point=https://oss-cn-shenzhen.aliyuncs.com
+fc.cloud_store.temp_auth_role_arn=acs:ram::145*******:role/wefe-fc-ossread
+fc.cloud_store.temp_auth_role_session_name=tianmian
+fc.cloud_store.temp_auth_duration_seconds=36000
+
+
+# ************************************************
+# oss configuration for fc
+# ************************************************
+fc.oss.bucket_name=wefe-fc
+fc.oss.endpoint=http://oss-cn-shenzhen.aliyuncs.com
+fc.oss.internal_endpoint=http://oss-cn-shenzhen-internal.aliyuncs.com
+
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/docker-compose.yml" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/docker-compose.yml"
new file mode 100644
index 0000000000000000000000000000000000000000..68b4d45f0960776a10ed1092eaf0c13223bb374c
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/docker-compose.yml"
@@ -0,0 +1,34 @@
+version: "3"
+services:
+ # python 鏈嶅姟
+ wefe_python_service:
+ image: wefe_python_service:v.2.2 # wefe_version
+ tty: true
+ env_file:
+ - variables.env
+ ports:
+ - 8888:5000 # flow_port
+ privileged: true
+ networks:
+ - network
+ volumes:
+ - ./mount/config.properties:/opt/welab/wefe/config.properties
+ # 鎸傚湪鏂囦欢澶逛細鍚屾锛屾寕鍦ㄦ枃浠朵笉涓瀹氬悓姝(vim缂栬緫涓嶄細鍚屾,闇瑕佺粰鏂囦欢鍔犳潈闄 chmod 777 file, echo 缂栬緫浼氬悓姝)
+ - /data/wefe/docker-compose/logs/flow:/opt/welab/wefe/logs # flow_logs
+ command:
+# sh -c "sh /opt/welab/wefe/fc/function/wefe-fc/update_env.sh && sh /opt/welab/wefe/flow/service.sh start && tail -f /dev/null"
+
+ - sh
+ - -c
+ - |
+ sh /opt/welab/wefe/common/python/calculation/fc/function/wefe-fc/fc_deploy.sh &
+ sh /opt/welab/wefe/flow/service.sh start
+ tail -f /dev/null
+
+ deploy:
+ restart_policy:
+ condition: on-failure
+
+networks:
+ network:
+ driver: bridge
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/mount/config.properties" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/mount/config.properties"
new file mode 100644
index 0000000000000000000000000000000000000000..19dd33bcbde62b655075e9a9fbf429621fc28154
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/mount/config.properties"
@@ -0,0 +1,147 @@
+# ************************************************
+# The configuration for job
+# ************************************************
+
+# Environment name, different configuration files for different environments .
+# Enums: prod銆乨ev銆乫at銆乶one
+# Default is none
+env.name=prod
+
+# Different branches have different functions
+# Enums: master銆乷nline_demo
+env.branch=master
+
+# 鏂囦欢涓婁紶鐩稿叧鍔熻兘浼氬皢鏂囦欢缁熶竴涓婁紶鍒版鐩綍
+wefe.file.upload.dir=/data/wefe_file_upload_dir
+
+# base url of union
+wefe.union.base-url=https://wefe.tianmiantech.com/union-blockchain/
+
+# base url of serving
+wefe.serving.base-url=
+
+# Working mode of modeling tasks
+# Use integer type definition: Cluster mode=1, stand-alone mode=0
+# If work_mode=1 is used, multi-party interaction needs to go through the gateway
+# work_mode=0 is only used in stand-alone mode锛寃ithout gateway interaction, the transmitted data is directly written to mysql锛宱ften used with "wefe.job.backend=LOCAL"
+wefe.job.work_mode=1
+
+# ************************************************
+# The configuration for storing data
+# ************************************************
+
+# The type of database which data is stored in CLICKHOUSE or LMDB
+# LMDB is suitable for the stand-alone mode, and clickhouse is suitable for the cluster mode
+db.storage.type=CLICKHOUSE
+
+# If CLICKHOUSE is used, the following configuration is included
+# In general, you need to change the url銆乭ost銆乸ort銆乽sername銆乸assword , the other use by default
+db.storage.clickhouse.driverClassName=ru.yandex.clickhouse.ClickHouseDriver
+db.storage.clickhouse.url=jdbc:clickhouse://127.0.0.1:8153
+db.storage.clickhouse.host=127.0.0.1
+db.storage.clickhouse.tcp.port=9030
+db.storage.clickhouse.username=welab
+db.storage.clickhouse.password=pwd
+db.storage.clickhouse.initialSize=1
+db.storage.clickhouse.maxActive=50
+db.storage.clickhouse.minIdle=1
+db.storage.clickhouse.maxWait=60000
+db.storage.clickhouse.testWhileIdle=true
+db.storage.clickhouse.validationQuery=SELECT 1
+db.storage.clickhouse.timeBetweenEvictionRunsMillis=5000
+db.storage.clickhouse.minEvictableIdleTimeMillis=10000
+db.storage.clickhouse.removeAbandoned=true
+db.storage.clickhouse.removeAbandonedTimeout=300
+db.storage.clickhouse.logAbandoned=true
+# The batch size of written to CLICKHOUSE in bulk锛孶nits: M(support for sub-counts)
+db.storage.clickhouse.optimal.insert.byte.size=1
+
+# If LMDB is used, the following configuration is included
+lmdb.database.name=lmdbtest
+lmdb.max.size=256
+lmdb.database.count=10
+lmdb.path=/data/lmdb
+lmdb.partitions=8
+
+# ************************************************
+# The configuration for business database mysql
+# mysql is used to save modeling processes, modeling information, member information, and more
+# ************************************************
+
+db.mysql.url=jdbc:mysql://127.0.0.1:3306/wefe_board?characterEncoding=UTF-8&useSSL=false&useUnicode=true&serverTimezone=GMT%2B8
+db.mysql.host=127.0.0.1
+db.mysql.port=3306
+db.mysql.database=wefe_board
+db.mysql.username=wefe
+db.mysql.password=******
+
+# ************************************************
+# The configuration for flow
+# ************************************************
+
+# The root of the flow log, which supports relative paths
+flow.log.root.path=./logs
+
+wefe.job.backend=SPARK
+
+# ************************************************
+# If you are using the spark backend, the following configuration is required
+# ************************************************
+
+flow.spark.submit.default.driver.memory=1g
+flow.spark.submit.default.driver.maxResultSize=1g
+flow.spark.submit.default.num.executors=1
+flow.spark.submit.default.executor.memory=1g
+flow.spark.submit.default.executor.cores=1
+flow.spark.default.num.slices=1
+
+# ************************************************
+# If you are using the fc backend, the following configuration is required
+# ************************************************
+
+# the type of intermediate data in function calculates锛宱nly ots is supported
+fc.storage.type=oss
+
+# the region of function calculates
+fc.region=cn-shenzhen
+
+# the alias for the function call
+fc.qualifier=LATEST
+
+# the service name for the function call
+fc.service.name=wefe-fc
+
+# the account ID for the function call
+fc.account_id=294***9042
+
+# the access key id for the function call
+fc.access_key_id=LTA***ND7
+
+# the access key secret for the function call
+fc.access_key_secret=nxL***sfv
+
+# the end point for the function call
+fc.end_point=https://145******.cn-shenzhen.fc.aliyuncs.com
+
+# instance name of ots
+fc.ots.instance_name=fc-***
+
+# the end point of the ots internal and external network
+fc.ots.internal_end_point=https://fc-***.cn-shenzhen.ots.aliyuncs.com
+fc.ots.end_point=https://fc-***.cn-shenzhen.ots.aliyuncs.com
+
+# Used to send intermediate data generated during calculations at oss
+fc.cloud_store.temp_auth_internal_end_point=https://oss-cn-shenzhen-internal.aliyuncs.com
+fc.cloud_store.temp_auth_end_point=https://oss-cn-shenzhen.aliyuncs.com
+fc.cloud_store.temp_auth_role_arn=acs:ram::145*******:role/*********read
+fc.cloud_store.temp_auth_role_session_name=tianmian
+fc.cloud_store.temp_auth_duration_seconds=36000
+
+
+# ************************************************
+# oss configuration for fc
+# ************************************************
+fc.oss.bucket_name=wefe-fc
+fc.oss.endpoint=http://oss-cn-shenzhen.aliyuncs.com
+fc.oss.internal_endpoint=http://oss-cn-shenzhen-internal.aliyuncs.com
+
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/template/docker-compose-gpu.yml.template" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/template/docker-compose-gpu.yml.template"
new file mode 100644
index 0000000000000000000000000000000000000000..76778a22223f8c1b1323353dd62ca9bf350d16fa
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/template/docker-compose-gpu.yml.template"
@@ -0,0 +1,32 @@
+version: "3"
+services:
+ # python 鏈嶅姟
+ wefe_python_service:
+ image: wefe_python_gpu_service:v.2.1 # wefe_version
+ tty: true
+ runtime: nvidia
+ env_file:
+ - variables.env
+ ports:
+ - 8888:5000 # flow_port
+ privileged: true
+ networks:
+ - network
+ volumes:
+ - ./mount/config.properties:/opt/welab/wefe/config.properties
+ # 鎸傚湪鏂囦欢澶逛細鍚屾锛屾寕鍦ㄦ枃浠朵笉涓瀹氬悓姝(vim缂栬緫涓嶄細鍚屾,闇瑕佺粰鏂囦欢鍔犳潈闄 chmod 777 file, echo 缂栬緫浼氬悓姝)
+ - /data/wefe/docker-compose/logs/flow:/opt/welab/wefe/logs # flow_logs
+ command:
+ - sh
+ - -c
+ - |
+ sh /opt/welab/wefe/flow/service.sh start
+ tail -f /dev/null
+
+ deploy:
+ restart_policy:
+ condition: on-failure
+
+networks:
+ network:
+ driver: bridge
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/template/docker-compose-master.yml.template" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/template/docker-compose-master.yml.template"
new file mode 100644
index 0000000000000000000000000000000000000000..759d548c9dca664b29cac87c11b58c5364fb4938
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/template/docker-compose-master.yml.template"
@@ -0,0 +1,40 @@
+version: "3"
+services:
+ # python 鏈嶅姟
+ wefe_python_service_master:
+ image: wefe_python_service:v.2.1 # wefe_version
+ tty: true
+ env_file:
+ - variables.env
+ hostname: master
+ ports:
+ - 8888:5000 # flow_port
+ - 4040-4049:4040-4049
+ - 8080:8080 # spark_master_ui_port
+ privileged: true
+ environment:
+ - "SPARK_PUBLIC_DNS=to_replace_ip" # master_public_dns
+ - SPARK_MASTER_WEBUI_PORT=8080 # master_web_ui_port
+ networks:
+ spark_overlay:
+ ipv4_address: to_replace_ip # master_container_ip
+ volumes:
+ - ./mount/config.properties:/opt/welab/wefe/config.properties
+ # 鎸傚湪鏂囦欢澶逛細鍚屾锛屾寕鍦ㄦ枃浠朵笉涓瀹氬悓姝(vim缂栬緫涓嶄細鍚屾,闇瑕佺粰鏂囦欢鍔犳潈闄 chmod 777 file, echo 缂栬緫浼氬悓姝)
+ - /data/wefe/docker-compose/logs/flow:/data/logs # flow_logs
+ command:
+ - sh
+ - -c
+ - |
+ cd /data/environment/spark-3.0.1-bin-hadoop2.7/conf && cp spark-defaults.conf.template spark-defaults.conf
+ sh /data/environment/spark-3.0.1-bin-hadoop2.7/sbin/start-master.sh
+ sh /opt/welab/wefe/flow/service.sh start
+ tail -f /dev/null
+
+ deploy:
+ restart_policy:
+ condition: on-failure
+
+networks:
+ spark_overlay:
+ external: true
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/template/docker-compose-worker.yml.template" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/template/docker-compose-worker.yml.template"
new file mode 100644
index 0000000000000000000000000000000000000000..455491a8693854523f060d7d3f73433ee05fb927
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/template/docker-compose-worker.yml.template"
@@ -0,0 +1,38 @@
+version: "3"
+services:
+ # python 鏈嶅姟
+ wefe_python_service_worker: # worker_name
+ image: wefe_python_service:v.2.1 # wefe_version
+ environment:
+ - PYTHONPATH=/opt/welab/wefe
+ - SPARK_WORKER_WEBUI_PORT=8081 # worker_web_ui_port
+ - "SPARK_PUBLIC_DNS=to_replace_ip" # worker_public_dns
+ tty: true
+ ports:
+ - 8081:8081 # spark_worker_ui_port
+ privileged: true
+ extra_hosts:
+ - "master:to_replace_container_ip" # worker_extra_hosts
+ networks:
+ spark_overlay:
+ ipv4_address: to_replace_ip # worker_container_ip
+ volumes:
+ - ./mount/config.properties:/opt/welab/wefe/config.properties
+ # 鎸傚湪鏂囦欢澶逛細鍚屾锛屾寕鍦ㄦ枃浠朵笉涓瀹氬悓姝(vim缂栬緫涓嶄細鍚屾,闇瑕佺粰鏂囦欢鍔犳潈闄 chmod 777 file, echo 缂栬緫浼氬悓姝)
+ - /data/wefe/docker-compose/logs/flow:/data/logs # flow_logs
+ command:
+# sh -c "sh /opt/welab/wefe/fc/function/wefe-fc/update_env.sh && sh /opt/welab/wefe/flow/service.sh start && tail -f /dev/null"
+
+ - sh
+ - -c
+ - |
+ sh /data/environment/spark-3.0.1-bin-hadoop2.7/sbin/start-slave.sh spark://master:7077
+ tail -f /dev/null
+
+ deploy:
+ restart_policy:
+ condition: on-failure
+
+networks:
+ spark_overlay:
+ external: true
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/variables.env" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/variables.env"
new file mode 100644
index 0000000000000000000000000000000000000000..008f1cbfb6a823cc538fa09a477b2dda99130448
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/resources/variables.env"
@@ -0,0 +1,7 @@
+# define python service container env
+
+FLOW_PORT=
+NGINX_PORT=
+GATEWAY_PORT=
+
+INTRANET_IP=
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/spark_cluster.sh" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/spark_cluster.sh"
new file mode 100644
index 0000000000000000000000000000000000000000..700a7e64cecfe886dc38d4f792a696a63ea796d3
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/spark_cluster.sh"
@@ -0,0 +1,247 @@
+source ./wefe.cfg
+export PWD=$(pwd)
+
+# 鍓嶇疆澶勭悊
+if [ $SPARK_MODE = "STANDALONE" ]
+then
+ echo '褰撳墠涓洪泦缇ら儴缃'
+else
+ echo '闈為泦缇ゆā寮忥紝閫鍑'
+ exit 0
+fi
+
+# 妫鏌ヤ緷璧栫幆澧
+
+# Consul 鏈嶅姟
+CONSUL_SERVICE=$(docker ps | grep consul)
+if [[ ! $CONSUL_SERVICE ]]; then
+ echo '鏈娴嬪埌 consul 鏈嶅姟锛岃鍙傜収闆嗙兢閮ㄧ讲鏂囨。閮ㄧ讲 consul 鏈嶅姟'
+ exit 0
+fi
+
+# 缃戠粶妫娴
+OVERLAY_NETWORK=$(docker network ls | grep overlay)
+if [[ ! $OVERLAY_NETWORK ]]; then
+ echo '鏈娴嬪埌 Overlay 缃戠粶锛岃鍙傜収闆嗙兢閮ㄧ讲鏂囨。鍒涘缓 Overlay 缃戠粶'
+ exit 0
+fi
+
+
+INPUT_ACTION=$1
+
+# ******************
+# 鍑芥暟锛氭嫹璐濆崟涓猵ython service鍒拌繙绋嬫満鍣
+# *****************
+_cp_python_service(){
+ # 鍙傛暟
+ to_host=$1
+ to_path=$2
+
+ if [ ${#to_path} -gt 5 ]; then
+ echo "鍒犻櫎杩滅▼鐩綍${to_host}:${to_path}骞堕噸鏂板垱寤"
+ ssh root@$to_host "rm -rf $to_path"
+ ssh root@$to_host "mkdir -p $to_path"
+ fi
+
+ echo "鍑嗗鎷疯礉鏁版嵁鍒$to_host鐨$to_path鐩綍锛岃鑰愬績绛夊緟..."
+ scp wefe.cfg root@$to_host:$to_path
+ scp config.properties root@$to_host:$to_path
+ scp -r wefe_python_service root@$to_host:$to_path/ >/dev/null 2>&1
+}
+
+# ******************
+# 鍑芥暟锛氬仠姝㈠崟涓猵ython service
+# *****************
+_stop_python_service(){
+ # 鍙傛暟
+ to_host=$1
+ to_path=$2
+
+ echo "鍑嗗鍏抽棴杩滅▼瀹瑰櫒$to_host, 鐩綍:$to_path"
+ # ssh root@$to_host "cd $to_path && cd wefe_python_service && sh wefe_python_service_stop.sh"
+ to_stop=$(ssh root@$to_host "docker ps -a | grep $WEFE_ENV | grep python " | awk '{print $1}' | xargs)
+ ssh root@$to_host "docker stop $to_stop"
+ sleep 1
+}
+
+
+_remove_python_service(){
+ # 鍙傛暟
+ to_host=$1
+ to_path=$2
+
+ echo "鍑嗗鍏抽棴杩滅▼瀹瑰櫒$to_host, 鐩綍:$to_path"
+ # ssh root@$to_host "cd $to_path && cd wefe_python_service && sh wefe_python_service_stop.sh"
+ to_remove=$(ssh root@$to_host "docker ps -a | grep $WEFE_ENV | grep python " | awk '{print $1}' | xargs)
+ ssh root@$to_host "docker rm $to_remove"
+ sleep 1
+}
+
+# ******************
+# 鍑芥暟锛氬惎鍔ㄥ崟涓猵ython service
+# *****************
+_start_python_service(){
+ # 鍙傛暟:
+ to_host=$1
+ to_path=$2
+ identity=$3
+ identity_name=$4
+ container_ip=$5
+ worker_ui_port=$6
+
+ echo "鍑嗗鍚姩杩滅▼瀹瑰櫒$to_host, 鐩綍:$to_path, 韬唤:$identity, identity_name:$identity_name"
+ ssh root@$to_host "cd $to_path && cd wefe_python_service && sh wefe_python_service_start.sh $identity $identity_name $container_ip $to_host $worker_ui_port"
+ sleep 1
+}
+
+# ******************
+# 鍑芥暟锛氭牴鎹甤ontainer_index鐢熸垚瀹瑰櫒ip
+# *****************
+_generate_container_ip(){
+ container_index=$1
+
+ container_subnet_split=(${CONTAINER_SUBNET//./ })
+ container_subnet_split[${#container_subnet_split[@]}-1]=$container_index
+ container_ip=$(IFS=.; echo "${container_subnet_split[*]}")
+ echo $container_ip
+}
+
+# ******************
+# 鍑芥暟锛氭嫹璐 python service 鍒版墍鏈夌殑杩滅▼鏈哄櫒
+# *****************
+cp_python_service_all(){
+
+ # 鎷疯礉鏁版嵁鍒拌繙绋 master 鐩綍
+ REMOTE_MASTER_PATH=$SPARK_CLUSTER_DATA_PATH/master
+ # ssh root@$SPARK_MASTER "mkdir -p $master_path"
+
+ # 鎷疯礉python service 鍒癿aster
+ _cp_python_service $SPARK_MASTER $REMOTE_MASTER_PATH
+
+ # 鎷疯礉鍒版瘡涓 worker
+ workers=(`echo $SPARK_WORKERS | tr ',' ' '` )
+ index=0
+ for worker in ${workers[@]}
+ do
+ # echo $worker
+ worker_path=$SPARK_CLUSTER_DATA_PATH"/worker_"$index
+
+ # 杩滅▼鍒涘缓 worker 鐩綍
+ # ssh root@$worker "mkdir -p $worker_path"
+ # echo $worker_path
+
+ # 杩滅▼鎷疯礉
+ _cp_python_service $worker $worker_path
+
+ index=$[index + 1]
+ done
+
+}
+
+# ******************
+# 鍑芥暟锛氬惎鍔ㄩ泦缇 python service
+# *****************
+start_cluster(){
+
+ # 鎷疯礉闀滃儚鍒伴泦缇ゆ満鍣
+ cp_python_service_all
+
+ # container_index锛岄粯璁よ缃粠2寮濮
+ container_index=2
+ master_container_ip=$(_generate_container_ip $container_index)
+
+ # master鐩綍
+ REMOTE_MASTER_PATH=$SPARK_CLUSTER_DATA_PATH/master
+
+ # start master
+ _start_python_service $SPARK_MASTER $REMOTE_MASTER_PATH master master $master_container_ip no_worder_ui_port
+ sleep 3
+
+ # 鎷疯礉鍒版瘡涓 worker
+ workers=(`echo $SPARK_WORKERS | tr ',' ' '` )
+ worker_ui_ports=(`echo $SPARK_WORKER_UI_PORTS | tr ',' ' '` )
+ index=0
+ for worker in ${workers[@]}
+ do
+ echo $worker
+ worker_path=$SPARK_CLUSTER_DATA_PATH"/worker_"$index
+ worker_name="worker_"$index
+ container_index=$[container_index + 1]
+ worker_container_ip=$(_generate_container_ip $container_index)
+ worker_ui_port=${worker_ui_ports[$index]}
+
+ # 杩滅▼鍚姩 worker
+ _start_python_service $worker $worker_path worker $worker_name $worker_container_ip $worker_ui_port
+
+ index=$[index + 1]
+ done
+
+}
+
+
+# ******************
+# 鍑芥暟锛氬仠姝㈤泦缇ython service
+# *****************
+stop_cluster(){
+
+ # master鐩綍
+ master_path=$SPARK_CLUSTER_DATA_PATH/master
+
+ # start master
+ _stop_python_service $SPARK_MASTER $master_path
+ sleep 3
+
+ # 鎷疯礉鍒版瘡涓 worker
+ workers=(`echo $SPARK_WORKERS | tr ',' ' '` )
+ index=0
+ for worker in ${workers[@]}
+ do
+ echo $worker
+ worker_path=$SPARK_CLUSTER_DATA_PATH"/worker_"$index
+
+ # 杩滅▼鍚姩 worker
+ _stop_python_service $worker $worker_path
+
+ index=$[index + 1]
+ done
+
+}
+
+remove_cluster(){
+
+ # master鐩綍
+ master_path=$SPARK_CLUSTER_DATA_PATH/master
+
+ # start master
+ _remove_python_service $SPARK_MASTER $master_path
+ sleep 3
+
+ # 鎷疯礉鍒版瘡涓 worker
+ workers=(`echo $SPARK_WORKERS | tr ',' ' '` )
+ index=0
+ for worker in ${workers[@]}
+ do
+ echo $worker
+ worker_path=$SPARK_CLUSTER_DATA_PATH"/worker_"$index
+
+ # 杩滅▼鍚姩 worker
+ _remove_python_service $worker $worker_path
+
+ index=$[index + 1]
+ done
+
+}
+
+
+#case $INPUT_ACTION in
+# start)
+# start_python_service_all
+# ;;
+# stop)
+# stop_python_service_all
+# ;;
+# *)
+# echo "Please Input a Legal Action"
+# echo "eg. {start | stop | restart | help}"
+# exit -1
+#esac
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/wefe.cfg" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/wefe.cfg"
new file mode 100644
index 0000000000000000000000000000000000000000..a6aa7f5a2ad31f7db6ba99cd723bce2b5a35e98a
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/wefe.cfg"
@@ -0,0 +1,118 @@
+# **************
+# 浠ヤ笅閰嶇疆涓哄繀濉」
+# ***************
+
+### VERSION ####
+WEFE_VERSION=v.2.2
+WEFE_ENV=release
+
+# 鑻ヤ笉闇瑕佸缃戣闂紝鍒欓兘濉啓鍐呯綉鍦板潃
+# 鏈満鍐呯綉 IP
+INTRANET_IP=127.0.0.1
+# 鏈満澶栫綉 IP
+EXTRANET_IP=127.0.0.1
+
+# **************
+# 浠ヤ笅閰嶇疆涓洪夊~椤
+# ***************
+
+# Docker 鏁版嵁瀛樺偍鐩綍锛岄渶瑕佸閲忚緝澶х殑鐩綍
+DATA_PATH=/data/wefe/docker-compose
+
+### middleware ###
+
+# mysql 甯愬彿瀵嗙爜涓庢暟鎹簱
+MYSQL_USERNAME=wefe
+MYSQL_PASSWORD=wefe2020
+MYSQL_DATABASE=wefe_board
+# mysql 绔彛
+MYSQL_PORT=4406
+
+# clickhouse
+# 甯愬彿瀵嗙爜
+CLICKHOUSE_USERNAME=wefe
+CLICKHOUSE_PASSWORD=wefe2020
+# 鏈嶅姟绔彛
+CLICKHOUSE_PORT=8122
+CLICKHOUSE_TCP_PORT=9900
+
+### board_website ###
+
+# nginx 绔彛
+NGINX_PORT=80
+
+### board-service ###
+
+# 鏈嶅姟绔彛
+BOARD_SERVICE_PORT=8080
+
+### Flow ###
+
+# 鏈嶅姟绔彛
+PYTHON_SERVICE_PORT=5000
+
+### gateway ###
+
+# 缃戝叧绔彛
+GATEWAY_SERVICE_PORT=50051
+
+### 璁$畻寮曟搸 ###
+
+# 璁$畻寮曟搸锛孲PARK or FC
+CALCULATION_ENGINE=SPARK
+
+### Spark 寮曟搸鐩稿叧閰嶇疆 ###
+
+# SPARK 鍚姩妯″紡 LOCAL / STANDALONE锛屽叾涓 STANDALONE 涓 spark 鐨勯泦缇ゆā寮
+SPARK_MODE=STANDALONE
+# 鑻ラ噰鐢ㄩ泦缇ゆā寮忥紝闇瑕侀厤缃 MASTER 鍙 WORKER 鍙傛暟锛屼笖淇濊瘉鍚勬満鍣ㄩ棿宸查厤缃 SSH 鍏嶅瘑鐧诲綍浠ュ強 Overlay 缃戠粶
+# 鐩墠鍙敮鎸佸崟涓 master锛岃嫢骞蹭釜 worker 鐨勬ā寮
+SPARK_MASTER=192.168.1.2
+# 澶氫釜 IP 浠ラ楀彿鍒嗛殧
+SPARK_WORKERS=192.168.1.2,192.168.1.3
+SPARK_SUBMIT_PORT=7077
+SPARK_MASTER_UI_PORT=8082
+# 鐩稿簲鐨 worker 鐨 worker_ui_port 涔熼渶瑕佸涓厤缃
+SPARK_WORKER_UI_PORTS=8081,8081
+SPARK_CLUSTER_DATA_PATH=/data/wefe/wefe_spark_cluster/
+# 闆嗙兢SPARK瀹瑰櫒鐨勭綉娈礗P[涓鑸儏鍐典笅涓嶇敤淇敼]
+CONTAINER_SUBNET=10.101.0.0
+
+# 榛樿涓 32G 鍐呭瓨鐨勬湇鍔″櫒閰嶇疆
+SPARK_DRIVER_MEMORY=15g
+SPARK_DRIVER_MAXRESULTSIZE=2g
+SPARK_NUM_EXECUTORS=6
+SPARK_EXECUTOR_MEMORY=2g
+SPARK_EXECUTOR_CORES=1
+SPARK_NUM_SLICES=32
+
+# 闃块噷浜戝嚱鏁拌绠楀紩鎿庣浉鍏抽厤缃
+FC_ACCOUNT_ID="xxx"
+FC_REGION="cn-shenzhen"
+FC_ACCESS_KEY_ID="xxx"
+FC_ACCESS_KEY_SECRET="xxx"
+FC_QUALIFIER="LATEST"
+FC_STORAGE_TYPE="oss"
+FC_OSS_BUCKET_NAME="xxx"
+FC_VPC_ID=""
+FC_V_SWITCH_IDS=""
+FC_SECURITY_GROUP_ID=""
+FC_ACCOUNT_TYPE=admin
+
+# CPU銆丟PU 妯″紡鐩稿叧閰嶇疆锛孨ONE or GPU
+ACCELERATION="NONE"
+
+### 鍒嗗竷寮忛儴缃查厤缃 ###
+
+# 涓棿浠舵湇鍔 IP
+MIDDLEWARE_SERVICE_INTRANET_IP=
+MIDDLEWARE_SERVICE_EXTRANET_IP=
+# Python 鏈嶅姟 IP
+PYTHON_SERVICE_INTRANET_IP=
+PYTHON_SERVICE_EXTRANET_IP=
+# Board 鏈嶅姟 IP
+BOARD_SERVICE_INTRANET_IP=
+BOARD_SERVICE_EXTRANET_IP=
+# Gateway 鏈嶅姟 IP
+GATEWAY_SERVICE_INTRANET_IP=
+GATEWAY_SERVICE_EXTRANET_IP=
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/wefe_python_service_start.sh" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/wefe_python_service_start.sh"
new file mode 100644
index 0000000000000000000000000000000000000000..16f43b6adfa0eef5ce447f3cc1839703fc4b834f
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/wefe_python_service_start.sh"
@@ -0,0 +1,81 @@
+
+#!/bin/bash
+
+# 瀵煎叆閰嶇疆
+source ../wefe.cfg
+
+identity_type=$1
+identity_name=$2
+cluster_container_ip=$3
+cluster_host_ip=$4
+worker_ui_port=$5
+
+# ******************
+# 瀹氫箟鍑芥暟锛歞ocker-compose閰嶇疆鍒濆鍖
+# *****************
+spark_cluster_config(){
+ echo "褰撳墠type:$identity_type"
+ case $identity_type in
+ master)
+ cp -f resources/template/docker-compose-master.yml.template resources/docker-compose.yml
+ sed -i "/master_web_ui_port/s/=.* #/=$SPARK_MASTER_UI_PORT #/g" ./resources/docker-compose.yml
+ sed -i "/spark_master_ui_port/s/8080:8080/$SPARK_MASTER_UI_PORT:$SPARK_MASTER_UI_PORT/g" ./resources/docker-compose.yml
+ sed -i "/master_public_dns/s/SPARK_PUBLIC_DNS=to_replace_ip/SPARK_PUBLIC_DNS=$SPARK_MASTER/g" ./resources/docker-compose.yml
+ sed -i "/master_container_ip/s/ipv4_address: to_replace_ip/ipv4_address: $cluster_container_ip/g" ./resources/docker-compose.yml
+ ;;
+ worker)
+ cp -f resources/template/docker-compose-worker.yml.template resources/docker-compose.yml
+ sed -i "/worker_name/s/wefe_python_service_worker/wefe_python_service_$identity_name/g" ./resources/docker-compose.yml
+ sed -i "/worker_public_dns/s/SPARK_PUBLIC_DNS=to_replace_ip/SPARK_PUBLIC_DNS=$cluster_host_ip/g" ./resources/docker-compose.yml
+ sed -i "/worker_web_ui_port/s/=.* #/=$worker_ui_port #/g" ./resources/docker-compose.yml
+ sed -i "/worker_container_ip/s/ipv4_address: to_replace_ip/ipv4_address: $cluster_container_ip/g" ./resources/docker-compose.yml
+
+ # worker ui port
+ sed -i "/spark_worker_ui_port/s/8081:8081/$worker_ui_port:$worker_ui_port/g" ./resources/docker-compose.yml
+
+ # replace host
+ container_subnet_split=(${CONTAINER_SUBNET//./ })
+ container_subnet_split[${#container_subnet_split[@]}-1]=2
+ master_container_ip=$(IFS=.; echo "${container_subnet_split[*]}")
+ echo "master_container_ip:$master_container_ip"
+ sed -i "/worker_extra_hosts/s/master:to_replace_container_ip/master:$master_container_ip/g" ./resources/docker-compose.yml
+ ;;
+ gpu)
+ echo 'GPU 鍔犻熸ā寮'
+ cp -f resources/template/docker-compose-gpu.yml.template resources/docker-compose.yml
+ ;;
+ *)
+ echo '闈為泦缇ゆā寮'
+ ;;
+ esac
+}
+
+# 闆嗙兢鐜鐨刣ocker-compose閰嶇疆
+spark_cluster_config $identity_type
+
+# 濉厖鐜鍙橀噺
+sed -i "/FLOW_PORT/s/=.*/=$PYTHON_SERVICE_PORT/g" ./resources/variables.env
+sed -i "/NGINX_PORT/s/=.*/=$NGINX_PORT/g" ./resources/variables.env
+sed -i "/GATEWAY_PORT/s/=.*/=$GATEWAY_SERVICE_PORT/g" ./resources/variables.env
+sed -i "/INTRANET_IP/s/=.*/=$INTRANET_IP/g" ./resources/variables.env
+
+# 淇敼鏈嶅姟鍚姩閰嶇疆
+sed -i "/wefe_version/s/python_service:.*#/python_service:$WEFE_VERSION #/g" ./resources/docker-compose.yml
+sed -i "/flow_logs/s@-.*:@- $DATA_PATH/logs/flow:@g" ./resources/docker-compose.yml
+
+# 淇敼 flow 绔彛
+sed -i "/flow_port/s/-.*:/- $PYTHON_SERVICE_PORT:/g" ./resources/docker-compose.yml
+
+# 鍔犺浇鏈湴绂荤嚎闀滃儚鍖
+if [ ${ACCELERATION,,} == 'gpu' ];then
+ echo "寮濮嬪姞杞 gpu python 绂荤嚎闀滃儚"
+ docker load < resources/wefe_python_gpu_service_$WEFE_VERSION\.tar
+ echo "鍔犺浇 gpu python 绂荤嚎闀滃儚瀹屾垚"
+else
+ echo "寮濮嬪姞杞 python 绂荤嚎闀滃儚"
+ docker load < resources/wefe_python_service_$WEFE_VERSION\.tar
+ echo "鍔犺浇 python 绂荤嚎闀滃儚瀹屾垚"
+fi
+
+# 鍚姩 flow 闀滃儚
+docker-compose -p $WEFE_ENV -f resources/docker-compose.yml up -d
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/wefe_python_service_stop.sh" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/wefe_python_service_stop.sh"
new file mode 100644
index 0000000000000000000000000000000000000000..ac8f49362381bcddf02bc89afdf455a87fc72451
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/wefe_python_service_stop.sh"
@@ -0,0 +1,4 @@
+
+#!/bin/bash
+
+docker-compose -p wefe -f ./resources/docker-compose.yml down
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/wefe_service.sh" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/wefe_service.sh"
new file mode 100644
index 0000000000000000000000000000000000000000..a4d681efc3fa9196c8fe5c03669ec9dee34276ee
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/python-standalone/wefe_service.sh"
@@ -0,0 +1,244 @@
+#!/bin/bash
+
+export INPUT_ACTION=$1
+export INPUT_SERVICE=$2
+export INPUT_DEPLOY=$3
+
+source ./wefe.cfg
+source ./spark_cluster.sh
+
+export PWD=$(pwd)
+
+edit_wefe_config(){
+
+ # ************
+ # 鍔犻熸柟妗堢浉鍏抽厤缃
+ # ************
+ sed -i "/wefe.job.acceleration/s/=.*/=$ACCELERATION/g" ./config.properties
+
+ # ************
+ # 涓棿浠剁浉鍏抽厤缃
+ # ************
+
+ # clickhouse
+ sed -i "/clickhouse.url/s/:\/\/.*/:\/\/$INTRANET_IP:$CLICKHOUSE_PORT/g" ./config.properties
+ sed -i "/clickhouse.host/s/=.*/=$INTRANET_IP/g" ./config.properties
+ sed -i "/clickhouse.tcp.port/s/=.*/=$CLICKHOUSE_TCP_PORT/g" ./config.properties
+ sed -i "/clickhouse.username/s/=.*/=$CLICKHOUSE_USERNAME/g" ./config.properties
+ sed -i "/clickhouse.password/s/=.*/=$CLICKHOUSE_PASSWORD/g" ./config.properties
+
+ # mysql
+ sed -i "/mysql.url/s/:\/\/.*?/:\/\/$INTRANET_IP:$MYSQL_PORT\/$MYSQL_DATABASE?/g" ./config.properties
+ sed -i "/mysql.host/s/=.*/=$INTRANET_IP/g" ./config.properties
+ sed -i "/mysql.port/s/=.*/=$MYSQL_PORT/g" ./config.properties
+ sed -i "/mysql.database/s/=.*/=$MYSQL_DATABASE/g" ./config.properties
+ sed -i "/mysql.username/s/=.*/=$MYSQL_USERNAME/g" ./config.properties
+ sed -i "/mysql.password/s/=.*/=$MYSQL_PASSWORD/g" ./config.properties
+
+ # ************
+ # 璁$畻寮曟搸鐩稿叧閰嶇疆
+ # ************
+
+ # 璁$畻寮曟搸閫夋嫨
+ sed -i "/wefe.job.backend/s/=.*/=$CALCULATION_ENGINE/g" ./config.properties
+
+ # spark
+ sed -i "/driver.memory/s/=.*/=$SPARK_DRIVER_MEMORY/g" ./config.properties
+ sed -i "/driver.maxResultSize/s/=.*/=$SPARK_DRIVER_MAXRESULTSIZE/g" ./config.properties
+ sed -i "/num.executors/s/=.*/=$SPARK_NUM_EXECUTORS/g" ./config.properties
+ sed -i "/executor.memory/s/=.*/=$SPARK_EXECUTOR_MEMORY/g" ./config.properties
+ sed -i "/executor.cores/s/=.*/=$SPARK_EXECUTOR_CORES/g" ./config.properties
+ sed -i "/num.slices/s/=.*/=$SPARK_NUM_SLICES/g" ./config.properties
+
+ # 鍑芥暟璁$畻
+ if [[ $FC_STORAGE_TYPE == 'oss' ]]; then
+ # 淇敼 oss 鐨勪复鏃舵巿鏉
+ sed -i "/fc.cloud_store.temp_auth_internal_end_point/s@//.*@//oss-$FC_REGION-internal.aliyuncs.com@g" ./config.properties
+ sed -i "/fc.cloud_store.temp_auth_end_point/s@//.*@//oss-$FC_REGION.aliyuncs.com@g" ./config.properties
+ sed -i "/fc.cloud_store.temp_auth_role_arn/s@acs:ram::.*:role/wefe-fc-ossread@acs:ram::$FC_ACCOUNT_ID:role/wefe-fc-ossread@g" ./config.properties
+ # 淇敼 oss 閰嶇疆
+ sed -i "/fc.oss.bucket_name/s/=.*/=$FC_OSS_BUCKET_NAME/g" ./config.properties
+ sed -i "/fc.oss.internal_endpoint/s@//.*@//oss-$FC_REGION-internal.aliyuncs.com@g" ./config.properties
+ sed -i "/fc.oss.endpoint/s@//.*@//oss-$FC_REGION.aliyuncs.com@g" ./config.properties
+ else
+ echo "鍑芥暟瀛樺偍绫诲瀷涓嶆敮鎸佽绫诲瀷锛$FC_STORAGE_TYPE"
+ fi
+ sed -i "/fc.storage.type/s/=.*/=$FC_STORAGE_TYPE/g" ./config.properties
+ sed -i "/fc.qualifier/s/=.*/=$FC_QUALIFIER/g" ./config.properties
+ sed -i "/fc.region/s/=.*/=$FC_REGION/g" ./config.properties
+ sed -i "/fc.account_id/s/=.*/=$FC_ACCOUNT_ID/g" ./config.properties
+ sed -i "/fc.access_key_id/s/=.*/=$FC_ACCESS_KEY_ID/g" ./config.properties
+ sed -i "/fc.access_key_secret/s/=.*/=$FC_ACCESS_KEY_SECRET/g" ./config.properties
+ sed -i "/fc.vpc_id/s/=.*/=$FC_VPC_ID/g" ./config.properties
+ sed -i "/fc.v_switch_ids/s/=.*/=$FC_V_SWITCH_IDS/g" ./config.properties
+ sed -i "/fc.security_group_id/s/=.*/=$FC_SECURITY_GROUP_ID/g" ./config.properties
+ sed -i "/fc.account_type/s/=.*/=$FC_ACCOUNT_TYPE/g" ./config.properties
+ sed -i "s|fc.end_point=https://.*.cn-shenzhen.fc.aliyuncs.com|fc.end_point=https://$FC_ACCOUNT_ID.cn-shenzhen.fc.aliyuncs.com|g" ./config.properties
+
+}
+
+send_wefe_config(){
+ cp -f ./config.properties wefe_board_service/resources/mount/
+ cp -f ./config.properties wefe_gateway_service/resources/mount/
+ cp -f ./config.properties wefe_python_service/resources/mount/
+ cp -f ./config.properties wefe_python_gpu_service/resources/mount/
+}
+
+init(){
+ # 鎵ц鍓嶅垵濮嬪寲閰嶇疆鏂囦欢
+ edit_wefe_config
+ # 鍒嗗彂閰嶇疆
+ send_wefe_config
+}
+
+_run_python_service(){
+ if [ ${ACCELERATION,,} = "gpu" ];then
+ cd $PWD/wefe_python_service
+ sh wefe_python_service_start.sh gpu
+ fi
+
+ if [ $SPARK_MODE = "STANDALONE" ]
+ then
+ # 闆嗙兢鏂瑰紡鍚姩
+ start_cluster
+ else
+ # 鍗曟満鍚姩
+ cd $PWD/wefe_python_service
+ sh wefe_python_service_start.sh
+ fi
+}
+
+_stop_cluster_python_service(){
+ if [ $SPARK_MODE = "STANDALONE" ]; then
+ stop_cluster
+ fi
+}
+
+_remove_cluster_python_service(){
+ if [ $SPARK_MODE = "STANDALONE" ]; then
+ remove_cluster
+ fi
+}
+
+start(){
+ init
+ case $INPUT_SERVICE in
+ board)
+ cd $PWD/wefe_board_service
+ sh wefe_board_service_start.sh
+ cd ../wefe_board_website
+ sh wefe_board_website_start.sh
+ ;;
+ gateway)
+ cd $PWD/wefe_gateway_service
+ sh wefe_gateway_service_start.sh
+ ;;
+ python)
+ _run_python_service
+ ;;
+ middleware)
+ cd $PWD/wefe_middleware_service
+ sh wefe_middleware_service_start.sh
+ ;;
+ '')
+ cd $PWD
+ sh wefe_service.sh start middleware
+ sh wefe_service.sh start board
+ sh wefe_service.sh start gateway
+ sh wefe_service.sh start python
+ ;;
+ *)
+ echo "Please Input a Legal Service"
+ echo "eg. {board|gateway|python|middleware}"
+ exit -1
+ esac
+}
+
+stop(){
+ # init
+ case $INPUT_SERVICE in
+ board | gateway | python | middleware)
+ CONTAINER=$(docker ps -a | grep $WEFE_ENV | grep $INPUT_SERVICE | awk '{print $1}' | xargs)
+ docker stop $CONTAINER
+ if [ $INPUT_SERVICE = "python" ]; then
+ _stop_cluster_python_service
+ fi
+ ;;
+ '')
+ CONTAINER=$(docker ps -a | grep $WEFE_ENV | grep wefe | awk '{print $1}' | xargs)
+ docker stop $CONTAINER
+ _stop_cluster_python_service
+ ;;
+ *)
+ echo "Please Input a Legal Service"
+ echo "eg. {board|gateway|python|middleware}"
+ exit -1
+ esac
+}
+
+remove(){
+ # init
+ case $INPUT_SERVICE in
+ board | gateway | python | middleware)
+ CONTAINER=$(docker ps -a | grep $WEFE_ENV | grep $INPUT_SERVICE | awk '{print $1}' | xargs)
+ docker rm $CONTAINER
+ if [ $INPUT_SERVICE = "python" ]; then
+ _remove_cluster_python_service
+ fi
+ ;;
+ '')
+ CONTAINER=$(docker ps -a | grep $WEFE_ENV | grep wefe | awk '{print $1}' | xargs)
+ docker rm $CONTAINER
+ _remove_cluster_python_service
+ ;;
+ *)
+ echo "Please Input a Legal Service"
+ echo "eg. {board|gateway|python|middleware}"
+ exit -1
+ esac
+}
+
+restart(){
+ case $INPUT_SERVICE in
+ board | gateway | python | middleware)
+ CONTAINER=$(docker ps -a | grep $WEFE_ENV |grep $INPUT_SERVICE | awk '{print $1}' | xargs)
+ docker restart $CONTAINER
+ ;;
+ '')
+ CONTAINER=$(docker ps -a | grep $WEFE_ENV | grep wefe | awk '{print $1}' | xargs)
+ docker restart $CONTAINER
+ ;;
+ *)
+ echo "Please Input a Legal Service"
+ echo "eg. {board | gateway | python | middleware}"
+ exit -1
+ esac
+}
+
+help(){
+ echo "Support Action: start | stop | restart"
+ echo "Support Service: board | gateway | python | middleware"
+ echo "sh service.sh [Action] [Service]"
+}
+
+case $INPUT_ACTION in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ remove)
+ remove
+ ;;
+ help)
+ help
+ ;;
+ *)
+ echo "Please Input a Legal Action"
+ echo "eg. {start | stop | restart | help}"
+ exit -1
+esac
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/Dockerfile" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/Dockerfile"
new file mode 100644
index 0000000000000000000000000000000000000000..a61c6f60393c5f3ec86530157af9266f0f503c4a
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/Dockerfile"
@@ -0,0 +1,7 @@
+FROM nginx:1.19.2
+
+WORKDIR /opt/website
+
+COPY html /opt/website/
+
+RUN chmod +x /opt/website
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/docker-compose.yml" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/docker-compose.yml"
new file mode 100644
index 0000000000000000000000000000000000000000..652190a10faff6003f5b4d52e65389be489f21d3
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/docker-compose.yml"
@@ -0,0 +1,30 @@
+version: "3"
+services:
+
+ wefe_serving_website:
+ image: wefe_serving_website:v.2.2 # wefe_version
+ ports:
+ - 3310:80 # website_port
+ restart: always
+ privileged: true
+ networks:
+ - network
+ volumes:
+ - "./mount/default.conf:/etc/nginx/conf.d/default.conf"
+ wefe_serving_service:
+ image: wefe_serving_service:v.2.2 # wefe_version
+ ports:
+ - 9000:9000 # website_port
+ restart: always
+ privileged: true
+ networks:
+ - network
+ volumes:
+ - "/root/docker-compose/logs/service:/data/logs/wefe-serving-service" # service_logs
+ - "./mount/start.sh:/opt/service/start.sh"
+ - "./mount/serving-service.jar:/opt/service/serving-service.jar"
+ - "./mount/application.properties:/opt/service/application.properties"
+
+networks:
+ network:
+ driver: bridge
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/mount/Dockerfile" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/mount/Dockerfile"
new file mode 100644
index 0000000000000000000000000000000000000000..24698d1c9219d34b9c2e8e26941cc9ce8dfa3360
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/mount/Dockerfile"
@@ -0,0 +1,11 @@
+FROM wefe_java_base
+
+WORKDIR /opt/service
+
+COPY serving-service.jar /opt/service/serving-service.jar
+
+COPY start.sh /opt/service/start.sh
+
+RUN chmod +x /opt/service/start.sh
+
+CMD ["sh", "/opt/service/start.sh"]
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/mount/application.properties" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/mount/application.properties"
new file mode 100644
index 0000000000000000000000000000000000000000..7b3bd5ac1bb14773b14baade17f5dd3e5a531c23
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/mount/application.properties"
@@ -0,0 +1,21 @@
+server.servlet.context-path=/serving-service
+
+server.port=9000
+
+logging.level.root=info
+logging.level.com.ibatis=info
+logging.file=/data/logs/wefe-serving-service/wefe-serving-service.log
+logging.file.max-history=60
+logging.file.max-size=20GB
+logging.pattern.console=%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) [%X{requestId}] %clr([%15.15t]){faint} %clr(%-40.40logger{39}[%F:%L]){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}
+logging.pattern.file=%d{yyyy-MM-dd HH:mm:ss.SSS} [%level] [%X{requestId}] ${PID:- } [%15.15t] %-40.40logger{39}[%F:%L] : %m%n
+
+
+spring.datasource.serving.username=root
+spring.datasource.serving.password=root
+spring.datasource.serving.url=jdbc:mysql://123.249.9.220:3147/wefe_serving?characterEncoding=UTF-8&useSSL=false&useUnicode=true&serverTimezone=GMT%2B8
+spring.datasource.serving.driver-class-name=com.mysql.jdbc.Driver
+spring.datasource.serving.type=com.alibaba.druid.pool.DruidDataSource
+spring.jpa.properties.hibernate.show_sql=true
+spring.jpa.properties.hibernate.format_sql=true
+spring.jpa.properties.hibernate.use_sql_comments=true
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/mount/default.conf" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/mount/default.conf"
new file mode 100644
index 0000000000000000000000000000000000000000..b6a4e324e5cb83228aa6debbcc514ddf8d36c730
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/mount/default.conf"
@@ -0,0 +1,26 @@
+server {
+
+ listen 80;
+ server_name 123.249.9.220;
+
+ client_max_body_size 100m;
+
+
+ location / {
+ root /opt/website/serving-website;
+ }
+
+ location /serving-service/ {
+ add_header Access-Control-Allow-Origin *;
+ add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
+ add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
+
+ if ($request_method = 'OPTIONS') {
+ return 204;
+ }
+
+ proxy_pass http://123.249.9.220:9000/serving-service/;
+ proxy_read_timeout 1800;
+ }
+
+}
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/mount/serving-service.jar" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/mount/serving-service.jar"
new file mode 100644
index 0000000000000000000000000000000000000000..e606947eb9ff1af6d68215a3a0edae3617c4c596
Binary files /dev/null and "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/mount/serving-service.jar" differ
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/mount/start.sh" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/mount/start.sh"
new file mode 100644
index 0000000000000000000000000000000000000000..a53f39fd2fbbb81bb2163fec03a5e8cc11cacd12
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/resources/mount/start.sh"
@@ -0,0 +1 @@
+java -jar serving-service.jar
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/serving.md" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/serving.md"
new file mode 100644
index 0000000000000000000000000000000000000000..ec2ab3e011cd593ec5154e41cd21cdff7bc95f48
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/serving.md"
@@ -0,0 +1,183 @@
+
+#前端打包
+```shell
+npm run dev
+npm run build
+npm run build -- dev // dev 对应了 .env 中的配置
+```
+#前端镜像构建
+```shell
+FROM nginx:1.19.2
+
+WORKDIR /opt/website
+
+COPY html /opt/website/
+
+RUN chmod +x /opt/website
+
+```
+#前端镜像保存
+```sh
+sudo docker build -t wefe_serving_website:$WEFE_VERSION .
+sudo docker save -o wefe_serving_website_$WEFE_VERSION.tar wefe_serving_website:$WEFE_VERSION
+```
+
+
+
+
+#后端项目打包方法
+#初始化数据库
+执行SQl脚本:serving-init.sql
+```shell
+mvn clean install -Dmaven.test.skip=true -am -pl serving/serving-service
+```
+SDK 使用方法
+导入 sdk
+
+```shell
+
+
+ com.welab.wefe
+ serving-sdk-java
+ 1.0.0
+
+
+```
+#后端Dockerfile
+```shell
+FROM wefe_java_base
+
+WORKDIR /opt/service
+
+COPY serving-service.jar /opt/service/serving-service.jar
+
+COPY start.sh /opt/service/start.sh
+
+# RUN chmod +x /opt/service/start.sh
+
+CMD ["sh", "/opt/service/start.sh"]
+
+````
+
+#启动脚本start.sh
+```shell
+java -jar serving-service.jar
+```
+#后端镜像保存
+```dockerfile
+sudo docker build -t wefe_serving_service:$WEFE_VERSION .
+sudo docker save -o wefe_serving_service_$WEFE_VERSION.tar wefe_serving_service:$WEFE_VERSION
+```
+
+#docker-compose
+
+可以将外面的application.properties挂载到容器内jar包同一位置,即可生效
+```shell
+version: "3"
+services:
+
+ wefe_serving_website:
+ image: wefe_serving_website:v.2.2 # wefe_version
+ ports:
+ - 3310:80 # website_port
+ restart: always
+ privileged: true
+ networks:
+ - network
+ volumes:
+ - "./mount/default.conf:/etc/nginx/conf.d/default.conf"
+ wefe_serving_service:
+ image: wefe_serving_service:v.2.2 # wefe_version
+ ports:
+ - 9000:9000 # website_port
+ restart: always
+ privileged: true
+ networks:
+ - network
+ volumes:
+ - "/root/docker-compose/logs/service:/data/logs/wefe-serving-service" # service_logs
+ - "./mount/start.sh:/opt/service/start.sh"
+ - "./mount/serving-service.jar:/opt/service/serving-service.jar"
+ - "./mount/application.properties:/opt/service/application.properties"
+
+networks:
+ network:
+ driver: bridge
+```
+
+#nginx,default.conf
+```shell
+server {
+
+ listen 80;
+ server_name 10.10.178.147;
+
+ client_max_body_size 100m;
+
+
+ location / {
+ root /opt/website/serving-website;
+ }
+
+ location /serving-service/ {
+ add_header Access-Control-Allow-Origin *;
+ add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
+ add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
+
+ if ($request_method = 'OPTIONS') {
+ return 204;
+ }
+
+ proxy_pass http://10.10.178.147:9000/serving-service/;
+ proxy_read_timeout 1800;
+ }
+
+}
+
+```
+#启动脚本
+```shell
+#!/bin/bash
+
+# 导入配置
+source ../wefe.cfg
+
+echo "开始加载 serving的前后端 离线镜像"
+docker load < resources/wefe_serving_website_v2.2\.tar
+docker load < resources/wefe_serving_servicev2.2\.tar
+echo "加载 serving的前后端 离线镜像完成"
+
+docker-compose -p $WEFE_ENV -f resources/docker-compose.yml up -d
+
+```
+
+#停止脚本
+```shell
+docker-compose -p wefe -f resources/docker-compose.yml down
+```
+
+
+发起方可以不用硬性要求sql方式获取。
+纵向联邦学习进行预测推理的时候,双方都没有完整的模型,且只有发起方通过调用协作方才能进行完整的预测(此部分逻辑代码底层处理),协作方是不能进行预测的,
+协作方这里的配置是为了保证发起方能正常的调用到己方。
+所以配置的优先级一般是协作方->发起方。
+
+
+#内部玩 debug,provider接口
+协作方模型上线,并且提前debug预测校验数据库。这里建议改成 select feature1,feature2 from table where id = ?。这里的?是一个占位符,会将你下面填的a填充进来组成sql
+发起方配置 {{baseUr}}/serving-service/predict/provider/,指向协作方
+http://10.10.178.147:9000/serving-service/predict/provider/
+http://124.71.228.136:9000/serving-service/predict/provider/
+http://123.249.9.220:9000/serving-service/predict/provider/
+
+发起方最后预测
+
+#外部玩 promter接口
+发起方模型上线
+如果说是你们内部系统自己调用的话可以通过此接口{{baseUr}}/serving-service/predict/promter/调用,这个接口会通过你当时初始化提供的board公钥进行验签的。
+如果是提供给外部调用,你就需要再包装一层,接收到对方的请求后自己再加一次签名,然后调用上述接口。
+
+
+#私钥签名,公钥验签
+AbstractAlgorithm.setFederatedPredictBody
+Launcher.apiPermissionPolicy
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/serving\347\211\271\345\276\201\350\216\267\345\217\226\351\205\215\347\275\256\350\257\264\346\230\216\346\226\207\346\241\243(1).doc" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/serving\347\211\271\345\276\201\350\216\267\345\217\226\351\205\215\347\275\256\350\257\264\346\230\216\346\226\207\346\241\243(1).doc"
new file mode 100644
index 0000000000000000000000000000000000000000..a2350795ab529f26c05e94d7487994a236588198
Binary files /dev/null and "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/serving\347\211\271\345\276\201\350\216\267\345\217\226\351\205\215\347\275\256\350\257\264\346\230\216\346\226\207\346\241\243(1).doc" differ
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/serving\351\205\215\347\275\256\346\250\241\345\236\213\346\265\201\347\250\213(1).doc" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/serving\351\205\215\347\275\256\346\250\241\345\236\213\346\265\201\347\250\213(1).doc"
new file mode 100644
index 0000000000000000000000000000000000000000..6869159bf759a82d89f5c33725450bc7ad21d8c2
Binary files /dev/null and "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/serving\351\205\215\347\275\256\346\250\241\345\236\213\346\265\201\347\250\213(1).doc" differ
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/wefe_serving_service_start.sh" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/wefe_serving_service_start.sh"
new file mode 100644
index 0000000000000000000000000000000000000000..3f3513136778aa4a73ea28ab41a24f047ca202e7
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/wefe_serving_service_start.sh"
@@ -0,0 +1,10 @@
+#!/bin/bash
+# 瀵煎叆閰嶇疆
+source ../wefe.cfg
+
+echo "寮濮嬪姞杞 serving鐨勫墠鍚庣 绂荤嚎闀滃儚"
+docker load < resources/wefe_serving_website_v.2.2\.tar
+docker load < resources/wefe_serving_service_v.2.2\.tar
+echo "鍔犺浇 serving鐨勫墠鍚庣 绂荤嚎闀滃儚瀹屾垚"
+
+docker-compose -p $WEFE_ENV -f resources/docker-compose.yml up -d
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/wefe_serving_service_stop.sh" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/wefe_serving_service_stop.sh"
new file mode 100644
index 0000000000000000000000000000000000000000..0ebd3cd36cc5dd0f1accdcb7c7d03f67b526313f
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/serving/wefe_serving_service_stop.sh"
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+docker-compose -p wefe -f resources/docker-compose.yml down
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/union/blockchain-service.md" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/union/blockchain-service.md"
new file mode 100644
index 0000000000000000000000000000000000000000..b2a0f253cc317c2f8bcc18d593c7238aa5d77753
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/union/blockchain-service.md"
@@ -0,0 +1,42 @@
+blockchain-data-sync 对 union 的区块链相关业务进行了优化处理,实现了区块链数据到业务库的实时同步,以方便做一些复杂查询跟统计的业务操作。
+
+blockchain-data-sync 使用 java 开发,基于 spring-boot 框架,使用 maven 进行包管理;
+
+blockchain-data-sync 依赖 mongodb 数据库,所以在启动前需要先准备好 mongodb 服务;
+
+blockchain-data-sync 区块链节点,所以必须要部署区块链节点。
+
+# 编译打包
+
+项目基于 maven 进行打包(部署机器上需要有 maven 环境)。
+
+```bash
+# 在 [Root Dir] 目录下执行打包命令
+mvn clean install -Dmaven.test.skip=true -am -pl union/blockchain-data-sync
+```
+
+
+#修改文件区块链连接相关配置项。
+
+```yml
+sdk.certPath=/work/fisco/console/conf
+contract.solidity-path=/work/wefe/union/solidity
+```
+
+
+
+#单机mongo
+指定Spring工程的合约路径
+注释掉DatasetContractService的
+//@Transactional(rollbackFor = Exception.class)
+注释掉transactionManager的
+// @Bean
+// public MongoTransactionManager transactionManager(MongoDbFactory mongoDbFactory) {
+// return new MongoTransactionManager(mongoDbFactory);
+// }
+
+**启动项目**
+
+```bash
+nohup java -jar blockchain-data-sync.jar >blockchain-data-sync.out &
+```
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/union/blocklisk.md" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/union/blocklisk.md"
new file mode 100644
index 0000000000000000000000000000000000000000..e8573b4781969f5b34d7ff355ebd3d03b6435aad
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/union/blocklisk.md"
@@ -0,0 +1,9 @@
+#区块链
+sh start.sh
+
+getSystemConfigByKey tx_gas_limit
+
+setSystemConfigByKey tx_gas_limit 2100000000
+
+
+reference:https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/console/console.html#setsystemconfigbykey
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/union/union-service.md" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/union/union-service.md"
new file mode 100644
index 0000000000000000000000000000000000000000..f39ac11b5804bc1ee769206b3f91c9d7c38cf1a5
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/union/union-service.md"
@@ -0,0 +1,81 @@
+union-service 是联邦学习的 union 的后台服务;
+
+union-service 使用去中心化的数据存储方式,存储联邦成员的公开信息,比如成员信息、公开的数据集信息;
+
+union-service 提供 http 接口供各成员修改自身公开信息以及获取联邦中其他成员的公开信息。
+
+项目特点
+使用 Springboot + Mongodb + Fisco bcos(金链盟) 架构方式;
+
+去中心化、防篡改、可追溯性。
+
+环境要求
+在使用本组件前,请确认系统环境已安装相关依赖软件,清单如下:
+
+依赖软件 说明 备注
+Java JDK[1.8]
+Mongodb = Mongodb[4.0]
+Fisco bcos Fisco bcos 搭建请参考
+编译打包
+项目基于 maven 进行打包(部署机器上需要有 maven 环境)。
+#区块链部署
+删除jdk1.8当中的一个安全协议
+config.toml指定证书cert路径
+
+#新建config.toml 文件
+
+[cryptoMaterial]
+
+certPath = "xx/xx/cert" # The certification path
+
+[network]
+
+peers=["0.0.0.0:20200"] # The peer list to connect
+
+
+# 修改 application.properties 相关配置项
+union-service 的启动依赖 resource/application.properties 配置文件
+
+
+```shell
+spring.datasource.mongodb.uri=mongodb://user:pwd@0.0.0.0:37017/wefe_union
+spring.datasource.mongodb.databaseName=wefe_union
+
+block.chain.toml.file.path=xx/xx/config.toml
+````
+#在 [Root Dir] 目录下执行打包命令打包
+```shell
+mvn clean install -Dmaven.test.skip=true -am -pl union/union-service
+```
+
+#启动脚本
+```shell
+nohup java -jar wefe-union-service.jar >union-service.out &
+
+
+```
+
+#union与区块链对接的问题排查
+
+异常:Algorithm constraints check failed on disabled algorithm: secp256k1
+问题解决方式一,推荐:
+查看jdk1.8.0_271/jre/lib/security目录java.security文件
+查找:secp256k1
+jdk.disabled.namedCurves = secp112r1, secp112r2, secp128r1, secp128r2, \
+secp160k1, secp160r1, secp160r2, secp192k1, secp192r1, secp224k1, \
+secp224r1, secp256k1, sect113r1, sect113r2, sect131r1, sect131r2, \
+sect163k1, sect163r1, sect163r2, sect193r1, sect193r2, sect233k1, \
+sect233r1, sect239k1, sect283k1, sect283r1, sect409k1, sect409r1, \
+sect571k1, sect571r1, X9.62 c2tnb191v1, X9.62 c2tnb191v2, \
+X9.62 c2tnb191v3, X9.62 c2tnb239v1, X9.62 c2tnb239v2, X9.62 c2tnb239v3, \
+X9.62 c2tnb359v1, X9.62 c2tnb431r1, X9.62 prime192v2, X9.62 prime192v3, \
+X9.62 prime239v1, X9.62 prime239v2, X9.62 prime239v3, brainpoolP256r1, \
+brainpoolP320r1, brainpoolP384r1, brainpoolP512r1
+将:secp256k1删掉就可以
+
+问题解决方式二:
+SDK依赖的Java禁用了secp256k1曲线,解决方法包括:
+使用1.8以上的OracleJDK,启动SDK时,加上-Djdk.tls.namedGroups="secp256k1"参数启用secp256k1曲线
+升级到最新的Web3SDK 2.6.2版本
+
+
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/wefe.cfg" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/wefe.cfg"
new file mode 100644
index 0000000000000000000000000000000000000000..1b9ceefea2af82064fa26f61375c6bf47c532f71
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/wefe.cfg"
@@ -0,0 +1,101 @@
+# **************
+# 浠ヤ笅閰嶇疆涓哄繀濉」
+# ***************
+
+### VERSION ####
+WEFE_VERSION=v.2.2
+WEFE_ENV=release
+
+# 鑻ヤ笉闇瑕佸缃戣闂紝鍒欓兘濉啓鍐呯綉鍦板潃
+# 鏈満鍐呯綉 IP
+INTRANET_IP=10.10.178.147
+# 鏈満澶栫綉 IP
+EXTRANET_IP=10.10.178.147
+
+# **************
+# 浠ヤ笅閰嶇疆涓洪夊~椤
+# ***************
+
+# Docker 鏁版嵁瀛樺偍鐩綍锛岄渶瑕佸閲忚緝澶х殑鐩綍
+DATA_PATH=/data/wefe/docker-compose
+
+### middleware ###
+
+# mysql 甯愬彿瀵嗙爜涓庢暟鎹簱
+MYSQL_USERNAME=wefe
+MYSQL_PASSWORD=wefe2020
+MYSQL_DATABASE=wefe_board
+# mysql 绔彛
+MYSQL_PORT=4406
+
+# clickhouse
+# 甯愬彿瀵嗙爜
+CLICKHOUSE_USERNAME=wefe
+CLICKHOUSE_PASSWORD=wefe2020
+# 鏈嶅姟绔彛
+CLICKHOUSE_PORT=8122
+CLICKHOUSE_TCP_PORT=9900
+
+### board_website ###
+
+# nginx 绔彛
+NGINX_PORT=80
+
+### board-service ###
+
+# 鏈嶅姟绔彛
+BOARD_SERVICE_PORT=8080
+
+### Flow ###
+
+# 鏈嶅姟绔彛
+PYTHON_SERVICE_PORT=5000
+
+### gateway ###
+
+# 缃戝叧绔彛
+GATEWAY_SERVICE_PORT=50051
+
+### 璁$畻寮曟搸 ###
+
+# 璁$畻寮曟搸锛孲PARK or FC
+CALCULATION_ENGINE=SPARK
+
+# Spark 寮曟搸鐩稿叧閰嶇疆
+# 榛樿涓 32G 鍐呭瓨鐨勬湇鍔″櫒閰嶇疆
+SPARK_DRIVER_MEMORY=15g
+SPARK_DRIVER_MAXRESULTSIZE=2g
+SPARK_NUM_EXECUTORS=6
+SPARK_EXECUTOR_MEMORY=2g
+SPARK_EXECUTOR_CORES=1
+SPARK_NUM_SLICES=32
+
+# 闃块噷浜戝嚱鏁拌绠楀紩鎿庣浉鍏抽厤缃
+FC_ACCOUNT_ID="xxx"
+FC_REGION="cn-shenzhen"
+FC_ACCESS_KEY_ID="xxx"
+FC_ACCESS_KEY_SECRET="xxx"
+FC_QUALIFIER="LATEST"
+FC_STORAGE_TYPE="oss"
+FC_OSS_BUCKET_NAME="xxx"
+FC_VPC_ID=""
+FC_V_SWITCH_IDS=""
+FC_SECURITY_GROUP_ID=""
+
+# CPU銆丟PU 妯″紡鐩稿叧閰嶇疆锛孨ONE or GPU
+ACCELERATION="NONE"
+
+### 鍒嗗竷寮忛儴缃查厤缃 ###
+
+# 涓棿浠舵湇鍔 IP
+MIDDLEWARE_SERVICE_INTRANET_IP=
+MIDDLEWARE_SERVICE_EXTRANET_IP=
+# Python 鏈嶅姟 IP
+PYTHON_SERVICE_INTRANET_IP=
+PYTHON_SERVICE_EXTRANET_IP=
+# Board 鏈嶅姟 IP
+BOARD_SERVICE_INTRANET_IP=
+BOARD_SERVICE_EXTRANET_IP=
+# Gateway 鏈嶅姟 IP
+GATEWAY_SERVICE_INTRANET_IP=
+GATEWAY_SERVICE_EXTRANET_IP=
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/wefe_service.sh" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/wefe_service.sh"
new file mode 100644
index 0000000000000000000000000000000000000000..c354f68f5b7d580191da865c9e131dcc55151238
--- /dev/null
+++ "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/wefe_service.sh"
@@ -0,0 +1,184 @@
+#!/bin/bash
+
+export INPUT_ACTION=$1
+export INPUT_SERVICE=$2
+export INPUT_DEPLOY=$3
+
+source ./wefe.cfg
+
+export PWD=$(pwd)
+
+edit_wefe_config(){
+
+ # ************
+ # 鍔犻熸柟妗堢浉鍏抽厤缃
+ # ************
+ sed -i "/wefe.job.acceleration/s/=.*/=$ACCELERATION/g" ./config.properties
+
+ # ************
+ # 涓棿浠剁浉鍏抽厤缃
+ # ************
+
+ # clickhouse
+ sed -i "/clickhouse.url/s/:\/\/.*/:\/\/$INTRANET_IP:$CLICKHOUSE_PORT/g" ./config.properties
+ sed -i "/clickhouse.host/s/=.*/=$INTRANET_IP/g" ./config.properties
+ sed -i "/clickhouse.tcp.port/s/=.*/=$CLICKHOUSE_TCP_PORT/g" ./config.properties
+ sed -i "/clickhouse.username/s/=.*/=$CLICKHOUSE_USERNAME/g" ./config.properties
+ sed -i "/clickhouse.password/s/=.*/=$CLICKHOUSE_PASSWORD/g" ./config.properties
+
+ # mysql
+ sed -i "/mysql.url/s/:\/\/.*?/:\/\/$INTRANET_IP:$MYSQL_PORT\/$MYSQL_DATABASE?/g" ./config.properties
+ sed -i "/mysql.host/s/=.*/=$INTRANET_IP/g" ./config.properties
+ sed -i "/mysql.port/s/=.*/=$MYSQL_PORT/g" ./config.properties
+ sed -i "/mysql.database/s/=.*/=$MYSQL_DATABASE/g" ./config.properties
+ sed -i "/mysql.username/s/=.*/=$MYSQL_USERNAME/g" ./config.properties
+ sed -i "/mysql.password/s/=.*/=$MYSQL_PASSWORD/g" ./config.properties
+
+ # ************
+ # 璁$畻寮曟搸鐩稿叧閰嶇疆
+ # ************
+
+ # 璁$畻寮曟搸閫夋嫨
+ sed -i "/wefe.job.backend/s/=.*/=$CALCULATION_ENGINE/g" ./config.properties
+
+ # spark
+ sed -i "/driver.memory/s/=.*/=$SPARK_DRIVER_MEMORY/g" ./config.properties
+ sed -i "/driver.maxResultSize/s/=.*/=$SPARK_DRIVER_MAXRESULTSIZE/g" ./config.properties
+ sed -i "/num.executors/s/=.*/=$SPARK_NUM_EXECUTORS/g" ./config.properties
+ sed -i "/executor.memory/s/=.*/=$SPARK_EXECUTOR_MEMORY/g" ./config.properties
+ sed -i "/executor.cores/s/=.*/=$SPARK_EXECUTOR_CORES/g" ./config.properties
+ sed -i "/num.slices/s/=.*/=$SPARK_NUM_SLICES/g" ./config.properties
+
+ # 鍑芥暟璁$畻
+ if [[ $FC_STORAGE_TYPE == 'oss' ]]; then
+ # 淇敼 oss 鐨勪复鏃舵巿鏉
+ sed -i "/fc.cloud_store.temp_auth_internal_end_point/s@//.*@//oss-$FC_REGION-internal.aliyuncs.com@g" ./config.properties
+ sed -i "/fc.cloud_store.temp_auth_end_point/s@//.*@//oss-$FC_REGION.aliyuncs.com@g" ./config.properties
+ sed -i "/fc.cloud_store.temp_auth_role_arn/s@acs:ram::.*:role/wefe-fc-ossread@acs:ram::$FC_ACCOUNT_ID:role/wefe-fc-ossread@g" ./config.properties
+ # 淇敼 oss 閰嶇疆
+ sed -i "/fc.oss.bucket_name/s/=.*/=$FC_OSS_BUCKET_NAME/g" ./config.properties
+ sed -i "/fc.oss.internal_endpoint/s@//.*@//oss-$FC_REGION-internal.aliyuncs.com@g" ./config.properties
+ sed -i "/fc.oss.endpoint/s@//.*@//oss-$FC_REGION.aliyuncs.com@g" ./config.properties
+ else
+ echo "鍑芥暟瀛樺偍绫诲瀷涓嶆敮鎸佽绫诲瀷锛$FC_STORAGE_TYPE"
+ fi
+ sed -i "/fc.storage.type/s/=.*/=$FC_STORAGE_TYPE/g" ./config.properties
+ sed -i "/fc.qualifier/s/=.*/=$FC_QUALIFIER/g" ./config.properties
+ sed -i "/fc.region/s/=.*/=$FC_REGION/g" ./config.properties
+ sed -i "/fc.account_id/s/=.*/=$FC_ACCOUNT_ID/g" ./config.properties
+ sed -i "/fc.access_key_id/s/=.*/=$FC_ACCESS_KEY_ID/g" ./config.properties
+ sed -i "/fc.access_key_secret/s/=.*/=$FC_ACCESS_KEY_SECRET/g" ./config.properties
+ sed -i "/fc.vpc_id/s/=.*/=$FC_VPC_ID/g" ./config.properties
+ sed -i "/fc.v_switch_ids/s/=.*/=$FC_V_SWITCH_IDS/g" ./config.properties
+ sed -i "/fc.security_group_id/s/=.*/=$FC_SECURITY_GROUP_ID/g" ./config.properties
+ sed -i "s|fc.end_point=https://.*.cn-shenzhen.fc.aliyuncs.com|fc.end_point=https://$FC_ACCOUNT_ID.cn-shenzhen.fc.aliyuncs.com|g" ./config.properties
+
+}
+
+send_wefe_config(){
+ cp -f ./config.properties wefe_board_service/resources/mount/
+ cp -f ./config.properties wefe_gateway_service/resources/mount/
+ cp -f ./config.properties wefe_python_service/resources/mount/
+}
+
+init(){
+ # 鎵ц鍓嶅垵濮嬪寲閰嶇疆鏂囦欢
+ edit_wefe_config
+ # 鍒嗗彂閰嶇疆
+ send_wefe_config
+}
+
+start(){
+ init
+ case $INPUT_SERVICE in
+ board)
+ cd $PWD/wefe_board_service
+ sh wefe_board_service_start.sh
+ cd ../wefe_board_website
+ sh wefe_board_website_start.sh
+ ;;
+ gateway)
+ cd $PWD/wefe_gateway_service
+ sh wefe_gateway_service_start.sh
+ ;;
+ python)
+ cd $PWD/wefe_python_service
+ sh wefe_python_service_start.sh
+ ;;
+ middleware)
+ cd $PWD/wefe_middleware_service
+ sh wefe_middleware_service_start.sh
+ ;;
+ '')
+ cd $PWD
+ sh wefe_service.sh start middleware
+ sh wefe_service.sh start board
+ sh wefe_service.sh start gateway
+ sh wefe_service.sh start python
+ ;;
+ *)
+ echo "Please Input a Legal Service"
+ echo "eg. {board|gateway|python|middleware}"
+ exit -1
+ esac
+}
+
+stop(){
+ # init
+ case $INPUT_SERVICE in
+ board | gateway | python | middleware)
+ CONTAINER=$(docker ps -a | grep $WEFE_ENV | grep $INPUT_SERVICE | awk '{print $1}' | xargs)
+ docker stop $CONTAINER
+ ;;
+ '')
+ CONTAINER=$(docker ps -a | grep $WEFE_ENV | grep wefe | awk '{print $1}' | xargs)
+ docker stop $CONTAINER
+ ;;
+ *)
+ echo "Please Input a Legal Service"
+ echo "eg. {board|gateway|python|middleware}"
+ exit -1
+ esac
+}
+
+restart(){
+ case $INPUT_SERVICE in
+ board | gateway | python | middleware)
+ CONTAINER=$(docker ps -a | grep $WEFE_ENV |grep $INPUT_SERVICE | awk '{print $1}' | xargs)
+ docker restart $CONTAINER
+ ;;
+ '')
+ CONTAINER=$(docker ps -a | grep $WEFE_ENV | grep wefe | awk '{print $1}' | xargs)
+ docker restart $CONTAINER
+ ;;
+ *)
+ echo "Please Input a Legal Service"
+ echo "eg. {board | gateway | python | middleware}"
+ exit -1
+ esac
+}
+
+help(){
+ echo "Support Action: start | stop | restart"
+ echo "Support Service: board | gateway | python | middleware"
+ echo "sh service.sh [Action] [Service]"
+}
+
+case $INPUT_ACTION in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ help)
+ help
+ ;;
+ *)
+ echo "Please Input a Legal Action"
+ echo "eg. {start | stop | restart | help}"
+ exit -1
+esac
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/\346\250\241\345\235\227\347\273\223\346\236\204.png" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/\346\250\241\345\235\227\347\273\223\346\236\204.png"
new file mode 100644
index 0000000000000000000000000000000000000000..bc8318ecab4a6f6e4dfc42123fe459d9a4538852
Binary files /dev/null and "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/\346\250\241\345\235\227\347\273\223\346\236\204.png" differ
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/\351\203\250\347\275\262\346\236\266\346\236\204.doc" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/\351\203\250\347\275\262\346\236\266\346\236\204.doc"
new file mode 100644
index 0000000000000000000000000000000000000000..d04d0ab1e7ff0f9912244b309ae746fad464c757
Binary files /dev/null and "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/\351\203\250\347\275\262\346\236\266\346\236\204.doc" differ
diff --git "a/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/\351\203\250\347\275\262\346\236\266\346\236\204.jpg" "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/\351\203\250\347\275\262\346\236\266\346\236\204.jpg"
new file mode 100644
index 0000000000000000000000000000000000000000..df4477fc995667c46fbd1649be47ca036e2a04ca
Binary files /dev/null and "b/BFLP234/FederationStudy/01.\351\203\250\347\275\262\346\225\231\347\250\213/\351\203\250\347\275\262\346\236\266\346\236\204.jpg" differ
diff --git "a/BFLP234/FederationStudy/02.\345\212\237\350\203\275\350\257\264\346\230\216/\345\212\237\350\203\275\350\257\264\346\230\216.doc" "b/BFLP234/FederationStudy/02.\345\212\237\350\203\275\350\257\264\346\230\216/\345\212\237\350\203\275\350\257\264\346\230\216.doc"
new file mode 100644
index 0000000000000000000000000000000000000000..cb9bcb46dbf6ab4b223c3c1ab5159f298ccf2c33
Binary files /dev/null and "b/BFLP234/FederationStudy/02.\345\212\237\350\203\275\350\257\264\346\230\216/\345\212\237\350\203\275\350\257\264\346\230\216.doc" differ
diff --git "a/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/.gitignore" "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/.gitignore"
new file mode 100644
index 0000000000000000000000000000000000000000..88f397f48ed85f39710d3b0349bb2d8b05d4a8ce
--- /dev/null
+++ "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/.gitignore"
@@ -0,0 +1,48 @@
+# 鎺掗櫎 ide 鏂囦欢
+.idea/
+*.iml
+out
+gen
+**/bin/
+*.project
+.settings/
+.classpath
+.vscode/
+.factorypath
+
+# 鎺掗櫎缂栬瘧杈撳嚭
+*.class
+target/
+
+# 鎺掗櫎鏃ュ織
+log/
+logs/
+*.log
+*.log.*
+
+# 鎺掗櫎 Microsoft Office 涓存椂鏂囦欢
+~$*.*
+
+# py鐩稿叧鎺掗櫎
+*.py[cod]
+
+# db鎺掗櫎
+data/__META__/
+data/IN_MEMORY/
+data/LMDB/
+data/sqlite/
+data/export/
+
+# 鎺掗櫎job鏁版嵁
+jobs/
+
+# 鎺掗櫎build
+build/
+**/bin/
+# 鎺掗櫎mac鏈湴鏂囦欢
+*.DS_Store
+*.properties
+venv/
+/docker/
+**/assembly/
+/assembly/
diff --git "a/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/LICENSE" "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/LICENSE"
new file mode 100644
index 0000000000000000000000000000000000000000..9d098b8bee5e919738cc54e569f5d860421e53cb
--- /dev/null
+++ "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/LICENSE"
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2021 Tianmian Tech. All Rights Reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/README.md" "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/README.md"
new file mode 100644
index 0000000000000000000000000000000000000000..e9fcd3efdc1fa71ad2a5e2129777a5bb9a6fad24
--- /dev/null
+++ "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/README.md"
@@ -0,0 +1,108 @@
+
+
+```text
+
+ ___ __ _______ ________ _______
+|\ \ |\ \|\ ___ \ |\ _____\\ ___ \
+\ \ \ \ \ \ \ __/|\ \ \__/\ \ __/|
+ \ \ \ __\ \ \ \ \_|/_\ \ __\\ \ \_|/__
+ \ \ \|\__\_\ \ \ \_|\ \ \ \_| \ \ \_|\ \
+ \ \____________\ \_______\ \__\ \ \_______\
+ \|____________|\|_______|\|__| \|_______|
+
+
+```
+
+WeFe ( WeLab Federated Learning ) 鏄 Welab 姹囩珛闆嗗洟瀛愬叕鍙竅澶╁啎](https://www.tianmiantech.com)绉戞妧鍙戣捣鐨勫紑婧愰」鐩紝涓鸿仈閭﹀涔犵敓鎬佺郴缁熸彁渚涗簡涓濂楀ソ鐢ㄧ殑鍙潬鐨勫畨鍏ㄨ绠楁鏋躲
+
+`Documentation锛歚 https://tianmiantech.github.io/WeFe/ or http://tianmiantech.gitee.io/wefe
+
+
+# 椤圭洰鐗圭偣
+
+娣峰悎鑱旈偊锛岀旱鍚戣仈閭﹀涔犱笌妯悜鑱旈偊瀛︿範缁撳悎鐨勮涓氳В鍐虫柟妗堬紱
+
+浣跨敤鑱旂洘閾句綔涓鸿仈閭︿腑蹇冨瓨璇佸叡浜柟妗堬紱
+
+鏀寔娴佺▼鍙鍖栵紝鎵樻媺鎷界紪杈戞祦绋嬬殑浜や簰褰㈠紡锛
+
+鍩轰簬鍑芥暟璁$畻涓庝簯瀛樺偍瀵硅薄瀹炵幇鍔ㄦ佽祫婧愭嫇灞曟柟妗堬紱
+
+鏀寔 GPU 鍔犻熷悓鎬佸姞瀵嗚繍绠楋紙瀹為獙瀹わ級銆
+
+
+# 鑱旈偊瀛︿範绠楁硶
+
+WeFe 鐩墠鏀寔鐨勮仈閭﹀涔犵畻娉曪細妯悜鑱旈偊銆佺旱鍚戣仈閭︺佹贩鍚堣仈閭︺佹繁搴﹀涔犮
+
+鍩轰簬FATE锛屾敼杩涘苟鏂板浜嗙浉鍏崇畻娉曪紝绠楁硶缁嗚妭璇峰弬鑰 Kernel 妯″潡鏂囨。 [kernel/README.md](./kernel)銆
+
+# 瀹夎浣跨敤
+
+WeFe 鏀寔 Linux 鎿嶄綔绯荤粺锛屾帹鑽愪娇鐢 Centos 7+ 鐨勭増鏈
+
+WeFe 鎻愪緵浜嗕竴濂楀熀浜 Docker 鐨勪究鎹烽儴缃叉柟寮忋
+
+WeFe 鎻愪緵浜嗕竴濂楀畬鏁寸殑鍦ㄧ嚎浣撻獙鐜 Demo ENV銆
+
+## Docker 閮ㄧ讲
+
+鍗曟満閮ㄧ讲锛岃瑙 [release/docker/README.md](./release/docker)
+
+## 鍦ㄧ嚎浣撻獙
+
+WeFe 涓嶄粎鏀寔鏈湴閮ㄧ讲杩愯娴嬭瘯锛屽苟涓旀彁渚涗簡涓濂楀畬鏁寸殑绾夸笂浣撻獙鐜锛
+
+鐢ㄦ埛鍙互閫氳繃绾夸笂浣撻獙鐜锛屾ā鎷熻仈閭︿腑涓変綅鎴愬憳闂寸殑寤烘ā鎿嶄綔锛
+
+浣撻獙鐜鐨勮仈閭︽垚鍛樿鑹叉湁 DemoMember1銆丏emoMember2銆丏emoMember3锛
+
+璇︽儏璁块棶[鍦ㄧ嚎浣撻獙骞冲彴](https://tianmiantech.com/federal)浣撻獙銆
+
+# 绯荤粺鏋舵瀯
+
+WeFe 绯荤粺鐢变袱澶фā鍧 union 涓 member 缁勬垚锛
+
+member 鏄 WeFe 鑱旈偊瀛︿範骞冲彴涓繘琛岃仈閭﹀缓妯$殑鏈灏忔垚鍛樺崟浣嶏紱
+
+union 鏄竴涓幓涓績鍖栫殑鍏叡鏈嶅姟骞冲彴锛屽瓨鍌ㄤ簡鑱旈偊涓殑鍙叕寮淇℃伅骞舵彁渚涚粰鑱旈偊涓殑 member 璁块棶銆
+
+妯″潡璇︽儏锛
+
+鈥 union 妯″潡锛岃瑙 [union/README.md](./union)锛
+
+鈥 member 妯″潡锛岃瑙 [README_MEMBER.md](./README_MEMBER.md)銆
+
+# 鍙戣鐗堟湰
+
+2021-09-23锛歷.2.2
+
+# 鎴愪负椤圭洰璐$尞鑰
+
+椤圭洰鐨勬瀯寤轰笌缂栧啓鍦ㄤ竴瀹氱▼搴︿笂閬靛惊浠ヤ笅浠g爜瑙勮寖
+
+Python 浠g爜瑙勮寖锛歔Google Python Style Guide](https://google.github.io/styleguide/pyguide.html)
+
+Java 浠g爜瑙勮寖锛歔銆婇樋閲屽反宸 Java 寮鍙戞墜鍐屻媇(https://github.com/alibaba/p3c)
+
+Java 浠g爜瑙勮寖鍖栨彃浠讹細[IDEA 鎻掍欢 alibaba-java-coding-guidelines](https://plugins.jetbrains.com/plugin/10046-alibaba-java-coding-guidelines)
+
+# 鐗堟潈
+
+Apache 2.0
+
+# 鑱旂郴鎴戜滑
+
+娆㈣繋鎵爜娣诲姞 WeFe 灏忓姪鎵嬶紙寰俊鍙凤細tianmiantech001锛夛紱
+
+
+

+
+
+娣诲姞鍚庢淮婊村皬鍔╂墜锛屽皬鍔╂墜浼氭媺浣犺繘 WeFe 鎶鏈氦娴佺兢鍝锛
+
+娆㈣繋鍏虫敞澶╁啎绉戞妧鍏紬鍙
+
+

+
+蹇潵瀵绘壘蹇楀悓閬撳悎鐨勪紮浼村惂锛
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/README_MEMBER.md" "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/README_MEMBER.md"
new file mode 100644
index 0000000000000000000000000000000000000000..3fd46795ae903e07d4edb56a49c83e9e664edfb1
--- /dev/null
+++ "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/README_MEMBER.md"
@@ -0,0 +1,28 @@
+鍦ㄨ仈閭﹀涔犱腑锛岃仈閭︽槸鐢变竴涓釜鑱旈偊鎴愬憳缁勬垚鐨勶紝涓涓仈閭︽垚鍛樺氨鏄竴涓 member銆
+
+# 妯″潡姒傝堪
+
+**鍩虹妯″潡**
+
+[board](./board)锛氬缓妯℃搷浣滐紝鐢ㄦ埛绠$悊锛
+
+[gateway](./gateway)锛氭湇鍔¢棿鏁版嵁浜や簰锛
+
+[flow](./flow)锛氫换鍔¤皟搴︾洃鎺э紱
+
+[kernel](./kernel)锛氬簳灞傜畻娉曪紱
+
+[common](./common)锛氬悇妯″潡鍩虹鏈嶅姟銆
+
+**楂樼骇妯″潡**
+
+[fusion](./fusion)锛氭暟鎹瀺鍚堟湇鍔★紱
+
+[serving](./serving)锛氭ā鍨嬭皟鐢ㄦ湇鍔°
+
+# 妯″潡浜や簰
+
+
+
+
+
diff --git "a/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/README.md" "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/README.md"
new file mode 100644
index 0000000000000000000000000000000000000000..47403fe040b89f5719460b73432e74adbdeeb341
--- /dev/null
+++ "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/README.md"
@@ -0,0 +1,8 @@
+board 妯″潡鍦 WeFe 绯荤粺鎻愪緵锛氬彲瑙嗗寲寤烘ā鎿嶄綔銆佺敤鎴风鐞嗕互鍙婄郴缁熺鐞嗙瓑鍔熻兘銆
+
+# 妯″潡鏋舵瀯
+
+[board-service](./board-service/README.md)锛氬悗鍙版湇鍔★紝鎻愪緵 API 璋冪敤锛
+
+[board-website](./board-website/README.md)锛氬墠绔ā鍧楋紝鎻愪緵鍙鍖栥
+
diff --git "a/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/board-service/README.md" "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/board-service/README.md"
new file mode 100644
index 0000000000000000000000000000000000000000..a48ae7423d678b4ff8cf0f3704e52b0b8533275f
--- /dev/null
+++ "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/board-service/README.md"
@@ -0,0 +1,53 @@
+board-service 鏄 board-website 鐨勫悗鍙版湇鍔★紝鎻愪緵 HTTP API 渚涘叾璋冪敤銆
+
+# 椤圭洰鐨勬墦鍖呬笌鍚姩
+
+board-service 浣跨敤 java 寮鍙戯紝鍩轰簬 spring-boot 妗嗘灦锛屼娇鐢 maven 杩涜鍖呯鐞嗐
+
+board-service 鐨勫悇绉嶅姛鑳戒緷璧 WeFe 涓叾浠栫殑鏈嶅姟锛屼絾灏 board-service 鏈韩鐨勮繍琛岃岃█锛屽彧渚濊禆 mysql 鏁版嵁搴擄紝鎵浠ュ湪鍚姩鍓嶉渶瑕佸厛鍑嗗濂 mysql 鏈嶅姟銆
+
+杩欓噷鍙弿杩板浣曠紪璇戝苟鍚姩 board-service 鏈嶅姟锛屽畬鏁寸殑 WeFe 绯荤粺閮ㄧ讲杩囩▼璇﹁ [WeFe 閮ㄧ讲鏂囨。](/docker/README.md)銆
+
+**鍒濆鍖栨暟鎹簱锛堝缓琛級**
+
+鎵ц `wefe_board.sql` 涓殑 sql 鑴氭湰銆
+
+**缂栬瘧 / 鎵撳寘**
+
+鍩轰簬 maven 杩涜鎵撳寘锛堥儴缃叉満鍣ㄤ笂闇瑕佹湁 maven 鐜锛夈
+
+```bash
+mvn clean install -Dmaven.test.skip=true -am -pl board/board-service
+```
+
+**淇敼閰嶇疆鏂囦欢**
+
+board-service 鐨勫惎鍔ㄤ緷璧 `config.properties` 閰嶇疆鏂囦欢锛岄渶瑕佸湪 jar 鍖呭悓鐩綍鏀剧疆璇ラ厤缃枃浠讹紝绋嬪簭浼氳嚜鍔ㄤ粠 jar 鍖呯洰褰曡鍙栥
+
+淇敼 mysql 鐩稿叧閰嶇疆椤
+
+```bash
+db.mysql.url=jdbc:mysql://0.0.0.0:3306/wefe_board?characterEncoding=UTF-8&useSSL=false&useUnicode=true&serverTimezone=GMT%2B8
+db.mysql.host=0.0.0.0
+db.mysql.port=3306
+db.mysql.database=wefe_board
+db.mysql.username=wefe
+db.mysql.password=password
+```
+
+淇敼鏂囦欢涓婁紶鐩稿叧閰嶇疆椤
+
+```bash
+# 鏂囦欢涓婁紶鐩稿叧鍔熻兘浼氬皢鏂囦欢缁熶竴涓婁紶鍒版鐩綍
+wefe.file.upload.dir=/data/wefe_file_upload_dir
+```
+
+**鍚姩**
+
+```bash
+java -jar wefe-board-service.jar
+```
+
+**璁块棶**
+
+鍦ㄦ祻瑙堝櫒涓闂 [http://localhost:8080/board-service/apis](http://localhost:8080/board-service/apis) 锛屽鏋滆兘鐪嬪埌绯荤粺 api 鍒楄〃锛屽嵆浠h〃鏈嶅姟鍚姩鎴愬姛銆
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/board-service/pom.xml" "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/board-service/pom.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..cbc353c511275369f52215cf57f24e1b4711f99f
--- /dev/null
+++ "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/board-service/pom.xml"
@@ -0,0 +1,159 @@
+
+
+ 4.0.0
+
+ com.welab.wefe
+ board
+ 1.0.0
+
+
+ board-service
+
+
+ 1.29.0
+
+
+
+
+ com.welab.wefe
+ common-web
+ ${project.parent.version}
+
+
+ com.welab.wefe
+ common-lang
+ ${project.parent.version}
+
+
+ com.welab.wefe
+ common-data-storage
+ ${project.parent.version}
+
+
+ org.hibernate.javax.persistence
+ hibernate-jpa-2.1-api
+ 1.0.0.Final
+ compile
+
+
+ io.grpc
+ grpc-netty-shaded
+ ${grpc.version}
+
+
+ io.grpc
+ grpc-protobuf
+ ${grpc.version}
+
+
+ io.grpc
+ grpc-stub
+ ${grpc.version}
+
+
+ io.netty
+ netty-all
+ 4.1.50.Final
+
+
+ com.google.protobuf
+ protobuf-java-util
+ 3.7.1
+
+
+ com.googlecode.protobuf-java-format
+ protobuf-java-format
+ 1.4
+
+
+ cn.hutool
+ hutool-core
+ 4.6.7
+
+
+ org.springframework.boot
+ spring-boot-starter-websocket
+
+
+
+ commons-io
+ commons-io
+ 2.7
+
+
+
+ org.jpmml
+ pmml-evaluator
+ 1.4.1
+
+
+ com.google.guava
+ guava
+
+
+
+
+ com.vladmihalcea
+ hibernate-types-52
+ 2.4.2
+
+
+
+ com.google.guava
+ guava
+ 30.0-jre
+
+
+
+ org.springframework.boot
+ spring-boot-starter-mail
+
+
+ log4j-api
+ org.apache.logging.log4j
+
+
+ slf4j-api
+ org.slf4j
+
+
+
+
+
+ org.apache.hadoop
+ hadoop-client
+ 2.7.4
+
+
+
+ org.apache.hive
+ hive-jdbc
+ 2.3.4
+
+
+ org.apache.logging.log4j
+ *
+
+
+ jdk.tools
+ *
+
+
+
+
+
+
+ wefe-board-service
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+ com.welab.wefe.board.service.BoardService
+
+
+
+
+
\ No newline at end of file
diff --git "a/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/board-service/src/main/java/com/welab/wefe/board/service/BoardService.java" "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/board-service/src/main/java/com/welab/wefe/board/service/BoardService.java"
new file mode 100644
index 0000000000000000000000000000000000000000..716e0583c81ba8eada9ed32835bdfe4aa80306f3
--- /dev/null
+++ "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/board-service/src/main/java/com/welab/wefe/board/service/BoardService.java"
@@ -0,0 +1,141 @@
+/**
+ * Copyright 2021 Tianmian Tech. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.welab.wefe.board.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.welab.wefe.board.service.base.OnlineDemoApi;
+import com.welab.wefe.board.service.constant.Config;
+import com.welab.wefe.board.service.exception.FlowNodeException;
+import com.welab.wefe.board.service.operation.OperationLogAfterApiExecute;
+import com.welab.wefe.board.service.service.CacheObjects;
+import com.welab.wefe.common.StatusCode;
+import com.welab.wefe.common.data.storage.StorageManager;
+import com.welab.wefe.common.exception.StatusCodeWithException;
+import com.welab.wefe.common.util.JObject;
+import com.welab.wefe.common.util.RSAUtil;
+import com.welab.wefe.common.web.CurrentAccount;
+import com.welab.wefe.common.web.Launcher;
+import com.welab.wefe.common.web.config.ApiBeanNameGenerator;
+import com.welab.wefe.common.web.dto.ApiResult;
+import com.welab.wefe.common.web.dto.SignedApiInput;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeansException;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+import java.nio.charset.StandardCharsets;
+
+/**
+ * @author hunter.zhao
+ */
+@SpringBootApplication
+@EnableScheduling
+@EnableAsync
+@ComponentScan(
+ lazyInit = true,
+ nameGenerator = ApiBeanNameGenerator.class,
+ basePackageClasses = {BoardService.class, Launcher.class, StorageManager.class}
+)
+public class BoardService implements ApplicationContextAware {
+
+ private static final Logger LOG = LoggerFactory.getLogger(BoardService.class);
+
+ public static void main(String[] args) {
+ Launcher
+ .instance()
+ .apiPackageClass(BoardService.class)
+ // Login status check method
+ .checkSessionTokenFunction((api, annotation, token) -> CurrentAccount.get() != null)
+ .onApiExceptionFunction((api, e) -> {
+
+ // When an exception occurs in a node,
+ // the corresponding nodeId is told to the front end to facilitate friendly prompts by the front end.
+ if (e instanceof FlowNodeException) {
+ FlowNodeException flowNodeException = (FlowNodeException) e;
+ JObject info = JObject
+ .create()
+ .put("node_id", flowNodeException.getNode().getNodeId());
+
+ ApiResult response = new ApiResult<>();
+ response.code = flowNodeException.getStatusCode().getCode();
+ response.message = e.getMessage();
+ response.data = info;
+ return response;
+
+ }
+
+ throw e;
+ })
+ .apiPermissionPolicy((api, annotation, params) -> {
+
+ // 鍦ㄧ嚎浣撻獙鐗堜笓鐢 api 鏉冮檺妫鏌
+ OnlineDemoApi onlineDemoApi = api.getClass().getAnnotation(OnlineDemoApi.class);
+ if (onlineDemoApi != null) {
+ Config config = Launcher.CONTEXT.getBean(Config.class);
+ if (!config.isOnlineDemo()) {
+ throw new StatusCodeWithException("The current environment does not allow this API to be called", StatusCode.SYSTEM_ERROR);
+ }
+ }
+
+ if (annotation.rsaVerify()) {
+ rsaVerify(params);
+ }
+ })
+ .launch(BoardService.class, args);
+
+ Launcher
+ .instance()
+ .afterApiExecuteFunction(Launcher.CONTEXT.getBean(OperationLogAfterApiExecute.class));
+ }
+
+
+ @Override
+ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+ Launcher.CONTEXT = applicationContext;
+ }
+
+
+ /**
+ * rsa signature check
+ */
+ private static void rsaVerify(JSONObject params) throws Exception {
+ SignedApiInput signedApiInput = params.toJavaObject(SignedApiInput.class);
+
+ // At present, the board service only serves the application services of its own wefe system,
+ // such as gateway and flow, so the same set of public and private keys are used for rsa signatures.
+ String publicKey = CacheObjects.getRsaPublicKey();
+
+ boolean verified = RSAUtil.verify(
+ signedApiInput.getData().getBytes(StandardCharsets.UTF_8),
+ RSAUtil.getPublicKey(publicKey),
+ signedApiInput.getSign()
+ );
+ if (!verified) {
+ throw new StatusCodeWithException("閿欒鐨勭鍚", StatusCode.PARAMETER_VALUE_INVALID);
+ }
+
+ params.clear();
+
+ JSONObject data = JSONObject.parseObject(signedApiInput.getData());
+
+ params.putAll(data);
+ }
+}
diff --git "a/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/board-service/src/main/java/com/welab/wefe/board/service/api/account/AuditApi.java" "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/board-service/src/main/java/com/welab/wefe/board/service/api/account/AuditApi.java"
new file mode 100644
index 0000000000000000000000000000000000000000..ad1e6b2460e42febd622893f68341809c67ef40b
--- /dev/null
+++ "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/board-service/src/main/java/com/welab/wefe/board/service/api/account/AuditApi.java"
@@ -0,0 +1,101 @@
+/**
+ * Copyright 2021 Tianmian Tech. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.welab.wefe.board.service.api.account;
+
+import com.welab.wefe.board.service.service.account.AccountService;
+import com.welab.wefe.common.StatusCode;
+import com.welab.wefe.common.enums.AuditStatus;
+import com.welab.wefe.common.exception.StatusCodeWithException;
+import com.welab.wefe.common.fieldvalidate.annotation.Check;
+import com.welab.wefe.common.util.StringUtil;
+import com.welab.wefe.common.web.api.base.AbstractNoneOutputApi;
+import com.welab.wefe.common.web.api.base.Api;
+import com.welab.wefe.common.web.dto.AbstractApiInput;
+import com.welab.wefe.common.web.dto.ApiResult;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * @author zane.luo
+ */
+@Api(path = "account/audit", name = "audit the account")
+public class AuditApi extends AbstractNoneOutputApi {
+
+ @Autowired
+ private AccountService accountService;
+
+ @Override
+ protected ApiResult> handler(Input input) throws StatusCodeWithException {
+ accountService.audit(input);
+
+ return success();
+ }
+
+
+ public static class Input extends AbstractApiInput {
+
+ @Check(name = "琚鏍镐汉鐨刬d", require = true)
+ private String accountId;
+
+ @Check(name = "瀹℃牳缁撴灉", require = true)
+ private AuditStatus auditStatus;
+
+ @Check(name = "瀹℃牳鎰忚")
+ private String auditComment;
+
+ @Override
+ public void checkAndStandardize() throws StatusCodeWithException {
+ super.checkAndStandardize();
+ if (auditStatus == AuditStatus.disagree && StringUtil.isEmpty(auditComment)) {
+ throw new StatusCodeWithException("璇疯緭鍏ュ鏍告剰瑙", StatusCode.PARAMETER_VALUE_INVALID);
+ }
+
+ if (auditStatus == AuditStatus.agree && StringUtil.isEmpty(auditComment)) {
+ auditComment = "閫氳繃";
+ }
+ }
+
+ //region getter/setter
+
+ public String getAccountId() {
+ return accountId;
+ }
+
+ public void setAccountId(String accountId) {
+ this.accountId = accountId;
+ }
+
+ public AuditStatus getAuditStatus() {
+ return auditStatus;
+ }
+
+ public void setAuditStatus(AuditStatus auditStatus) {
+ this.auditStatus = auditStatus;
+ }
+
+ public String getAuditComment() {
+ return auditComment;
+ }
+
+ public void setAuditComment(String auditComment) {
+ this.auditComment = auditComment;
+ }
+
+
+ //endregion
+ }
+
+}
diff --git "a/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/board-service/src/main/java/com/welab/wefe/board/service/api/account/CaptchaApi.java" "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/board-service/src/main/java/com/welab/wefe/board/service/api/account/CaptchaApi.java"
new file mode 100644
index 0000000000000000000000000000000000000000..6716450abb668e7bd119f302c65c92b2548482e1
--- /dev/null
+++ "b/BFLP234/FederationStudy/03.\346\272\220\347\240\201\351\225\234\345\203\217/WeFe/board/board-service/src/main/java/com/welab/wefe/board/service/api/account/CaptchaApi.java"
@@ -0,0 +1,71 @@
+/**
+ * Copyright 2021 Tianmian Tech. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.welab.wefe.board.service.api.account;
+
+import com.welab.wefe.common.exception.StatusCodeWithException;
+import com.welab.wefe.common.web.api.base.AbstractNoneInputApi;
+import com.welab.wefe.common.web.api.base.Api;
+import com.welab.wefe.common.web.dto.AbstractApiOutput;
+import com.welab.wefe.common.web.dto.ApiResult;
+import com.welab.wefe.common.web.dto.Captcha;
+import com.welab.wefe.common.web.service.CaptchaService;
+
+/**
+ * @author hunter.zhao
+ */
+@Api(path = "account/captcha", name = "get captcha", login = false)
+public class CaptchaApi extends AbstractNoneInputApi {
+
+ @Override
+ protected ApiResult