Skip to content

Source Code Deployment FATE Standalone

1. Description

Server configuration.

number 1
Configuration 8 core / 16G memory / 500G hard disk
OS Version: CentOS Linux release 7
User User: app owner:apps

2. Pre-deployment environment check

Whether local ports 8080, 9360, 9380 are occupied

netstat -apln|grep 8080
netstat -apln|grep 9360
netstat -apln|grep 9380

3. Get the source code

Please git clone this repository and all submodules, then set the environment variables required for deployment.

Note that the environment variables set in the following way are only valid for the current terminal session, if you open a new terminal session, such as a new login or a new window, please set them again.

cd {The directory where the above code is stored}
export version=`grep "FATE=" ${FATE_PROJECT_BASE}/fate.env | awk -F "=" '{print $2}'`

4. Install and configure the Python environment

4.1 Installing the Python environment (optional)

Please install or use existing Python version 3.8

4.2 Configuring a virtual environment for FATE

cd(or create) {root directory for the virtual environment}
python3 -m venv {虚拟环境名称}
export FATE_VENV_BASE={root directory for the virtual environment}/{name of virtual environment}
source ${FATE_VENV_BASE}/bin/activate

4.3 Installing Python dependencies for FATE

bash bin/
source ${FATE_VENV_BASE}/bin/activate
pip install -r python/requirements.txt

In case of problems, you can first refer to Possible problems

5. Configuring FATE

Edit the bin/ environment variable file

sed -i.bak "s#PYTHONPATH=.*#PYTHONPATH=$PWD/python:$PWD/fateflow/python#g" bin/
sed -i.bak "s#venv=.*#venv=${FATE_VENV_BASE}#g" bin/

Check if the conf/service_conf.yaml global configuration file has the base engine configured as standalone, if default_engines shows the following, then it is standalone

  computing: standalone
  federation: standalone
  storage: standalone

6. start fate flow server

source bin/

cd fateflow
bash bin/ status
bash bin/ start

If it shows something like this, it is started successfully, otherwise please check the logs according to the prompt

service start sucessfully. pid: 111907
status:app 111907 75.7 1.1 3740008 373448 pts/2 Sl+ 12:21 0:17 python /xx/FATE/fateflow/python/fate_flow/
python 111907 app 14u IPv4 3570158828 0t0 TCP localhost:boxp (LISTEN)
python 111907 app 13u IPv4 3570158827 0t0 TCP localhost:9360 (LISTEN)

7. install fate client

source bin/

cd python/fate_client/
python install

Initialize `fate flow client''

cd ../../
flow init -c conf/service_conf.yaml

If it looks like this, the initialization is successful, otherwise, please check the logs according to the prompt

    "retcode": 0,
    "retmsg": "Fate Flow CLI has been initialized successfully."

8. Test items

8.1 Toy test

flow test toy -gid 10000 -hid 10000

If successful, the screen displays a statement similar to the following:

success to calculate secure_sum, it is 2000.0

8.2 Unit tests

bash python/federatedml/test/

If successful, the screen displays a statement similar to the following:

there are 0 failed test

Some use case algorithms are in examples folder, please try to use them. Please refer to here for a quick start tutorial.

You can also experience the algorithm process kanban through your browser, please refer here

9. Compile package to install fateboard (optional)

Visualizing FATE Jobs with fateboard

9.1 Configuring Java environment

mkdir ${FATE_PROJECT_BASE}/env

tar xzf jdk-8u192.tar.gz

tar xzf apache-maven-3.8.6-bin.tar.gz

Configure environment variables

export JAVA_HOME=${FATE_PROJECT_BASE}/env/jdk-8u192

sed -i.bak "s#JAVA_HOME=.*#JAVA_HOME=${JAVA_HOME}#g" bin/

9.2 Build fateboard

cd ${FATE_PROJECT_BASE}/fateboard
${FATE_PROJECT_BASE}/env/apache-maven-3.8.6/bin/mvn -DskipTests clean package

9.3 Starting fateboard

cd fateboard
bash status
bash start

If you see something like the following, you have started successfully, otherwise please check the logs as prompted

service start sucessfully. pid: 116985
        app 116985 333 1.7 5087004 581460 pts/2 Sl+ 14:11 0:06 /xx/FATE/env/jdk/jdk-8u192//bin/java -Dspring.config.location=/xx/FATE/fateboard/conf/ -Dssh_config_file=/xx/FATE/fateboard/ssh/ -Xmx2048m -Xms2048m -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc: gc.log -XX:+HeapDumpOnOutOfMemoryError -jar /xx/FATE/fateboard

Open http://${ip}:8080, ip is or real ip of this machine

10. Problems that may be encountered

  • If you get an error like "Too many open files", it may be because the number of OS handles is too low.
  • For MacOS, you can try here
  • For Linux, you can try here

  • If the installation of the python dependency package gmpy2 fails under MacOS, try installing the following base library before installing the dependency package

brew install gmp mpfr libmpc

Last update: 2023-06-14