Skip to content

Latest commit

 

History

History
85 lines (72 loc) · 3.16 KB

Release_EN.md

File metadata and controls

85 lines (72 loc) · 3.16 KB

Install Fidelius

Dependency

  • Make sure you have the following operating system:

    • Ubuntu 20.04 LTS Server 64bits
  • Ensure that SGX is enabled in BIOS and CPU. Follow the README in SGX-hardware or use the following method to confirm directly.

 $ git clone https://github.com/ayeks/SGX-hardware.git
 $ cd SGX-hardware
 $ gcc test-sgx.c -o test-sgx
 $ ./test-sgx

If the following is included, then the hardware configuration for Intel SGX is compliant.

...
sgx available: 1
sgx launch control: 1

...
sgx 1 supported: 1
sgx 2 supported: 0
...

If the "sgx available" field is 0, it means that the CPU itself does not support Intel SGX; if the "sgx 1 supported" field is 0, it indicates that the BIOS does not support or has not enabled the Intel SGX feature. To be able to execute programs that use Intel SGX, you also need to correctly install the Intel SGX SDK in the next step.

  • Compile and install the Intel(R) SGX driver, SDK, and PSW according to the instructions in the README document of the linux-sgx project. Note: It is not possible to install the PSW if the hardware environment does not support SGX.

  • Install dependencies (protobuf,glog,boost,cppconn and etc):

$ sudo apt install build-essential ocaml ocamlbuild automake autoconf libtool wget python libssl-dev git cmake perl
$ sudo apt install libssl-dev libcurl4-openssl-dev protobuf-compiler libprotobuf-dev debhelper cmake reprepro unzip
$ sudo apt install mysql-server libgoogle-glog-dev libboost-all-dev libmysqlcppconn-dev

Install Fidelius

  • Download the public key of YeeZTech's APT repository:
$ wget -O yeez-pkey.pem https://repo.yeez.tech/public-key-yeez.txt
  • Add the downloaded repository public key to the system:
$ sudo apt-key add yeez-pkey.pem
  • Add the APT repository to the system software sources:
$ echo -e "deb https://repo.yeez.tech/ release main" | sudo tee -a /etc/apt/sources.list
  • Update the system software sources and install the Fidelius component:
$ sudo apt update
$ sudo apt install ypc fflib

Run Fidelius

Example (Use the Iris dataset as the data source to run the K-Means algorithm)

The K-Means clustering based on the Iris dataset is a very classic learning example in machine learning.

  • Download example code:
$ git clone --depth 1 --branch v0.5.1 https://github.com/YeeZTech/YPC-algo-example.git
  • Compile example code:
$ cd YPC-algo-example && mkdir -p build && cd build
$ cmake -DCMAKE_PREFIX_PATH=$YPC_INSTALL_DIR/lib/cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
$ make -j8

Note:$YPC_INSTALL_DIR is the installation path, which by default is /opt/ypc.

  • Run example code:
$ cd YPC-algo-example/integrate && python3 test_iris.py
  • Getting the following results indicates that the sample code has run successfully:
$ result is :  ['0 -  (5.004082 ,3.416327 ,1.465306 ,0.244898) \n', '1 -  (5.883607 ,2.740984 ,4.388525 ,1.434426) \n', '2 -  (6.864864 ,3.067567 ,5.735135 ,2.059460) \n']