From e03365cb8f0f60959b8c007096c05965e61e811b Mon Sep 17 00:00:00 2001 From: Layne Peng Date: Fri, 18 Mar 2022 18:33:48 +0800 Subject: [PATCH] Make Kubefate support Fate v1.5.3 (#560) (#561) * Support v1.5.3 Signed-off-by: Chen Jing --- docker-build/.env | 2 +- docker-deploy/.env | 2 +- docker-deploy/README.md | 3 ++ docker-deploy/generate_config.sh | 4 +++ docker-deploy/parties.conf | 4 +++ .../fateboard/conf/application.properties | 4 ++- fml_manager/Dockerfile | 1 + fml_manager/Makefile | 2 +- .../FATE-Serving/templates/ingress.yaml | 9 +++-- helm-charts/FATE/Chart.yaml | 4 +-- helm-charts/FATE/templates/ingress.yaml | 36 ++++++++++++------- helm-charts/FATE/templates/python-spark.yaml | 2 ++ helm-charts/FATE/values-template-example.yaml | 10 ++++-- helm-charts/FATE/values-template.yaml | 6 ++-- helm-charts/FATE/values.yaml | 4 ++- k8s-deploy/.gitignore | 1 + k8s-deploy/cluster.yaml | 2 +- .../examples/party-10000/cluster-spark.yaml | 2 +- .../examples/party-9999/cluster-spark.yaml | 2 +- k8s-deploy/kubefate.yaml | 9 +++-- 20 files changed, 76 insertions(+), 33 deletions(-) create mode 100644 k8s-deploy/.gitignore diff --git a/docker-build/.env b/docker-build/.env index 01c582edd..45cd18bc0 100644 --- a/docker-build/.env +++ b/docker-build/.env @@ -1,2 +1,2 @@ #PREFIX=federatedai -#IMG_TAG=1.5.1-release +#IMG_TAG=1.5.3-release diff --git a/docker-deploy/.env b/docker-deploy/.env index cf1744d18..b0ed888f7 100644 --- a/docker-deploy/.env +++ b/docker-deploy/.env @@ -1,5 +1,5 @@ RegistryURI= -TAG=1.5.1-release +TAG=1.5.3-release SERVING_TAG=2.0.0-release # PREFIX: namespace on the registry's server. diff --git a/docker-deploy/README.md b/docker-deploy/README.md index 5a95ec747..35052a3fa 100644 --- a/docker-deploy/README.md +++ b/docker-deploy/README.md @@ -59,6 +59,9 @@ computing_backend=eggroll # true if you need python-nn else false, the default value will be false enabled_nn=false + +fateboard_username=admin # Username to access fateboard +fateboard_password=admin # Password to access fateboard ``` Spark was introduced in FATE v1.5 as the underlying computing backend, for more details diff --git a/docker-deploy/generate_config.sh b/docker-deploy/generate_config.sh index 0ff466fb2..c83336d8d 100644 --- a/docker-deploy/generate_config.sh +++ b/docker-deploy/generate_config.sh @@ -62,6 +62,8 @@ GenerateConfig() { eval fateboard_ip=fateboard eval fateboard_port=8080 + eval fateboard_username=${fateboard_username} + eval fateboard_password=${fateboard_password} eval fate_flow_ip=python eval fate_flow_grpc_port=9360 @@ -150,6 +152,8 @@ GenerateConfig() { sed -i "s##${db_user}#g" ./confs-$party_id/confs/fateboard/conf/application.properties sed -i "s##${db_password}#g" ./confs-$party_id/confs/fateboard/conf/application.properties sed -i "s##jdbc:mysql://${db_ip}:3306/${db_name}?characterEncoding=utf8\&characterSetResults=utf8\&autoReconnect=true\&failOverReadOnly=false\&serverTimezone=GMT%2B8#g" ./confs-$party_id/confs/fateboard/conf/application.properties + sed -i "s##${fateboard_username}#g" ./confs-$party_id/confs/fateboard/conf/application.properties + sed -i "s##${fateboard_password}#g" ./confs-$party_id/confs/fateboard/conf/application.properties echo fateboard module of $party_id done! # mysql diff --git a/docker-deploy/parties.conf b/docker-deploy/parties.conf index dd1a3c30a..b5c1ea731 100644 --- a/docker-deploy/parties.conf +++ b/docker-deploy/parties.conf @@ -27,3 +27,7 @@ redis_port=6379 redis_password=fate_dev name_node=hdfs://namenode:9000 + +# Define fateboard login information +fateboard_username=admin +fateboard_password=admin diff --git a/docker-deploy/training_template/public/fateboard/conf/application.properties b/docker-deploy/training_template/public/fateboard/conf/application.properties index 58c9b06a5..f6f435089 100644 --- a/docker-deploy/training_template/public/fateboard/conf/application.properties +++ b/docker-deploy/training_template/public/fateboard/conf/application.properties @@ -15,4 +15,6 @@ spring.datasource.druid.filter.config.enabled=false spring.datasource.druid.web-stat-filter.enabled=false spring.datasource.druid.stat-view-servlet.enabled=false server.compression.enabled=true -server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain \ No newline at end of file +server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain +server.board.login.username= +server.board.login.password= \ No newline at end of file diff --git a/fml_manager/Dockerfile b/fml_manager/Dockerfile index 2607e05f0..cc2868fff 100644 --- a/fml_manager/Dockerfile +++ b/fml_manager/Dockerfile @@ -6,5 +6,6 @@ COPY . /fml_manager RUN pip install notebook fate-client RUN python setup.py sdist bdist_wheel && pip install dist/*.whl RUN mkdir /fml_manager/Examples/Pipeline/logs +Run pip install markupsafe==2.0.1 CMD flow init -c /data/projects/fate/conf/service_conf.yaml && pipeline init -c /data/projects/fate/conf/pipeline_conf.yaml && jupyter notebook --ip=0.0.0.0 --port=20000 --allow-root --debug --NotebookApp.notebook_dir='/fml_manager/Examples' --no-browser --NotebookApp.token='' --NotebookApp.password='' diff --git a/fml_manager/Makefile b/fml_manager/Makefile index d239afdb1..779dc42b7 100644 --- a/fml_manager/Makefile +++ b/fml_manager/Makefile @@ -1,5 +1,5 @@ NAME ?= federatedai/client -VERSION ?= v1.5.0 +VERSION ?= v1.5.3 IMG ?= ${NAME}:${VERSION:v%=%-release} docker-build: diff --git a/helm-charts/FATE-Serving/templates/ingress.yaml b/helm-charts/FATE-Serving/templates/ingress.yaml index 8daca6ab0..0e78f38b8 100644 --- a/helm-charts/FATE-Serving/templates/ingress.yaml +++ b/helm-charts/FATE-Serving/templates/ingress.yaml @@ -10,7 +10,7 @@ # limitations under the License. {{ if .Values.servingProxy.include }} -apiVersion: networking.k8s.io/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: serving-proxy @@ -26,8 +26,11 @@ spec: http: paths: - path: / + pathType: Prefix backend: - serviceName: serving-proxy - servicePort: 8059 + service: + name: serving-proxy + port: + number: 8059 --- {{ end }} \ No newline at end of file diff --git a/helm-charts/FATE/Chart.yaml b/helm-charts/FATE/Chart.yaml index 3dd769247..22a0f40a6 100644 --- a/helm-charts/FATE/Chart.yaml +++ b/helm-charts/FATE/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 -appVersion: v1.5.1 +appVersion: v1.5.3 description: A Helm chart for fate-training name: fate -version: v1.5.1 +version: v1.5.3 home: https://fate.fedai.org icon: https://aisp-1251170195.cos.ap-hongkong.myqcloud.com/wp-content/uploads/sites/12/2019/09/logo.png sources: diff --git a/helm-charts/FATE/templates/ingress.yaml b/helm-charts/FATE/templates/ingress.yaml index 30d714067..535f641cc 100644 --- a/helm-charts/FATE/templates/ingress.yaml +++ b/helm-charts/FATE/templates/ingress.yaml @@ -11,7 +11,7 @@ {{ if .Values.istio.enabled }} {{ else }} {{ if .Values.modules.fateboard.include }} -apiVersion: networking.k8s.io/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: fateboard @@ -24,14 +24,17 @@ spec: http: paths: - path: / + pathType: Prefix backend: - serviceName: fateboard - servicePort: 8080 + service: + name: fateboard + port: + number: 8080 --- {{ end }} {{ if .Values.modules.client.include }} -apiVersion: networking.k8s.io/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: client @@ -44,14 +47,17 @@ spec: http: paths: - path: / + pathType: Prefix backend: - serviceName: notebook - servicePort: 20000 + service: + name: notebook + port: + number: 20000 --- {{ end }} {{ if .Values.modules.spark.include }} -apiVersion: networking.k8s.io/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: spark @@ -64,14 +70,17 @@ spec: http: paths: - path: / + pathType: Prefix backend: - serviceName: spark-master - servicePort: 8080 + service: + name: spark-master + port: + number: 8080 --- {{ end }} {{ if .Values.modules.rabbitmq.include }} -apiVersion: networking.k8s.io/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: rabbitmq @@ -84,9 +93,12 @@ spec: http: paths: - path: / + pathType: Prefix backend: - serviceName: rabbitmq - servicePort: 15672 + service: + name: rabbitmq + port: + number: 15672 --- {{ end }} {{ end }} \ No newline at end of file diff --git a/helm-charts/FATE/templates/python-spark.yaml b/helm-charts/FATE/templates/python-spark.yaml index a9114c3db..5d0f9442a 100644 --- a/helm-charts/FATE/templates/python-spark.yaml +++ b/helm-charts/FATE/templates/python-spark.yaml @@ -149,6 +149,8 @@ data: spring.datasource.druid.stat-view-servlet.enabled=false server.compression.enabled=true server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain + server.board.login.username={{ .Values.modules.fateboard.username }} + server.board.login.password={{ .Values.modules.fateboard.password }} --- apiVersion: apps/v1 kind: Deployment diff --git a/helm-charts/FATE/values-template-example.yaml b/helm-charts/FATE/values-template-example.yaml index a9733cd34..fe67066d5 100644 --- a/helm-charts/FATE/values-template-example.yaml +++ b/helm-charts/FATE/values-template-example.yaml @@ -1,7 +1,7 @@ name: fate-9999 namespace: fate-9999 chartName: fate -chartVersion: v1.5.1 +chartVersion: v1.5.3 partyId: 9999 registry: "" imageTag: "" @@ -123,7 +123,7 @@ backend: eggroll # spark: # master: # Image: "federatedai/spark-master" - # ImageTag: "1.5.0-release" + # ImageTag: "1.5.3-release" # replicas: 1 # cpu: "100m" # memory: "512Mi" @@ -131,7 +131,7 @@ backend: eggroll # type: ClusterIP # worker: # Image: "federatedai/spark-worker" - # ImageTag: "1.5.0-release" + # ImageTag: "1.5.3-release" # replicas: 2 # cpu: "1000m" # memory: "512Mi" @@ -159,6 +159,10 @@ backend: eggroll # - host: 192.168.0.1 # http_port: 30107 # grpc_port: 30102 +# fateboard: + # type: ClusterIP + # username: admin + # password: admin # rabbitmq: # nodeSelector: # type: ClusterIP diff --git a/helm-charts/FATE/values-template.yaml b/helm-charts/FATE/values-template.yaml index 5539b8deb..d2b6f1816 100644 --- a/helm-charts/FATE/values-template.yaml +++ b/helm-charts/FATE/values-template.yaml @@ -2,7 +2,7 @@ image: registry: {{ .registry | default "federatedai" }} isThridParty: {{ empty .registry | ternary "false" "true" }} - tag: {{ .imageTag | default "1.5.1-release" }} + tag: {{ .imageTag | default "1.5.3-release" }} pullPolicy: {{ .pullPolicy | default "IfNotPresent" }} {{- with .imagePullSecrets }} imagePullSecrets: @@ -211,8 +211,10 @@ modules: fateboard: include: {{ has "fateboard" .modules }} - {{- with .spark }} + {{- with .fateboard }} type: {{ .type }} + username: {{ .username }} + password: {{ .password }} {{- end }} diff --git a/helm-charts/FATE/values.yaml b/helm-charts/FATE/values.yaml index 68fcbf6d0..f15661914 100644 --- a/helm-charts/FATE/values.yaml +++ b/helm-charts/FATE/values.yaml @@ -2,7 +2,7 @@ image: registry: federatedai isThridParty: - tag: 1.5.1-release + tag: 1.5.3-release pullPolicy: IfNotPresent imagePullSecrets: # - name: @@ -129,6 +129,8 @@ modules: fateboard: include: true type: ClusterIP + username: admin + password: admin spark: include: true master: diff --git a/k8s-deploy/.gitignore b/k8s-deploy/.gitignore new file mode 100644 index 000000000..5657f6ea7 --- /dev/null +++ b/k8s-deploy/.gitignore @@ -0,0 +1 @@ +vendor \ No newline at end of file diff --git a/k8s-deploy/cluster.yaml b/k8s-deploy/cluster.yaml index 57239eb50..7d6cf4a0b 100644 --- a/k8s-deploy/cluster.yaml +++ b/k8s-deploy/cluster.yaml @@ -1,7 +1,7 @@ name: fate-9999 namespace: fate-9999 chartName: fate -chartVersion: v1.5.1 +chartVersion: v1.5.3 partyId: 9999 registry: "" imageTag: "" diff --git a/k8s-deploy/examples/party-10000/cluster-spark.yaml b/k8s-deploy/examples/party-10000/cluster-spark.yaml index f1d2962f6..85b2c4d9f 100644 --- a/k8s-deploy/examples/party-10000/cluster-spark.yaml +++ b/k8s-deploy/examples/party-10000/cluster-spark.yaml @@ -1,7 +1,7 @@ name: fate-10000 namespace: fate-10000 chartName: fate -chartVersion: v1.5.1 +chartVersion: v1.5.3 partyId: 10000 registry: "" imageTag: "" diff --git a/k8s-deploy/examples/party-9999/cluster-spark.yaml b/k8s-deploy/examples/party-9999/cluster-spark.yaml index 4325668e1..125c0090b 100644 --- a/k8s-deploy/examples/party-9999/cluster-spark.yaml +++ b/k8s-deploy/examples/party-9999/cluster-spark.yaml @@ -1,7 +1,7 @@ name: fate-9999 namespace: fate-9999 chartName: fate -chartVersion: v1.5.1 +chartVersion: v1.5.3 partyId: 9999 registry: "" imageTag: "" diff --git a/k8s-deploy/kubefate.yaml b/k8s-deploy/kubefate.yaml index 5d49e73a7..5fe2ef242 100644 --- a/k8s-deploy/kubefate.yaml +++ b/k8s-deploy/kubefate.yaml @@ -151,7 +151,7 @@ spec: selector: fate: kubefate --- -apiVersion: networking.k8s.io/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: kubefate @@ -162,6 +162,9 @@ spec: http: paths: - path: / + pathType: Prefix backend: - serviceName: kubefate - servicePort: 8080 + service: + name: kubefate + port: + number: 8080