This page gives instructions on how to build and install Secure XGBoost from scratch. Secure XGBoost has been tested only on Ubuntu 18.04, but it should also work with Ubuntu 16.04. It consists of three steps:
Note
Use of Git submodules
XGBoost uses Git submodules to manage dependencies. So when you clone the repo, remember to specify --recursive option:
git clone -b hackathon --recursive https://github.com/mc2-project/mc2-xgboost.git
Please refer to the Troubleshooting section first if you have any problem during installation. If the instructions do not work for you, please feel free to open an issue on GitHub.
Contents
The requirements are:
Follow the instructions here to install the Intel SGX DCAP driver, and the Open Enclave packages and dependencies.
Alternatively, you may also acquire a VM with the required features pre-installed from Azure Confidential Compute; in this case, however, you may need to manually upgrade the SDK installed in the VM to version 0.8.1, and the DCAP driver to version 1.21:
Confirm that Open Enclave is version 0.8.1:
sudo apt list open-enclave
Confirm that the Intel SGX DCAP Driver is version 1.21:
modinfo intel_sgx
If not, follow these instructions to update.
Configure environment variables for Open Enclave SDK for Linux:
source /opt/openenclave/share/openenclave/openenclaverc
Consider adding this line to your ~/.bashrc to make the environment variables persist across sessions.
sudo apt-get install -y libmbedtls-dev python3-pip
pip3 install numpy pandas sklearn numproto grpcio grpcio-tools kubernetes
Install cmake >= v3.11. E.g., the following commands install cmake v3.15.6.
wget https://github.com/Kitware/CMake/releases/download/v3.15.6/cmake-3.15.6-Linux-x86_64.sh
sudo bash cmake-3.15.6-Linux-x86_64.sh --skip-license --prefix=/usr/local
Our goal is to build the shared library, along with the enclave:
libxgboost.soxgboost_enclave.signedThe minimal building requirement is
Clone the repository recursively, and check out the required branch:
git clone -b hackathon --recursive https://github.com/mc2-project/mc2-xgboost.git
Configure the enclave parameters in the file enclave/xgboost.conf, including the amount of virtual memory available to the enclave.
More details on these parameters can be found here.
On Ubuntu, build the Secure XGBoost targets by running CMake:
cd mc2-xgboost
mkdir -p build
pushd build
cmake ..
make -j4
popd
The Python package is located at python-package/.
cd python-package; sudo python3 setup.py install
Note
Re-compiling Secure XGBoost
If you recompiled Secure XGBoost, then you need to reinstall it again to make the new library take effect.
PYTHONPATH to tell Python where to find
the RPC library. For example, assume we cloned secure-xgboost on the home directory
~. then we can added the following line in ~/.bashrc.export PYTHONPATH=/path/to/mc2-xgboost/rpc
Compile failed after git pull
Please first update the submodules, clean all and recompile:
git submodule update && make clean_all && make -j4
Makefile: dmlc-core/make/dmlc.mk: No such file or directory
We need to recursively clone the submodule:
git submodule init
git submodule update
Alternatively, do another clone
git clone -b hackathon --recursive https://github.com/mc2-project/mc2-xgboost.git