apache / incubator-teaclave

Apache Teaclave (incubating) is an open source universal secure computing platform, making computation on privacy-sensitive data safe and simple.
https://teaclave.apache.org
Apache License 2.0
757 stars 159 forks source link

How to debug Python scripts #393

Open hoshinoko opened 4 years ago

hoshinoko commented 4 years ago

Hello! I want to use teaclave to build some machine learning algorithms, but when debugging the program, I find that the error message is not clear. I think the problem lies in that I use numpy to run the program locally, while teaclave uses the library in mesapy to run it, which may be due to version inconsistency. Can you give me some advice? Should I look at the source code of the supported libraries in the mesapy library to rewrite my Python program, or should I learn rust and use it to write machine learning algorithms.

mssun commented 4 years ago

Hi, thanks for asking. This is one of our limitation for the MesaPy executor. One way to debug Python scripts is to directly use the standalone MesaPy for SGX. For instance, you can use the exec example (https://github.com/mesalock-linux/mesapy/tree/sgx/sgx/examples/exec) to develop the Python script first and then run in the Teaclave framework.

For your case, I think this is because you are using numpy, while the MesaPy executor does not support numpy and many other third-party libraries currently.

master-davidlee commented 3 years ago

Hi, How can I load the MachineLearning model files and run it within Teaclave?

aqinwenky commented 2 years ago

Hi, thanks for asking. This is one of our limitation for the MesaPy executor. One way to debug Python scripts is to directly use the standalone MesaPy for SGX. For instance, you can use the exec example (https://github.com/mesalock-linux/mesapy/tree/sgx/sgx/examples/exec) to develop the Python script first and then run in the Teaclave framework.

For your case, I think this is because you are using numpy, while the MesaPy executor does not support numpy and many other third-party libraries currently.

@mssun hi mssun,about this example https://github.com/mesalock-linux/mesapy/tree/sgx/sgx/examples/exec , I have a question.
I want to disable print buffer, make SGX_PRERELEASE=1 SGX_DEBUG=0, and then exec ./app
but app.py still prints some buffer, I think app.py is performed inside enclave, print(argv) print("Hello, World!") should not execute successfully. So Can you explain why? Maybe I misunderstood.