Coder Social home page Coder Social logo

mc2-project / secure-xgboost Goto Github PK

View Code? Open in Web Editor NEW
104.0 10.0 32.0 18.18 MB

Secure collaborative training and inference for XGBoost.

Home Page: https://mc2-project.github.io/secure-xgboost/

License: Apache License 2.0

CMake 1.26% C++ 50.27% C 31.18% Cuda 8.12% Shell 0.08% Python 8.34% Batchfile 0.01% Java 0.76%
machine-learning collaborative-learning security privacy enclave xgboost data-science

secure-xgboost's People

Contributors

andrewlawhh avatar chester-leung avatar nicersmeng avatar octaviansima avatar podcastinator avatar ryanleh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

secure-xgboost's Issues

How solve the coredump when call encrypt_file function?

Hello,

I run the demo code as below:
ype "help", "copyright", "credits" or "license" for more information.

>>> import securexgboost as xgb
>>> 
>>> KEY_FILE = "key.txt"
>>> xgb.generate_client_key(KEY_FILE)
>>> xgb.encrypt_file("demo/data/agaricus.txt.train", "demo/data/train.enc", KEY_FILE)
Segmentation fault (core dumped)

And I visit the core info as below:

ubuntu@VM-0-13-ubuntu:~/secure-xgboost$ gdb build/libxgboost.so core
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from build/libxgboost.so...
[New LWP 1591885]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `python'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fbf21dbf725 in _Unwind_DeleteException () from /lib/x86_64-linux-gnu/libgcc_s.so.1

I use gcc 9.4.0 and python 3.8.10 in ubuntu20.04, how solve the issue?

Some questions about the use of enclave

Hi, everyone!
I have a question about the operations inside the enclave.

As far as I know, OpenEnclave currently does not support fstream inside the enclave. So how should we load the file content inside the enclave? (C/C++). And for other functions which are not supported in OpenEnclave? Are there some Docs to introduce these codes?

BTW, are there any Docs to introduce the use of Oblivious Primitives such as oassign(), osort() in secure-XGBoost?

Thank you in advance!

Add RPC call for `get_fscore()`

#25 adds support for get_fscore() that is used for feature importance. In the outsourced computation model, we'll need to add an RPC call so that the client can make a call to the server for feature importance, and retrieve the return value of get_fscore() over RPC.

CSV file loading error

There seems to be a problem loading CSV files after we added multiclient support. I used the Allstate Insurance Prediction Claim dataset to run experiments, which gave me an error.

Support for secure join of data and train/test targets

Hello,

the SMPC demo shows two clients joining to train a model, where both clients have identical train set format. Roughly speaking, client1 has one half of training set lines, and client2 has another half.
What about a scenario where client1 has data, and client2 has targets, and they would like to train a model? We assume that both data sets have a common id column to join data and targets securely, before proceeding to the training.

From inspecting the code I made a conclusion that this scenario is not supported, am I correct?
Do you plan to add this routine (secure join) anytime soon?
If you do not have in plans implementing it, is it hard to add this routine myself / outside of this project - if so, could you please give a couple of hints how you yourself would proceed to implementing it?

P.S. Do not want to start a holywar, but the scenario with joining data and targets seems to be much more common and rewarding, compared to the scenario where two parties already have both data and targets each, but simply want to improve the quality by increasing the train set size.

OpenMP / Multithreading support

The enclave code is currently single-threaded (data loading, training, inference, etc.) because the Open Enclave SDK does not support thread handling primitives at present.
We should consider adding multithreading support via the ecall / ocall interface to improve performance.

Can this work be federated?

I read your another work "federated xgboost", which stated that it does not support differential privacy. If I implement this work in a distributed system, can it be considered federated?

multiclient secure-xgboost tutorial example yields error

When running the multiclient example locally (in different terminals) I'm receiving the following errors:

Server

ryan@ryan-dev-vm:~/secure-xgboost/demo/python/multiclient-cluster-remote-control/server$ python3 enclave_serve.py
Waiting for client...
Rabit Module currently only work with dmlc worker, quit this program by exit 0
2021-04-08T05:19:29+0000.002183Z [(H)ERROR] tid(0x7f7a0effd700) | :OE_ENCLAVE_ABORTING [/source/host/calls.c:_call_enclave_function_impl:56]
2021-04-08T05:19:29+0000.002239Z [(H)ERROR] tid(0x7f7a0e7fc700) | :OE_ENCLAVE_ABORTING [/source/host/calls.c:_call_enclave_function_impl:56]
2021-04-08T05:19:29+0000.004897Z [(H)ERROR] tid(0x7f7a0effd700) | :OE_ENCLAVE_ABORTING [/source/host/calls.c:_call_enclave_function_impl:56]
Ecall failed: result=19 (OE_ENCLAVE_ABORTING)
Error type: <class 'securexgboost.core.XGBoostError'>
Error value:
  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/remote_server.py", line 458, in rpc_get_remote_report_with_pubkey_and_nonce
    pem_key, key_size, nonce, nonce_size, client_list, client_list_size, remote_report, remote_report_size = self._serialize(remote_api.get_remote_report_with_pubkey_and_nonce, request)
  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/remote_server.py", line 451, in _serialize
    ret = func(params)
  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 2801, in get_remote_report_with_pubkey_and_nonce
    ctypes.byref(remote_report_size)))
  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 203, in _check_call
    raise XGBoostError(py_str(_LIB.XGBGetLastError()))

Orchestrator

ryan@ryan-dev-vm:~/secure-xgboost/demo/python/multiclient-cluster-remote-control/orchestrator$ python3 start_orchestrator.py
Waiting for client...
Hello from the orchestrator!

Client 1

ryan@ryan-dev-vm:~/secure-xgboost/demo/python/multiclient-cluster-remote-control/client1$ ./run.sh 127.0.0.1
Remote attestation

Client 2

ryan@ryan-dev-vm:~/secure-xgboost/demo/python/multiclient-cluster-remote-control/cliryan@ryan-dev-vm:~/secure-xgboost/demo/python/multiclient-cluster-remote-control/client2$ ./run.sh 127.0.0.1
Remote attestation
Traceback (most recent call last):
    File "client2.py", line 77, in <module>
        run(channel_addr, str(args.symmkey), str(args.privkey), str(args.cert))
    File "client2.py", line 22, in run
        xgb.attest()
    File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 2641, in attest
        response = _check_remote_call(stub.rpc_get_remote_report_with_pubkey_and_nonce(remote_pb2.Status(status=1)))
    File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 187, in _check_remote_call
        raise XGBoostError(ret.status.exception)

Documentation improvements

Starting this thread to track and collect various documentation improvements.

  • Document initialization APIs for client and enclave, and explain the various client / enclave keys
  • Add config file description for init_client API; add it to the demos as well
  • Consensus v. non-consensus mode, and which APIs require consensus
  • Clarify that obliviousness only supported for hist training at present
  • Text input format; e.g. https://xgboost.readthedocs.io/en/latest/tutorials/input_format.html

How the XgBoost models are aggregated?

Hi,

currently I am mostly interested in models aggregation part of Federated Learning. However, I cannot understand how it is done now. I guess it is used with rabit but cannot find in the code any allreduce function or something and how the global model is upadted. As of now I have a feeling it works likes this:

  1. XgBoost model 1 is trained on local data 1
  2. XgBoost model 1 is input to model XgBoost model 2 which is trained on local data 2
  3. Ends when all local data and temporary XgBoost models are used

It resembles online learning scheme.

Could you help me understand how the aggregation of XgBoost models works here?

Enceyption algorithm

Hello,
What is the encryption algorithm that this project use ti encrypt the file?
I could not find it,
is it possible to use pailliar encrypthon?

ImportError: cannot import name 'remote_pb2' from 'securexgboost.rpc'

I am getting the following error importing securexgboost:

secureml@fml-30294-westus2-sxgb-poc-sgxvm:~$ python3
Python 3.7.5 (default, Nov  7 2019, 10:50:52) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import securexgboost as xgb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/securexgboost-0.1-py3.7.egg/securexgboost/__init__.py", line 11, in <module>
    from .core import DMatrix, Booster
  File "/usr/local/lib/python3.7/dist-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 21, in <module>
    from .rpc import remote_pb2
ImportError: cannot import name 'remote_pb2' from 'securexgboost.rpc' (/usr/local/lib/python3.7/dist-packages/securexgboost-0.1-py3.7.egg/securexgboost/rpc/__init__.py)
>>> 

The installation of Secure XG Boost appeared to be successful:

secureml@fml-30294-westus2-sxgb-poc-sgxvm:~$ pip3 list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
asn1crypto (0.24.0)
attrs (17.4.0)
Automat (0.6.0)
blinker (1.4)
certifi (2018.1.18)
chardet (3.0.4)
click (6.7)
cloud-init (20.4)
colorama (0.3.7)
command-not-found (0.3)
configobj (5.0.6)
constantly (15.1.0)
cryptography (2.1.4)
Cython (0.29.21)
distro-info (0.18ubuntu0.18.04.1)
grpcio (1.35.0)
grpcio-tools (1.35.0)
httplib2 (0.9.2)
hyperlink (17.3.1)
idna (2.6)
incremental (16.10.1)
Jinja2 (2.10)
joblib (1.0.0)
jsonpatch (1.16)
jsonpointer (1.10)
jsonschema (2.6.0)
keyring (10.6.0)
keyrings.alt (3.0)
language-selector (0.1)
MarkupSafe (1.0)
netifaces (0.10.4)
numproto (0.3.0)
numpy (1.19.5)
oauthlib (2.0.6)
PAM (0.4.2)
pandas (1.2.1)
pip (9.0.1)
protobuf (3.14.0)
pyasn1 (0.4.2)
pyasn1-modules (0.2.1)
pycrypto (2.6.1)
pygobject (3.26.1)
PyJWT (1.5.3)
pyOpenSSL (17.5.0)
pyserial (3.4)
python-apt (1.6.5+ubuntu0.5)
python-dateutil (2.8.1)
python-debian (0.1.32)
pytz (2020.5)
pyxdg (0.25)
PyYAML (3.12)
requests (2.18.4)
requests-unixsocket (0.1.5)
scikit-learn (0.24.1)
scipy (1.6.0)
SecretStorage (2.3.1)
securexgboost (0.1)
service-identity (16.0.0)
setuptools (51.3.3)
six (1.15.0)
sklearn (0.0)
ssh-import-id (5.7)
systemd-python (234)
threadpoolctl (2.1.0)
Twisted (17.9.0)
ufw (0.36)
unattended-upgrades (0.1)
urllib3 (1.22)
WALinuxAgent (2.2.45)
wheel (0.30.0)
zope.interface (4.3.2)

`sudo python3 setup.py install` yields an incomplete installation

After following the documentation for installation on Ubuntu 18.04, I'm receiving the following error:

Python 3.7.9 (default, Apr  7 2021, 16:27:17)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import securexgboost
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/__init__.py", line 11, in <module>
    from .core import DMatrix, Booster
  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 21, in <module>
    from .rpc import remote_pb2
ImportError: cannot import name 'remote_pb2' from 'securexgboost.rpc' (/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/rpc/__init__.py)

Upon closer inspection, I noticed that the contents of /secure-xgboost/python-package/securexgboost/rpc and /usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/rpc differ:

ryan@ryan-dev-vm:~/secure-xgboost/python-package/securexgboost/rpc$ ls
README.md  __init__.py  ndarray_pb2.py  ndarray_pb2_grpc.py  protos  remote_pb2.py  remote_pb2_grpc.py  rpc_utils.py

vs.

ryan@ryan-dev-vm:/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/rpc$ ls
README.md  __init__.py  __pycache__  protos  rpc_utils.py

Copying the missing files fixes the issue, but also running sudo python3 setup.py install a second time (??) correctly copies the files.

Add support for Open Enclave 0.10.0

Open Enclave 0.10.0 deprecates the oehostapp CMake target in favor of oehost. However, simply changing our CMake targets from oehostapp to oehost causes compilation errors:

CMakeFiles/xgboost_enclave.dir/rabit/src/ssl_socket.cc.o: In function `rabit::utils::SSLTcpSocket::ConfigureClientSSL()':
ssl_socket.cc:(.text._ZN5rabit5utils12SSLTcpSocket18ConfigureClientSSLEv+0xbd): undefined reference to `mbedtls_debug_set_threshold'
CMakeFiles/xgboost_enclave.dir/rabit/src/ssl_socket.cc.o: In function `rabit::utils::SSLTcpSocket::ConfigureServerSSL()':
ssl_socket.cc:(.text._ZN5rabit5utils12SSLTcpSocket18ConfigureServerSSLEv+0x147): undefined reference to `mbedtls_debug_set_threshold'
/opt/openenclave/lib/openenclave/enclave/liboecore.a(cpuid.c.o): In function `oe_initialize_cpuid':
/source/enclave/core/sgx/cpuid.c:29: undefined reference to `oe_sgx_get_cpuid_table_ocall'
collect2: error: ld returned 1 exit status
enclave/CMakeFiles/xgboost_enclave.dir/build.make:960: recipe for target 'enclave/xgboost_enclave' failed
make[2]: *** [enclave/xgboost_enclave] Error 1
CMakeFiles/Makefile2:349: recipe for target 'enclave/CMakeFiles/xgboost_enclave.dir/all' failed
make[1]: *** [enclave/CMakeFiles/xgboost_enclave.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Enable `load_model()` from result of `save_raw()`

In vanilla XGBoost, the user can call load_model() on the output of save_raw() , which is an in-memory buffer – a serialized model.

In Secure XGBoost, we don’t yet support this functionality when we have a remote client. We need to add support for this by transferring the buffer returned from save_raw() over gRPC to the server, where the buffer (instead of a filename string) can be passed to load_model(). To do so, we'll have to modify the gRPC request message for load_model() to optionally contain the serialized buffer (as well as optionally contain a path to a saved model), and pass this serialized buffer to the server side call for load_model().

make -j4 fails while Build Secure XGBoost

Hi,
I'm trying to Build Secure XGBoost following https://github.com/mc2-project/secure-xgboost and build fails in Step 6 when I run make -j4. Please find the output log file attached:
build.log

My machine is Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz based on Kaby Lake CPU which supports SGX without FLC. I already built Open Enclave SDK and installed Out-of-Tree driver sgx_linux_x64_driver_2.11.0_2d2b795.bin from https://download.01.org/intel-sgx/sgx-linux/2.15/distro/ubuntu18.04-server since I cannot use DCAP driver

Has anyone faced this issue or knows how to solve it? Any help is appreciated.
Thanks

failed to execute demo in sgx hw mode

~/secure-xgboost/demo/python/basic$ python3 secure-xgboost-demo.py
Init user and enclave parameters
Remote attestation
2020-10-27T05:33:37.000000Z [(H)ERROR] tid(0x7f897ef07740) | quote3_error_t=0xe044
(oe_result_t=OE_PLATFORM_ERROR) [/source/host/sgx/sgxquote.c:oe_sgx_qe_get_target_info:21]
2020-10-27T05:33:37.000000Z [(H)ERROR] tid(0x7f897ef07740) | :OE_PLATFORM_ERROR [/source/host/sgx/quote.c:sgx_get_qetarget_info:31]
2020-10-27T05:33:37.000000Z [(H)ERROR] tid(0x7f897ef07740) | :OE_ENCLAVE_ABORTING [/source/host/calls.c:oe_call_enclave_function_by_table_id:91]
Ecall failed: result=19 (OE_ENCLAVE_ABORTING)
Traceback (most recent call last):
File "secure-xgboost-demo.py", line 17, in
xgb.attest(False)
File "/usr/local/lib/python3.6/dist-packages/securexgboost-0.1-py3.6.egg/securexgboost/core.py", line 2652, in attest
ctypes.byref(remote_report), ctypes.byref(remote_report_size)))
File "/usr/local/lib/python3.6/dist-packages/securexgboost-0.1-py3.6.egg/securexgboost/core.py", line 203, in _check_call
raise XGBoostError(py_str(_LIB.XGBGetLastError()))
securexgboost.core.XGBoostError

Remote client API improvement

Currently, the client-facing API for the remote-control use case is RPC aware and different from the core Python API. We should abstract the RPC operations away from the client, and reconcile the remote client API with the core Python API.

different result between secure xgboost and xgboost

Hi,
I found the prediction results from the latest secure xgboost are always different from xgboost 1.2.0.
Dataset:
https://archive.ics.uci.edu/ml/machine-learning-databases/00374/energydata_complete.csv

My python code:
`import csv
import xgboost as xgb

