-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CON-1192: Python API integrated with simulation mode #87
Conversation
The user can now create a Python enclave by creating an enclave Gradle module with a single Python script in `src/main/python` (everything else in the Gradle project stays the same). The plugin will detect this and will take a fat jar of the `python-enclave-adapter` module, the Python script, the generated Gramine manifest (which is now created dynamically based on the local environment), and will bundle them into a zip file. This zip file is what the host will scan for when it loads an enclave. Any future data that needs to be part of a Gramine enclave can be put into this zip bundle. The enclave scanning process was been rewritten to support this zip Gramine “bundle”, alongwith the existing .so GraalVM “bundle”. The Gramine enclave process will pick up this optional Python file and manually set it on the `PythonEnclaveAdapter` object. Note, the integration test currently hangs on TC though it passes if run separately. It is only testing a very basic Python enclave, but instead should be updated to use something like PyTorch.
There's already a new release of Jep, https://github.com/ninia/jep/releases/tag/v4.1.0! I'll look into updating it a subsequent PR. |
This also highlights the problem with the current approach where we take a dependency to Jep via maven (a specific version), but then install the native libs for it via apt-get. Rather than figuring out if they are compatible with each other, we should use the same source for both, which probably means that we will need to build Jep ourselves and bundle the jep .so with the SDK. |
…am to plugin test enclave
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A first look with some questions. Good stuff
...in-enclave-gradle/src/main/kotlin/com/r3/conclave/plugin/enclave/gradle/ConclaveExtension.kt
Show resolved
Hide resolved
...adle/src/main/resources/com/r3/conclave/plugin/enclave/gradle/gramine/java.manifest.template
Outdated
Show resolved
Hide resolved
...adle/src/main/resources/com/r3/conclave/plugin/enclave/gradle/gramine/java.manifest.template
Show resolved
Hide resolved
...dle/src/main/kotlin/com/r3/conclave/plugin/enclave/gradle/gramine/GenerateGramineManifest.kt
Outdated
Show resolved
Hide resolved
Comments addressed, PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another set of minor requests. Will still need to see the changes in Gradle Plugin
...adle/src/main/resources/com/r3/conclave/plugin/enclave/gradle/gramine/java.manifest.template
Show resolved
Hide resolved
...dle/src/main/kotlin/com/r3/conclave/plugin/enclave/gradle/gramine/GenerateGramineManifest.kt
Show resolved
Hide resolved
conclave-host/src/main/kotlin/com/r3/conclave/host/internal/GramineEnclaveHandle.kt
Show resolved
Hide resolved
conclave-host/src/main/kotlin/com/r3/conclave/host/internal/GramineEnclaveHandle.kt
Show resolved
Hide resolved
integration-tests/plugin-tests/src/test/resources/test-enclave/build.gradle
Show resolved
Hide resolved
Pushed out another attempt to fix the integration tests. Also responded to your comments. |
The integration tests are now working. |
…ine, however this not a behaviour we actually want, so can be removed. But, the test shouldn't be hanging, which implies something is wrong with the Gramine integration. The test is reentract on a lock during close(), so perhaps that's where the issue might be. Either way, that's an issue for later.
…lobal timeout for all tests
…ntegration test container
… in Gramine, however this not a behaviour we actually want, so can be removed. But, the test shouldn't be hanging, which implies something is wrong with the Gramine integration. The test is reentract on a lock during close(), so perhaps that's where the issue might be. Either way, that's an issue for later." This reverts commit fd648a0.
381beec
to
7119a2c
Compare
f7c61b5
to
7006d37
Compare
I've fixed the integration tests for gramine so that now they don't hang. We get most, but not all, of the tests running. |
The user can now create a Python enclave by creating an enclave Gradle module with a single Python script in
src/main/python
(everything else in the Gradle project stays the same). The plugin will detect this and will take a fat jar of thepython-enclave-adapter
module, the Python script, the generated Gramine manifest (which is now created dynamically based on the local environment), and will bundle them into a zip file. This zip file is what the host will scan for when it loads an enclave. Any future data that needs to be part of a Gramine enclave can be put into this zip bundle as well.The enclave scanning process was been rewritten to support this zip Gramine “bundle”, alongwith the existing .so GraalVM “bundle”. The Gramine enclave process will pick up this optional Python file and manually set it on the
PythonEnclaveAdapter
object.The
runtimeType
enclave config has been made less strict and will now ignore case. For Python enclaves it will default to Gramine, rejecting any GraalVM config.A new python enclave has been added to the integration tests and which does a very basic Python test. This should be updated to something more substantial such as PyTorch. The integration tests had to be cleaned up to ensure it was running, including fixing the docker container so that Gramine can run inside it. This now means the Gramine integration tests no longer hang, but for some reason the Python test does not execute, even though it passes when run directly.