Anjuna SGX Runtime Python package

Anjuna provides a Python package for better usage of the Anjuna SGX Runtime.

The Anjuna Python package is included both in the Anjuna SGX Runtime installer and in the Anjuna SGX Runtime for Docker.

It currently consists of two modules:

  • anjuna.posix_spawn - replaces Python standard library internal fork and execve calls to posix_spawn to speed up the creation of unprotected child processes

  • anjuna.apm - exposes the Anjuna Policy Manager API for Python applications (documentation coming soon)

Supported versions

The following Python versions are supported:

  • 3.8

  • 3.9

  • 3.10

Python package installation

Using the Anjuna SGX Runtime installer

The Anjuna Python package is part of the Anjuna SGX Runtime installer. It can be found under the <platform>/python directory in the installation directory, where <platform> is ubuntu18 or ubuntu20.

To install it, identify your supported Python version and install the Anjuna Python package using pip:

$ export PYTHON_VERSION=$(python3 --version | cut -d" " -f 2 | cut -c 1,3)
$ export ANJUNA_PYTHON_WHEEL="anjuna-1.0-cp${PYTHON_VERSION}-cp${PYTHON_VERSION}-linux_x86_64.whl"
$ python3 -m pip install "<path to your installer directory>/ubuntu18/python/${ANJUNA_PYTHON_WHEEL}"

Using the Anjuna SGX Runtime for Docker

The Anjuna Python package is a part of the Anjuna SGX Runtime for Docker.

Install Python

If your Docker image does not already contain a supported version of Python 3 (3.8, 3.9, or 3.10), you will need to install one.

  • Ubuntu

  • Debian

In Ubuntu 18.04 and 20.04, you can install a supported version of Python 3 using apt:

RUN apt update && apt install python3.8

In Debian 10, apt does not have a supported version of Python 3. You can download a supported version and install from source using the official Python source releases.

Install the Anjuna Python package

Then to install the Anjuna Python package, add the following lines to a Dockerfile:

# Add the Anjuna SGX Runtime for Docker
# Replace <platform> with ubuntu-20.04, ubuntu-18.04, or debian-10
ADD anjuna-with-deps-<platform>.tar.gz /

# Install the Anjuna Python package
# if using Python 3.9 or 3.10, you may need to explicitly call python3.9 or python3.10
RUN /bin/bash -c "export PYTHON_VERSION=\$(python3 --version | cut -d' ' -f 2 | cut -c 1,3); python3 -m pip install /anjuna/python/anjuna-1.0-cp\${PYTHON_VERSION}-cp\${PYTHON_VERSION}-linux_x86_64.whl"