import random

random.seed(0)

RAW_DATA_FILE_PATH = '/home/test/energydata_complete.csv'
TRAIN_FILE_PATH = '/home/test/regression/train.txt'
TEST_FILE_PATH = '/home/test/regression/test.txt'

def main():
# Data pre-processing
with open(RAW_DATA_FILE_PATH, 'r') as fin, open(TRAIN_FILE_PATH, 'w') as train_fout, open(TEST_FILE_PATH, 'w') as test_fout:
reader = csv.reader(fin)
_ = next(reader)
for row in reader:
label = row[1]
line = str(float(label)) + ' ' + ','.join(['{}:{}'.format(no, float(f)) for no, f in enumerate(row[2:])])
if random.random() < 0.1:
fout = test_fout
else:
fout = train_fout
fout.write(line + '\n')

dtrain = xgb.DMatrix(TRAIN_FILE_PATH)
dtest = xgb.DMatrix(TEST_FILE_PATH)

param = {'max_depth': 5, 'eta': 0.3, 'objective': 'reg:squarederror', 'n_estimators': 200, 'alpha': 0, 'lambda': 100, 'sketch_eps': 0.03}
bst = xgb.train(param, dtrain, 10)

mae, n = 0, 0
with open(TEST_FILE_PATH, 'r') as fin:
    for line, y_pred in zip(fin, bst.predict(dtest)):
        y = float(line.strip().split()[0])
        y_pred = float(y_pred)
        mae += abs(y - y_pred)
        n += 1
