Skip to content
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

Gramine-SGX Container TEE support #1140

Merged

Conversation

MasterSkepticista
Copy link
Collaborator

@MasterSkepticista MasterSkepticista commented Nov 12, 2024

Overview

This PR adds Gramine-based TEE support for Task Runner API via the fx workspace dockerize command.
All images are built SGX-ready, with signing key automatically generated if a user does not explicitly provide one. This implies zero change in the command from a user's perspective, with a path forward to move to TDX/COCO.

Running enclaves does require attaching specific volumes and devices as Gramine requires. This is covered in the documentation.

Getting-started guide: README.md

Usage (only new changes are shown):

Usage: fx workspace dockerize [OPTIONS]

  Package current workspace as a TEE-ready Docker image.

Options:
  ...
  --enclave-key TEXT  Path to an enclave signing key. If not provided, a key will be auto-generated in the workspace.
                      Note that this command builds a TEE-ready image, key is NOT packaged along with the image. You
                      have the flexibility to not run inside a TEE later.
  ...

Tests

  • Added Docker gramine-direct CI test (SGX is not supported on CI yet).
  • Tested with gramine-direct and gramine-sgx on SGX-supported VMs.

@MasterSkepticista MasterSkepticista marked this pull request as ready for review November 14, 2024 08:58
@MasterSkepticista MasterSkepticista changed the title Gramine-based Container TEE support Gramine-SGX Container TEE support Nov 14, 2024
Signed-off-by: Shah, Karan <[email protected]>
Copy link
Collaborator

@teoparvanov teoparvanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thank you @MasterSkepticista ! I really like the approach where the image is TEE-ready by default, but you can also run it in non-TEE environments. I just have a couple of minor comments/questions, but overall I believe this PR is in very good shape!

PS: with this, OpenFL is back in the TEE game 🚀


```shell
# Pull latest stable base image
$> docker pull intel/openfl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this image automatically uploaded on each OpenFL release?

Copy link
Collaborator Author

@MasterSkepticista MasterSkepticista Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the scripts here are used to publish latest wheels and images.
Following 1.7, OpenFL base image will come bundled with Gramine (and ability to build SGX-ready workspaces).

Copy link
Collaborator

@teoparvanov teoparvanov Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, the intel/openfl image seems relatively up to date. The one I just pulled is marked as created "27 hours ago" - likely by some automated workflow. I guess I'm a little worried because those scripts are really old (3-4 years), and I don't understand the publishing workflow. But maybe you have better confidence in this process.

Just in case, have you tested the graminization workflow with this image, rather than the one built locally?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case, have you tested the graminization workflow with this image, rather than the one built locally?

I'm not sure of the publishing workflow either. We should revisit this.

Dockerize with Gramine won't work with any older commits/tags/releases for graminized workspaces. Part of the process is copying manifest/makefiles from the source code (which means it must be at least the latest commit that this PR points to).

I agree that this is a little painful as we have to wait for next major release until users can benefit from this. Best would be if users always git clone the tip of develop.

Copy link
Collaborator

@kta-intel kta-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice work @MasterSkepticista !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants