Skip to content

Commit

Permalink
Merge pull request #45 from qjing666/master
Browse files Browse the repository at this point in the history
add k8s deployment
  • Loading branch information
guru4elephant authored Mar 6, 2020
2 parents 97333c4 + 19ed985 commit 656b3f7
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ In PaddleFL, components for defining a federated learning task and training a fe

Please reference [Quick Start](https://paddlefl.readthedocs.io/en/latest/instruction.html) for installation and quick-start example.

## Easy deployment with kubernetes
```sh

kubectl apply -f ./paddle_fl/examples/k8s_deployment/master.yaml

```
Please refer [K8S deployment example](./paddle_fl/examples/k8s_deployment/README.md) for details
## Benchmark task

Gru4Rec [9] introduces recurrent neural network model in session-based recommendation. PaddlePaddle's Gru4Rec implementation is in https://github.com/PaddlePaddle/models/tree/develop/PaddleRec/gru4rec. An example is given in [Gru4Rec in Federated Learning](https://paddlefl.readthedocs.io/en/latest/examples/gru4rec_examples.html)
Expand Down
8 changes: 8 additions & 0 deletions README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ PaddleFL是一个基于PaddlePaddle的开源联邦学习框架。研究人员可

请参考[快速开始](https://paddlefl.readthedocs.io/en/latest/instruction.html)

## Kubernetes简单部署

```sh

kubectl apply -f ./paddle_fl/examples/k8s_deployment/master.yaml

```
请参考[K8S 部署实例](./paddle_fl/examples/k8s_deployment/README.md)
## 性能测试

Gru4Rec [9] 在基于会话的推荐中引入了递归神经网络模型。PaddlePaddle的GRU4RC实现代码在 https://github.com/PaddlePaddle/models/tree/develop/PaddleRec/gru4rec. 一个基于联邦学习训练Gru4Rec模型的示例请参考[Gru4Rec in Federated Learning](https://paddlefl.readthedocs.io/en/latest/examples/gru4rec_examples.html)
Expand Down
50 changes: 50 additions & 0 deletions paddle_fl/examples/k8s_deployment/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# PaddleFL deployment example with Kubernetes

## compile time

#### Master

```sh

#Define distributed training config for trainer and server
python fl_master.py --trainer_num 2
tar -zcvf fl_job_config.tar.gz fl_job_config

#Start HTTP server and wait download request from trainer and server
python -m SimpleHTTPServer 8000

```

## Run time

#### Scheduler
```sh

#Start a Scheduler
python fl_scheduler.py --trainer_num 2

```

#### Server
```sh

#Download job config file from master
wget ${FL_MASTER_SERVICE_HOST}:${FL_MASTER_SERVICE_PORT_FL_MASTER}/fl_job_config.tar.gz
tar -xf fl_job_config.tar.gz

#Start a Server
python -u fl_server.py > server.log 2>&1

```

###Trainer
```sh

#Download job config file from master
wget ${FL_MASTER_SERVICE_HOST}:${FL_MASTER_SERVICE_PORT_FL_MASTER}/fl_job_config.tar.gz
tar -xf fl_job_config.tar.gz

#Start the ith trainer
python -u fl_trainer.py i

```

0 comments on commit 656b3f7

Please sign in to comment.