mae = mae / n
print(mae)

if name == 'main':
main()`

The result is
[05:31:05] WARNING: xgboost/src/learner.cc:516:
Parameters: { n_estimators } might not be used.

This may not be accurate due to some parameters are only used in language bindings but
passed down to XGBoost core. Or some parameters are not used but slip through this
verification. Please open an issue if you find above cases.

46.5267243112152

And below is my python code for secure xgboost:
` xgb.generate_client_key(key_file)
xgb.encrypt_file(inputfile_train, inputfile_train + ".enc", key_file)
xgb.encrypt_file(inputfile_test, inputfile_test + ".enc", key_file)

    print("Init user and enclave parameters")
    xgb.init_client(config=config_file)
    xgb.init_server(enclave_image=xgboost_enclave_image_file, client_list=[user_name], log_verbosity=1)

    # Remote Attestation
    print("Remote attestation")

    # Note: Simulation mode does not support attestation
    # pass in `verify=False` to attest()
    xgb.attest(verify=False)

   print("Creating training matrix from encrypted file")
    dtrain = xgb.DMatrix({user_name: inputfile_train + ".enc"})

    print("Creating test matrix from encrypted file")
    dtest = xgb.DMatrix({user_name: inputfile_test + ".enc"})

    print("Beginning Training")
    # Set training parameters
    param = {'max_depth': 5, 'eta': 0.3, 'objective': 'reg:squarederror', 'n_estimators': 200, 'alpha': 0, 'lambda': 100, 'sketch_eps': 0.03}

    print("Set training parameters:")
    print(param)
    # Train and evaluate
    booster = xgb.train(param, dtrain, int(number_of_rounds), evals=[(dtrain, "train"), (dtest, "test")])

    # Get encrypted predictions
    print("\nModel Predictions: ")
    predictions, num_preds = booster.predict(dtest, decrypt=False)

    # Decrypt predictions
    print(booster.decrypt_predictions(predictions, num_preds))
    with open(outputfile_predict_result, 'w') as rf:
            rf.write(pd.Series(booster.decrypt_predictions(predictions, num_preds)).to_json(orient='values'))

    mae, n = 0, 0
    with open(inputfile_test, 'r') as fin:
        for line, y_pred in zip(fin, booster.decrypt_predictions(predictions, num_preds)):
            y = float(line.strip().split()[0])
            y_pred = float(y_pred)
            mae += abs(y - y_pred)
            n += 1
    mae = mae / n
    print(mae)`

And the result is:
Beginning Training
Set training parameters:
{'max_depth': 5, 'eta': 0.3, 'objective': 'reg:squarederror', 'n_estimators': 200, 'alpha': 0, 'lambda': 100, 'sketch_eps': 0.03}

Model Predictions:
[ 74.07482 47.515785 47.590363 ... 117.18135 157.50322 114.312454]
25.92078459969717

The MAE of secure xgboost is litter than the normal xgboost. Is there any optimization applied to the implementation?
Could you help to look at this issue? I think the results should be the same when xgb got the same parameters.

thanks,
Su

Add Dockerfile to enable local usage

We currently offer a Docker image with necessary dependencies, but the image is quite large (~5GB) and takes a while to download. Consequently, we should also provide a Dockerfile as part of this repo to enable users to build the container much faster locally.

for demo/python/distributed

When run on local, it's ok. Result for local run like this:
image
But when run for distributed, it's wrong like this:
image
Can you tell me which is wrong for it? Thank you very much!!

More descriptive MbedTLS error messages

Currently, all mbed TLS errors are outputted by LOG(FATAL), with the return code. We can use the following code to map the return code to an error message, and log the more descriptive error message.

char error_buf[200];
mbedtls_strerror( ret, error_buf, 200 );
LOG(FATAL) << error_buf;

Clean up macros

Currently we use macros to keep old code around while compiling the latest version of the codebase. We should remove these macros and the corresponding old code.

RuntimeError: Python version >= 3.6 required.

Hi,

I am following the instructions for a demo.

sudo python3 setup.py install
is not working for me. For a reason that I couldnt figure out, it gives an error when I call it.

Running scipy-1.5.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-1aT6QP/scipy-1.5.2/egg-dist-tmp-13I6Rd
Traceback (most recent call last):
File "setup.py", line 59, in
url='https://github.com/dmlc/xgboost')
File "/usr/lib/python2.7/dist-packages/setuptools/init.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/dist-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/usr/lib/python2.7/dist-packages/setuptools/command/install.py", line 117, in do_egg_install
cmd.run()
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 437, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 679, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 726, in install_item
self.process_distribution(spec, dist, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 771, in process_distribution
[requirement], self.local_index, self.easy_install
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 774, in resolve
replace_conflicting=replace_conflicting
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1057, in best_match
return self.obtain(req, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1069, in obtain
return installer(requirement)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 698, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 724, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 909, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1177, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1163, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 253, in run_setup
raise
File "/usr/lib/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-1aT6QP/scipy-1.5.2/setup.py", line 31, in
# Please use setup_pip.py for generating and deploying pip installation
RuntimeError: Python version >= 3.6 required.

I have python with version Python 3.7.3. What are the usual suspects for this error? Thank you for your effort. Also, no error on
pip3 install numpy pandas sklearn numproto grpcio grpcio-tools

RPC Error Handling

  • Gracefully return an error to the client if an error occurs on the server
  • Check to ensure that proper parameters are passed into corresponding Python functions

Improving cluster attestation design

Currently, remote clients individually attest each enclave in a cluster (and transfer their file encryption keys to each enclave individually), which is not very scalable.
Ideally we should have the client attest and exchange keys with only the 'master' enclave. The master enclave should then distribute the client's keys to the other enclaves in the cluster. The enclaves already perform inter-enclave attestation while setting up TLS communication channels, so distributing the keys to other enclaves is safe.

The current design uses an RPC server (which exposes a simple attestation API to the client) on every enclave node. One option is to switch to a tiered design where the client communicates with an intermediate 'master' RPC server. This 'master' RPC server would in turn orchestrate the servers on each enclave node.

verification failed -- mbedtls_pk_verify returned

Hi,
I run the distributed demo, it works when sh run-local.sh 1 is executed.
But sh run-local.sh 2 doesn't work.

The output is as follows:
2021-04-01 08:09:53,248 INFO start listen on 10.1.41.239:9092
2021-04-01 08:09:53,250 DEBUG num of retry 0
2021-04-01 08:09:53,251 DEBUG num of retry 0
Creating enclave
Creating enclave
Remote attestation
2021-04-01 08:09:54,559 DEBUG Created SlaveEntry for node: 10.1.41.239
task NULL connected to the tracker
Remote attestation
2021-04-01 08:09:54,612 DEBUG Created SlaveEntry for node: 10.1.41.239
task NULL connected to the tracker
task NULL got new rank 0
2021-04-01 08:09:54,741 DEBUG Recieve start signal from 10.1.41.239; assign rank 0
task NULL got new rank 1
2021-04-01 08:09:54,969 DEBUG Recieve start signal from 10.1.41.239; assign rank 1
2021-04-01 08:09:54,969 INFO @TracKer All of 2 nodes getting started
Creating training matrix from encrypted file
Creating training matrix from encrypted file
Traceback (most recent call last):
File "distr-training.py", line 35, in
dtrain = xgb.DMatrix({username: HOME_DIR + "demo/data/agaricus.txt.train.enc"})
File "/usr/local/lib/python3.6/dist-packages/securexgboost-0.1-py3.6.egg/securexgboost/core.py", line 570, in init
c_lengths))
File "/usr/local/lib/python3.6/dist-packages/securexgboost-0.1-py3.6.egg/securexgboost/core.py", line 203, in _check_call
raise XGBoostError(py_str(_LIB.XGBGetLastError()))
securexgboost.core.XGBoostError: [16172645] /home/songhongguang/myproject/secure-xgboost/enclave/../include/enclave/crypto.h:277: verification failed -- mbedtls_pk_verify returned -17280
Stack trace:
[bt] (0) _ZN4dmlc15LogMessageFatalD1Ev
[bt] (1) _ZL15verifySignature18mbedtls_pk_contextPhmS0_m
[bt] (2) _ZN14EnclaveContext22verifyClientSignaturesEPhmPPcPS0_Pm
[bt] (3) _Z18check_signed_inputRNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEEPPcPPhPm
[bt] (4) XGDMatrixCreateFromEncryptedFile
[bt] (5) enclave_XGDMatrixCreateFromEncryptedFile
[bt] (6) ecall_enclave_XGDMatrixCreateFromEncryptedFile
[bt] (7) oe_handle_call_enclave_function
[bt] (8) _handle_ecall

Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(self._args, **self.kwargs)
File "/home/songhongguang/myproject/secure-xgboost/host/dmlc-core/tracker/dmlc_tracker/local.py", line 49, in exec_cmd
raise RuntimeError('Get nonzero return code=%d on %s %s' % (ret, cmd, env))
RuntimeError: Get nonzero return code=1 on ['python3', 'distr-training.py'] {'SUDO_GID': '1002', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'MAIL': '/var/mail/root', 'USER': 'root', 'SHLVL': '1', 'HOME': '/root', 'OLDPWD': '/home/songhongguang/myproject/secure-xgboost/python-package', 'LC_CTYPE': 'UTF-8', 'SUDO_UID': '1002', 'LOGNAME': 'root', '
': '/bin/sh', 'USERNAME': 'root', 'TERM': 'xterm-256color', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin', 'LANG': 'C.UTF-8', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:
.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.zst=01;31:.tzst=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.wim=01;31:.swm=01;31:.dwm=01;31:.esd=01;31:.jpg=01;35:.jpeg=01;35:.mjpg=01;35:.mjpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:*.xspf=00;36:', 'SUDO_COMMAND': '/bin/bash', 'SHELL': '/bin/bash', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'SUDO_USER': 'songhongguang', 'PWD': '/home/songhongguang/myproject/secure-xgboost/demo/python/distributed', 'XDG_DATA_DIRS': '/usr/local/share:/usr/share:/var/lib/snapd/desktop', 'DMLC_NUM_WORKER': '2', 'DMLC_NUM_SERVER': '0', 'DMLC_TRACKER_URI': '10.1.41.239', 'DMLC_TRACKER_PORT': '9092', 'DMLC_TASK_ID': '1', 'DMLC_ROLE': 'worker', 'DMLC_JOB_CLUSTER': 'local'}

Traceback (most recent call last):
File "distr-training.py", line 35, in
dtrain = xgb.DMatrix({username: HOME_DIR + "demo/data/agaricus.txt.train.enc"})
File "/usr/local/lib/python3.6/dist-packages/securexgboost-0.1-py3.6.egg/securexgboost/core.py", line 570, in init
c_lengths))
File "/usr/local/lib/python3.6/dist-packages/securexgboost-0.1-py3.6.egg/securexgboost/core.py", line 203, in _check_call
raise XGBoostError(py_str(_LIB.XGBGetLastError()))
securexgboost.core.XGBoostError: [16172645] /home/songhongguang/myproject/secure-xgboost/enclave/src/data/data.cc:842: Encountered parser error:
[16172645] /home/songhongguang/myproject/secure-xgboost/enclave/rabit/src/./ssl_socket.h:28:
Stack trace:
[bt] (0) _ZN5rabit5utilsL9print_errEi
[bt] (1) _ZN5rabit6engine13AllreduceBase16TryAllreduceTreeEPvmmPFvPKvS2_iRKN3MPI8DatatypeEE
[bt] (2) _ZN5rabit6engine15AllreduceRobust11RecoverExecEPvmiiiPKc
[bt] (3) ZN5rabit6engine15AllreduceRobust9AllreduceEPvmmPFvPKvS2_iRKN3MPI8DatatypeEEPFvS2_ES2_PKciSE
[bt] (4) ZN5rabit6engine10Allreduce_EPvmmPFvPKvS1_iRKN3MPI8DatatypeEENS0_3mpi8DataTypeENSA_6OpTypeEPFvS1_ES1_PKciSG
[bt] (5) _ZN7xgboost4data13SimpleDMatrixC1ENSt3__16vectorIPNS0_11FileAdapterENS2_9allocatorIS5_EEEEfi
[bt] (6) _ZN7xgboost7DMatrix4LoadERNSt3__16vectorIKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS9_EEEEbbbPPcRS9_m
[bt] (7) XGDMatrixCreateFromEncryptedFile
[bt] (8) enclave_XGDMatrixCreateFromEncryptedFile

Stack trace:
[bt] (0) _ZN4dmlc15LogMessageFatalD1Ev
[bt] (1) _ZN7xgboost7DMatrix4LoadERNSt3__16vectorIKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS9_EEEEbbbPPcRS9_m
[bt] (2) XGDMatrixCreateFromEncryptedFile
[bt] (3) enclave_XGDMatrixCreateFromEncryptedFile
[bt] (4) ecall_enclave_XGDMatrixCreateFromEncryptedFile
[bt] (5) oe_handle_call_enclave_function
[bt] (6) _handle_ecall
[bt] (7) oe_enter

Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(self._args, **self.kwargs)
File "/home/songhongguang/myproject/secure-xgboost/host/dmlc-core/tracker/dmlc_tracker/local.py", line 49, in exec_cmd
raise RuntimeError('Get nonzero return code=%d on %s %s' % (ret, cmd, env))
RuntimeError: Get nonzero return code=1 on ['python3', 'distr-training.py'] {'SUDO_GID': '1002', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'MAIL': '/var/mail/root', 'USER': 'root', 'SHLVL': '1', 'HOME': '/root', 'OLDPWD': '/home/songhongguang/myproject/secure-xgboost/python-package', 'LC_CTYPE': 'UTF-8', 'SUDO_UID': '1002', 'LOGNAME': 'root', '
': '/bin/sh', 'USERNAME': 'root', 'TERM': 'xterm-256color', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin', 'LANG': 'C.UTF-8', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:
.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.zst=01;31:.tzst=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.wim=01;31:.swm=01;31:.dwm=01;31:.esd=01;31:.jpg=01;35:.jpeg=01;35:.mjpg=01;35:.mjpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:*.xspf=00;36:', 'SUDO_COMMAND': '/bin/bash', 'SHELL': '/bin/bash', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'SUDO_USER': 'songhongguang', 'PWD': '/home/songhongguang/myproject/secure-xgboost/demo/python/distributed', 'XDG_DATA_DIRS': '/usr/local/share:/usr/share:/var/lib/snapd/desktop', 'DMLC_NUM_WORKER': '2', 'DMLC_NUM_SERVER': '0', 'DMLC_TRACKER_URI': '10.1.41.239', 'DMLC_TRACKER_PORT': '9092', 'DMLC_TASK_ID': '0', 'DMLC_ROLE': 'worker', 'DMLC_JOB_CLUSTER': 'local'}

It seems that the reason is because the enclave failed to validate the client's signature.
It's strange that 1 worker works but 2 workers doesn't work.
Could you please tell me the possible reason? (We used the simulation mode, could that be the cause of the problem?)
Thank you~~~

Distributed secure-xgboost tutorial example yields error

Running the distributed Secure XGBoost tutorial produces the following errors:

ryan@ryan-dev-vm:~/secure-xgboost/demo/python/distributed$ ./run-local.sh 2
2021-04-08 00:12:11,735 INFO start listen on 10.0.9.8:9091
2021-04-08 00:12:11,736 DEBUG num of retry 0
2021-04-08 00:12:11,737 DEBUG num of retry 0
Creating enclave
Creating enclave
Remote attestation
Remote attestation
Azure Quote Provider: libdcap_quoteprov.so [ERROR]: Could not retrieve environment variable for 'AZDCAP_DEBUG_LOG_LEVEL'
Azure Quote Provider: libdcap_quoteprov.so [ERROR]: Could not retrieve environment variable for 'AZDCAP_DEBUG_LOG_LEVEL'
2021-04-08 00:12:13,289 DEBUG Created SlaveEntry for node: 10.0.9.8
task NULL connected to the tracker
2021-04-08 00:12:13,297 DEBUG Created SlaveEntry for node: 10.0.9.8
task NULL connected to the tracker
task NULL got new rank 02021-04-08 00:12:13,299 DEBUG Recieve start signal from 10.0.9.8; assign rank 0task NULL got new rank 12021-04-08 00:12:13,465 DEBUG Recieve start signal from 10.0.9.8; assign rank 12021-04-08 00:12:13,465 INFO @tracker All of 2 nodes getting startedCreating training matrix from encrypted fileCreating training matrix from encrypted file
Traceback (most recent call last):
  File "distr-training.py", line 35, in <module>
    dtrain = xgb.DMatrix({username: HOME_DIR + "demo/data/agaricus.txt.train.enc"})
  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 570, in __init__
    c_lengths))
  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 203, in _check_call
    raise XGBoostError(py_str(_LIB.XGBGetLastError()))
securexgboost.core.XGBoostError: [16178407] /home/ryan/secure-xgboost/enclave/../include/enclave/crypto.h:248: verification failed -- mbedtls_pk_verify returned -17280Stack trace:  [bt] (0) _ZN4dmlc15LogMessageFatalD1Ev  [bt] (1) _ZL15verifySignature18mbedtls_pk_contextPhmS0_m  [bt] (2) _ZN14EnclaveContext22verifyClientSignaturesEPhmPPcPS0_Pm  [bt] (3) _Z18check_signed_inputRNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEEPPcPPhPm  [bt] (4) XGDMatrixCreateFromEncryptedFile  [bt] (5) enclave_XGDMatrixCreateFromEncryptedFile
  [bt] (6) ecall_enclave_XGDMatrixCreateFromEncryptedFile
  [bt] (7) oe_handle_call_enclave_function
  [bt] (8) _handle_ecall


Traceback (most recent call last):
  File "distr-training.py", line 35, in <module>
    dtrain = xgb.DMatrix({username: HOME_DIR + "demo/data/agaricus.txt.train.enc"})  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 570, in __init__    c_lengths))  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 203, in _check_call    raise XGBoostError(py_str(_LIB.XGBGetLastError()))securexgboost.core.XGBoostError: [16178407] /home/ryan/secure-xgboost/enclave/src/data/data.cc:842: Encountered parser error:[16178407] /home/ryan/secure-xgboost/enclave/rabit/src/./ssl_socket.h:28:Stack trace:  [bt] (0) _ZN5rabit5utilsL9print_errEi  [bt] (1) _ZN5rabit6engine13AllreduceBase16TryAllreduceTreeEPvmmPFvPKvS2_iRKN3MPI8DatatypeEE  [bt] (2) _ZN5rabit6engine15AllreduceRobust11RecoverExecEPvmiiiPKc  [bt] (3) _ZN5rabit6engine15AllreduceRobust9AllreduceEPvmmPFvPKvS2_iRKN3MPI8DatatypeEEPFvS2_ES2_PKciSE_  [bt] (4) _ZN5rabit6engine10Allreduce_EPvmmPFvPKvS1_iRKN3MPI8DatatypeEENS0_3mpi8DataTypeENSA_6OpTypeEPFvS1_ES1_PKciSG_
  [bt] (5) _ZN7xgboost4data13SimpleDMatrixC1ENSt3__16vectorIPNS0_11FileAdapterENS2_9allocatorIS5_EEEEfi
  [bt] (6) _ZN7xgboost7DMatrix4LoadERNSt3__16vectorIKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS9_EEEEbbbPPcRS9_m
  [bt] (7) XGDMatrixCreateFromEncryptedFile
  [bt] (8) enclave_XGDMatrixCreateFromEncryptedFile


Stack trace:
  [bt] (0) _ZN4dmlc15LogMessageFatalD1Ev
  [bt] (1) _ZN7xgboost7DMatrix4LoadERNSt3__16vectorIKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS9_EEEEbbbPPcRS9_m
  [bt] (2) XGDMatrixCreateFromEncryptedFile  [bt] (3) enclave_XGDMatrixCreateFromEncryptedFile  [bt] (4) ecall_enclave_XGDMatrixCreateFromEncryptedFile  [bt] (5) oe_handle_call_enclave_function  [bt] (6) _handle_ecall  [bt] (7) oe_enter

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/ryan/secure-xgboost/host/dmlc-core/tracker/dmlc_tracker/local.py", line 49, in exec_cmd
    raise RuntimeError('Get nonzero return code=%d on %s %s' % (ret, cmd, env))
RuntimeError: Get nonzero return code=1 on ['python3', 'distr-training.py'] {'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'SSH_CONNECTION': '73.252.231.20 60122 10.0.9.8 22', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', '_': '../../../host/dmlc-core/tracker/dmlc-submit', 'LANG': 'C.UTF-8', 'OLDPWD': '/home/ryan/secure-xgboost/demo/python/multiclient-cluster-remote-control/server', 'XDG_SESSION_ID': '1', 'USER': 'ryan', 'OPAQUE_DATA_DIR': '/home/ryan/opaque/data/', 'OE_SDK_PATH': '/opt/openenclave/', 'PWD': '/home/ryan/secure-xgboost/demo/python/distributed', 'HOME': '/home/ryan', 'CMAKE_PREFIX_PATH': ':/opt/openenclave/lib/openenclave/cmake:/opt/openenclave/lib/openenclave/cmake', 'SSH_CLIENT': '73.252.231.20 57585 22', 'TMUX': '/tmp/tmux-1000/default,2220,0', 'XDG_DATA_DIRS': '/usr/local/share:/usr/share:/var/lib/snapd/desktop', 'PRIVATE_KEY_PATH': '/home/ryan/opaque/private_key.pem', 'SPARK_SCALA_VERSION': '2.12', 'SPARK_HOME': '/opt/spark', 'OPAQUE_HOME': '/home/ryan/opaque', 'SSH_TTY': '/dev/pts/0', 'MAIL': '/var/mail/ryan', 'SHELL': '/bin/bash', 'TERM': 'screen-256color', 'TMUX_PANE': '%13', 'SHLVL': '3', 'LOGNAME': 'ryan', 'XDG_RUNTIME_DIR': '/run/user/1000', 'MODE': 'HARDWARE', 'PATH': '/home/ryan/.local/bin:/home/ryan/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/spark/bin:/opt/spark/sbin:/home/ryan/.local/bin:/opt/openenclave/bin:/home/ryan/.fzf/bin', 'PKG_CONFIG_PATH': ':/opt/openenclave/share/pkgconfig:/opt/openenclave/share/pkgconfig', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'DMLC_NUM_WORKER': '2', 'DMLC_NUM_SERVER': '0', 'DMLC_TRACKER_URI': '10.0.9.8', 'DMLC_TRACKER_PORT': '9091', 'DMLC_TASK_ID': '0', 'DMLC_ROLE': 'worker', 'DMLC_JOB_CLUSTER': 'local'}

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/ryan/secure-xgboost/host/dmlc-core/tracker/dmlc_tracker/local.py", line 49, in exec_cmd
    raise RuntimeError('Get nonzero return code=%d on %s %s' % (ret, cmd, env))
RuntimeError: Get nonzero return code=1 on ['python3', 'distr-training.py'] {'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'SSH_CONNECTION': '73.252.231.20 60122 10.0.9.8 22', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', '_': '../../../host/dmlc-core/tracker/dmlc-submit', 'LANG': 'C.UTF-8', 'OLDPWD': '/home/ryan/secure-xgboost/demo/python/multiclient-cluster-remote-control/server', 'XDG_SESSION_ID': '1', 'USER': 'ryan', 'OPAQUE_DATA_DIR': '/home/ryan/opaque/data/', 'OE_SDK_PATH': '/opt/openenclave/', 'PWD': '/home/ryan/secure-xgboost/demo/python/distributed', 'HOME': '/home/ryan', 'CMAKE_PREFIX_PATH': ':/opt/openenclave/lib/openenclave/cmake:/opt/openenclave/lib/openenclave/cmake', 'SSH_CLIENT': '73.252.231.20 57585 22', 'TMUX': '/tmp/tmux-1000/default,2220,0', 'XDG_DATA_DIRS': '/usr/local/share:/usr/share:/var/lib/snapd/desktop', 'PRIVATE_KEY_PATH': '/home/ryan/opaque/private_key.pem', 'SPARK_SCALA_VERSION': '2.12', 'SPARK_HOME': '/opt/spark', 'OPAQUE_HOME': '/home/ryan/opaque', 'SSH_TTY': '/dev/pts/0', 'MAIL': '/var/mail/ryan', 'SHELL': '/bin/bash', 'TERM': 'screen-256color', 'TMUX_PANE': '%13', 'SHLVL': '3', 'LOGNAME': 'ryan', 'XDG_RUNTIME_DIR': '/run/user/1000', 'MODE': 'HARDWARE', 'PATH': '/home/ryan/.local/bin:/home/ryan/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/spark/bin:/opt/spark/sbin:/home/ryan/.local/bin:/opt/openenclave/bin:/home/ryan/.fzf/bin', 'PKG_CONFIG_PATH': ':/opt/openenclave/share/pkgconfig:/opt/openenclave/share/pkgconfig', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'DMLC_NUM_WORKER': '2', 'DMLC_NUM_SERVER': '0', 'DMLC_TRACKER_URI': '10.0.9.8', 'DMLC_TRACKER_PORT': '9091', 'DMLC_TASK_ID': '1', 'DMLC_ROLE': 'worker', 'DMLC_JOB_CLUSTER': 'local'}

and

ryan@ryan-dev-vm:~/secure-xgboost/demo/python/distributed$ ./run-distributed.sh 2
2021-04-08 04:46:05,116 INFO start listen on 10.0.9.8:9091
2021-04-08 04:46:05,117 DEBUG SSH-ing to 127.0.0.1:22
2021-04-08 04:46:05,118 DEBUG SSH-ing to 127.0.0.1:22
2021-04-08 04:46:06,541 DEBUG Created SlaveEntry for node: 10.0.9.8
task NULL connected to the tracker
2021-04-08 04:46:06,587 DEBUG Created SlaveEntry for node: 10.0.9.8
task NULL connected to the tracker
task NULL got new rank 0
2021-04-08 04:46:06,588 DEBUG Recieve start signal from 10.0.9.8; assign rank 0
task NULL got new rank 1
2021-04-08 04:46:06,767 DEBUG Recieve start signal from 10.0.9.8; assign rank 1
2021-04-08 04:46:06,767 INFO @tracker All of 2 nodes getting started
Creating enclave
Remote attestation
Creating training matrix from encrypted file
Azure Quote Provider: libdcap_quoteprov.so [ERROR]: Could not retrieve environment variable for 'AZDCAP_DEBUG_LOG_LEVEL'
Traceback (most recent call last):
  File "distr-training.py", line 35, in <module>
    dtrain = xgb.DMatrix({username: HOME_DIR + "demo/data/agaricus.txt.train.enc"})
  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 570, in __init__
    c_lengths))
  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 203, in _check_call
    raise XGBoostError(py_str(_LIB.XGBGetLastError()))
securexgboost.core.XGBoostError: [16178571] /home/ryan/secure-xgboost/enclave/../include/enclave/crypto.h:248: verification failed -- mbedtls_pk_verify returned -17280
Stack trace:
  [bt] (0) _ZN4dmlc15LogMessageFatalD1Ev
  [bt] (1) _ZL15verifySignature18mbedtls_pk_contextPhmS0_m
  [bt] (2) _ZN14EnclaveContext22verifyClientSignaturesEPhmPPcPS0_Pm
  [bt] (3) _Z18check_signed_inputRNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEEPPcPPhPm
  [bt] (4) XGDMatrixCreateFromEncryptedFile
  [bt] (5) enclave_XGDMatrixCreateFromEncryptedFile
  [bt] (6) ecall_enclave_XGDMatrixCreateFromEncryptedFile
  [bt] (7) oe_handle_call_enclave_function
  [bt] (8) _handle_ecall


Creating enclave
Remote attestation
Creating training matrix from encrypted file
Azure Quote Provider: libdcap_quoteprov.so [ERROR]: Could not retrieve environment variable for 'AZDCAP_DEBUG_LOG_LEVEL'
Traceback (most recent call last):
  File "distr-training.py", line 35, in <module>
    dtrain = xgb.DMatrix({username: HOME_DIR + "demo/data/agaricus.txt.train.enc"})
  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 570, in __init__
    c_lengths))
  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 203, in _check_call
    raise XGBoostError(py_str(_LIB.XGBGetLastError()))
securexgboost.core.XGBoostError: [16178571] /home/ryan/secure-xgboost/enclave/src/data/data.cc:842: Encountered parser error:
[16178571] /home/ryan/secure-xgboost/enclave/rabit/src/./ssl_socket.h:28: 
Stack trace:
  [bt] (0) _ZN5rabit5utilsL9print_errEi
  [bt] (1) _ZN5rabit6engine13AllreduceBase16TryAllreduceTreeEPvmmPFvPKvS2_iRKN3MPI8DatatypeEE
  [bt] (2) _ZN5rabit6engine15AllreduceRobust11RecoverExecEPvmiiiPKc
  [bt] (3) _ZN5rabit6engine15AllreduceRobust9AllreduceEPvmmPFvPKvS2_iRKN3MPI8DatatypeEEPFvS2_ES2_PKciSE_
  [bt] (4) _ZN5rabit6engine10Allreduce_EPvmmPFvPKvS1_iRKN3MPI8DatatypeEENS0_3mpi8DataTypeENSA_6OpTypeEPFvS1_ES1_PKciSG_
  [bt] (5) _ZN7xgboost4data13SimpleDMatrixC1ENSt3__16vectorIPNS0_11FileAdapterENS2_9allocatorIS5_EEEEfi
  [bt] (6) _ZN7xgboost7DMatrix4LoadERNSt3__16vectorIKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS9_EEEEbbbPPcRS9_m
  [bt] (7) XGDMatrixCreateFromEncryptedFile
  [bt] (8) enclave_XGDMatrixCreateFromEncryptedFile


Stack trace:
  [bt] (0) _ZN4dmlc15LogMessageFatalD1Ev
  [bt] (1) _ZN7xgboost7DMatrix4LoadERNSt3__16vectorIKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS9_EEEEbbbPPcRS9_m
  [bt] (2) XGDMatrixCreateFromEncryptedFile
  [bt] (3) enclave_XGDMatrixCreateFromEncryptedFile
  [bt] (4) ecall_enclave_XGDMatrixCreateFromEncryptedFile
  [bt] (5) oe_handle_call_enclave_function
  [bt] (6) _handle_ecall
  [bt] (7) oe_enter


Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/ryan/secure-xgboost/host/dmlc-core/tracker/dmlc_tracker/ssh.py", line 62, in run
    subprocess.check_call(prog, shell = True)
  File "/usr/local/lib/python3.7/subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'ssh -o StrictHostKeyChecking=no 127.0.0.1 -p 22 'export DMLC_NUM_WORKER=2; export DMLC_NUM_SERVER=0; export DMLC_TRACKER_URI=10.0.9.8; export DMLC_TRACKER_PORT=9091; export DMLC_ROLE=worker; export DMLC_NODE_HOST=127.0.0.1; cd /home/ryan/secure-xgboost/demo/python/distributed/; python3 distr-training.py'' returned non-zero exit status 1.

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/ryan/secure-xgboost/host/dmlc-core/tracker/dmlc_tracker/ssh.py", line 62, in run
    subprocess.check_call(prog, shell = True)
  File "/usr/local/lib/python3.7/subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'ssh -o StrictHostKeyChecking=no 127.0.0.1 -p 22 'export DMLC_NUM_WORKER=2; export DMLC_NUM_SERVER=0; export DMLC_TRACKER_URI=10.0.9.8; export DMLC_TRACKER_PORT=9091; export DMLC_ROLE=worker; export DMLC_NODE_HOST=127.0.0.1; cd /home/ryan/secure-xgboost/demo/python/distributed/; python3 distr-training.py'' returned non-zero exit status 1.

Encryption support for currently disabled APIs

Some APIs are currently disabled because they should return encrypted results, to be decrypted by the clients during training (or the other way round).
e.g. XGBoosterEvalOneIter, GetFloatInfo, SetFloatInfo, etc.

fatal error: mbedtls/gcm.h: No such file or directory

I am getting the following error building Secure XG Boost in an Azure VM

~/secure-xgboost/build$ make -j4
[ 11%] Built target dmlc
[ 18%] Built target rabit
[ 22%] Built target objxgboost
Scanning dependencies of target xgboost
[ 23%] Linking CXX shared library ../libxgboost.so
[ 24%] Building CXX object enclave/CMakeFiles/xgboost_enclave.dir/ecalls_mc.cpp.o
[ 25%] Building CXX object enclave/CMakeFiles/xgboost_enclave.dir/dmlc-core/src/data.cc.o
[ 26%] Building CXX object enclave/CMakeFiles/xgboost_enclave.dir/dmlc-core/src/io.cc.o
[ 26%] Built target xgboost
[ 27%] Building CXX object enclave/CMakeFiles/xgboost_enclave.dir/dmlc-core/src/io/filesys.cc.o
In file included from /home/secureml/secure-xgboost/enclave/include/enclave_context.h:9:0,
                 from /home/secureml/secure-xgboost/enclave/ecalls_mc.cpp:10:
/home/secureml/secure-xgboost/enclave/../include/enclave/crypto.h:12:10: fatal error: mbedtls/gcm.h: No such file or directory
 #include "mbedtls/gcm.h"
          ^~~~~~~~~~~~~~~
compilation terminated.
enclave/CMakeFiles/xgboost_enclave.dir/build.make:72: recipe for target 'enclave/CMakeFiles/xgboost_enclave.dir/ecalls_mc.cpp.o' failed
make[2]: *** [enclave/CMakeFiles/xgboost_enclave.dir/ecalls_mc.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/secureml/secure-xgboost/enclave/dmlc-core/src/data/././text_parser.h:24:0,
                 from /home/secureml/secure-xgboost/enclave/dmlc-core/src/data/./libsvm_parser.h:21,
                 from /home/secureml/secure-xgboost/enclave/dmlc-core/src/data/disk_row_iter.h:19,
                 from /home/secureml/secure-xgboost/enclave/dmlc-core/src/data.cc:13:
/home/secureml/secure-xgboost/enclave/../include/enclave/crypto.h:12:10: fatal error: mbedtls/gcm.h: No such file or directory
 #include "mbedtls/gcm.h"
          ^~~~~~~~~~~~~~~
compilation terminated.
enclave/CMakeFiles/xgboost_enclave.dir/build.make:85: recipe for target 'enclave/CMakeFiles/xgboost_enclave.dir/dmlc-core/src/data.cc.o' failed
make[2]: *** [enclave/CMakeFiles/xgboost_enclave.dir/dmlc-core/src/data.cc.o] Error 1
CMakeFiles/Makefile2:349: recipe for target 'enclave/CMakeFiles/xgboost_enclave.dir/all' failed
make[1]: *** [enclave/CMakeFiles/xgboost_enclave.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

VM Image: Canonical:UbuntuServer:18_04-lts-gen2:18.04.201908220
$ dmesg | grep -i sgx
[ 4.164734] systemd[1]: Set hostname to .
[ 4.851648] sgx: EPC section 0x4c0200000-0x4c6ffffff
[ 4.852377] sgx: EPC section 0x4c7200000-0x4c73fffff
[ 4.854938] sgx: intel_sgx: Intel SGX DCAP Driver v1.33

Landing page usage example is broken

Copying and running the code from the Usage section of the landing page gives the following error:

Azure Quote Provider: libdcap_quoteprov.so [ERROR]: Could not retrieve environment variable for 'AZDCAP_DEBUG_LOG_LEVEL'
Traceback (most recent call last):
  File "demo.py", line 21, in <module>
    dtrain = xgb.DMatrix({"user1": "demo/data/train.enc"})
  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 570, in __init__
    c_lengths))
  File "/usr/local/lib/python3.7/site-packages/securexgboost-0.1-py3.7.egg/securexgboost/core.py", line 203, in _check_call
    raise XGBoostError(py_str(_LIB.XGBGetLastError()))
securexgboost.core.XGBoostError: [16178315] /home/ryan/secure-xgboost/enclave/dmlc-core/src/io/local_filesys.cc:111: LocalFileSystem.ListDirectory demo/data error: No such file or directory
Stack trace:
  [bt] (0) _ZN4dmlc2io15LocalFileSystem13ListDirectoryERKNS0_3URIEPNSt3__16vectorINS0_8FileInfoENS5_9allocatorIS7_EEEE
  [bt] (1) _ZN4dmlc2io14InputSplitBase13ConvertToURIsERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE
  [bt] (2) _ZN4dmlc2io14InputSplitBase17InitInputFileInfoERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEb
  [bt] (3) _ZN4dmlc2io14InputSplitBase4InitEPNS0_10FileSystemEPKcmb
  [bt] (4) _ZN4dmlc10InputSplit6CreateEPKcS2_jjS2_bimb
  [bt] (5) _ZN4dmlc10InputSplit6CreateEPKcjjS2_
  [bt] (6) _ZN4dmlc4data18CreateLibSVMParserIjfEEPNS_6ParserIT_fEERKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEERKNS6_3mapISC_SC_NS6_4lessISC_EENSA_INS6_4pairISD_SC_EEEEEEjjbPKc
  [bt] (7) _ZN4dmlc4data13CreateParser_IjfEEPNS_6ParserIT_T0_EEPKcjjS8_bS8_
  [bt] (8) _ZN7xgboost7DMatrix4LoadERNSt3__16vectorIKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS9_EEEEbbbPPcRS9_m

Replacing the relative paths of these lines:

dtrain = xgb.DMatrix({"user1": "demo/data/train.enc"})
dtest = xgb.DMatrix({"user1": "demo/data/test.enc"})

with their appropiate absolute paths:

dtrain = xgb.DMatrix({"user1": "/home/ryan/secure-xgboost/demo/data/train.enc"})
dtest = xgb.DMatrix({"user1": "/home/ryan/secure-xgboost/demo/data/test.enc"})

fixes the issue.

demo/data error: No such file or directory

Hi,

I run the demo code:
企业微信截图_17049545547384

but I get the error when I run the code:
企业微信截图_17049546089061

demo/data/agaricus.txt.train.enc and demo/data/agaricus.txt.test.enc exist. Do we need to do any additional configuration?

Documentation improvements

Starting this thread to track and collect various documentation improvements.

  • Document initialization APIs for client and enclave, and explain the various client / enclave keys
  • Add config file description for init_client API; add it to the demos as well
  • Consensus v. non-consensus mode, and which APIs require consensus
  • Clarify that obliviousness only supported for hist training at present
  • Text input format; e.g. https://xgboost.readthedocs.io/en/latest/tutorials/input_format.html

Consider new name for DMatrix / Booster alias

In #43 we introduced using an alias to identify DMatrix / Booster objects inside the enclave. We should rename the defined type given to this alias to not confuse those navigating the codebase. Currently, the defined types are DMatrixHandle / BoosterHandle, the same name as the originally used pointers.

Make j4 failed when install secure-xgboost

  1. The question is _"/home/lab123/secure-xgboost/enclave/../include/intrinsics/avx512fintrin.h:1761:20: error: ‘__builtin_ia32_sqrtsd_round’ was not declared in this scope; did you mean ‘__builtin_ia32_subsd_round’?
    1761 | return (__m128d) __builtin_ia32_sqrtsd_round ((__v2df) _"
    The detail of the this qesution as the following picture as follow:
    Snipaste_2022-07-18_15-59-39
    Snipaste_2022-07-18_16-00-06
  2. Envrionment informantion:
    Snipaste_2022-07-18_16-03-01
  3. The version of SecureXGBoost is getted by git from the master repo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.