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

WIP Add support for Gramine-TDX #199

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dimakuv
Copy link

@dimakuv dimakuv commented May 10, 2024

Description of the changes

This is Work In Progress, adding support for https://github.com/gramineproject/gramine-tdx

Currently only Gramine-VM. I'll update with Gramine-TDX in the next iteration. Need to think how to automatically start socat for virtio-vsock networking.

How to test this PR?

README is updated with instructions.


This change is Reviewable

Copy link
Author

@dimakuv dimakuv left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 6 files reviewed, 2 unresolved discussions, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: Intel), "WIP" found in commit messages' one-liners


templates/apploader.common.template line 21 at r1 (raw file):

    exec gramine-vm /gramine/app_files/entrypoint \
        {% if insecure_args %}{{ binary_arguments | map('shlex_quote') | join(' ') }} \
        "${@}"{% endif %}

Maybe this should go into another PR that changes GSC_PAL to something more adequate, like GSC_GRAMINE_BINARY which is equal to gramine-sgx, gramine-direct, ...

In this case, this apploader script will end up as a simple:

exec ${GSC_GRAMINE_BINARY:-gramine-sgx} /gramine/app_files/entrypoint \
    {% if insecure_args %}{{ binary_arguments | map('shlex_quote') | join(' ') }} \
    "${@}"{% endif %}

templates/debian/Dockerfile.build.template line 46 at r1 (raw file):

    && rm -rf /var/lib/apt/lists/*

RUN ln -s /usr/bin/qemu-system-x86_64 /usr/local/bin/qemu

FYI: This is purely for convenience (to be able to type qemu inside the container). Maybe I should add a comment about this.


test/README.rst line 73 at r1 (raw file):

  memory. However, Docker containers start with 64MB by default. Thus, we need
  to explicitly specify the shared memory limit. ``4G`` is just an example; this
  limit depends on the app running inside Gramine-TDX.

--shm-size was painful to debug, so here are some references for history:


test/ubuntu22.04-hello-world.dockerfile line 1 at r1 (raw file):

FROM ubuntu:22.04

The two test/ files probably should go in a separate PR that updates our GSC tests.

Copy link
Author

@dimakuv dimakuv left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 6 files reviewed, 2 unresolved discussions, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: Intel), "WIP" found in commit messages' one-liners (waiting on @dimakuv)


test/ubuntu22.04-hello-world.dockerfile line 1 at r1 (raw file):

Previously, dimakuv (Dmitrii Kuvaiskii) wrote…

The two test/ files probably should go in a separate PR that updates our GSC tests.

Done, split into #200.

Will need to rebase after #200 is merged.

Copy link
Author

@dimakuv dimakuv left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 6 files reviewed, 2 unresolved discussions, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: Intel), "WIP" found in commit messages' one-liners


templates/apploader.common.template line 21 at r1 (raw file):

Previously, dimakuv (Dmitrii Kuvaiskii) wrote…

Maybe this should go into another PR that changes GSC_PAL to something more adequate, like GSC_GRAMINE_BINARY which is equal to gramine-sgx, gramine-direct, ...

In this case, this apploader script will end up as a simple:

exec ${GSC_GRAMINE_BINARY:-gramine-sgx} /gramine/app_files/entrypoint \
    {% if insecure_args %}{{ binary_arguments | map('shlex_quote') | join(' ') }} \
    "${@}"{% endif %}

Done, split into #201.

Will need to rebase after #201 is merged.

Currently only Gramine-VM. I'll update with Gramine-TDX in the next
iteration. Need to think how to automatically start socat for
virtio-vsock networking.

Signed-off-by: Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com>
@dimakuv dimakuv force-pushed the dimakuv/support-gramine-tdx branch from e640eb6 to 3aabbd6 Compare October 1, 2024 10:30
Copy link
Author

@dimakuv dimakuv left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 6 files reviewed, all discussions resolved, not enough approvals from maintainers (1 more required), not enough approvals from different teams (1 more required, approved so far: Intel), "WIP" found in commit messages' one-liners


templates/apploader.common.template line 21 at r1 (raw file):

Previously, dimakuv (Dmitrii Kuvaiskii) wrote…

Done, split into #201.

Will need to rebase after #201 is merged.

Done


test/ubuntu22.04-hello-world.dockerfile line 1 at r1 (raw file):

Previously, dimakuv (Dmitrii Kuvaiskii) wrote…

Done, split into #200.

Will need to rebase after #200 is merged.

Done

@dimakuv dimakuv force-pushed the dimakuv/support-gramine-tdx branch from 3aabbd6 to 3b98d51 Compare October 1, 2024 10:34
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.

1 participant