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

feat(cmd/rofl): Add support for building TDX ROFL apps #298

Merged
merged 3 commits into from
Nov 29, 2024

Conversation

kostko
Copy link
Member

@kostko kostko commented Oct 3, 2024

No description provided.

@kostko kostko added the rofl ROFL related CLI issues label Oct 3, 2024
@kostko kostko self-assigned this Oct 3, 2024
Copy link

netlify bot commented Oct 3, 2024

Deploy Preview for oasisprotocol-cli ready!

Name Link
🔨 Latest commit e872c86
🔍 Latest deploy log https://app.netlify.com/sites/oasisprotocol-cli/deploys/67459e6308a26700089e9574
😎 Deploy Preview https://deploy-preview-298--oasisprotocol-cli.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kostko kostko force-pushed the kostko/feature/rofl-tdx branch 8 times, most recently from e6e597e to 8bbcd58 Compare October 21, 2024 12:07
@kostko kostko force-pushed the kostko/feature/rofl-tdx branch from 8bbcd58 to 01e0f4e Compare October 25, 2024 07:20
@kostko kostko force-pushed the kostko/feature/rofl-tdx branch 3 times, most recently from 9f90623 to 45d7161 Compare November 13, 2024 14:48
@kostko
Copy link
Member Author

kostko commented Nov 13, 2024

This can now reproduce our measurements for up to 16 vCPUs on QEMU.

@kostko kostko marked this pull request as ready for review November 13, 2024 14:49
@kostko kostko requested review from matevz, abukosek and ptrus November 13, 2024 14:49
@kostko
Copy link
Member Author

kostko commented Nov 13, 2024

It would be great if we could deterministically compile the ACPI tables, but my brief experiments with ASL did not help. So we are using per-CPU templates for now.

@kostko kostko force-pushed the kostko/feature/rofl-tdx branch 7 times, most recently from b091590 to daa5450 Compare November 15, 2024 09:54
return 0, err
}
fsSize /= 1024 // Convert to kilobytes.
fsSize = (fsSize * 150) / 100 // Scale by overhead factor of 1.5.
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the typical size of the generated filesystems that you've tried so far?

Also, might be a good idea to add a check to make sure that fn is not an existing block device, so we don't accidentally trash a user's drive :)
(Currently, in the only place this function is called, the filename is hardcoded to rootfs.ext4, so it's not a problem, but it might be a problem in the future if we maybe have configurable filenames 🤷‍♂️)

@kostko kostko force-pushed the kostko/feature/rofl-tdx branch from daa5450 to bda979f Compare November 15, 2024 11:02
@kostko kostko force-pushed the kostko/feature/rofl-tdx branch 2 times, most recently from ac69443 to 3e4ca2c Compare November 15, 2024 11:08
Copy link
Member

@matevz matevz left a comment

Choose a reason for hiding this comment

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

Following the existing tutorial and running oasis rofl build tdx --mode unsafe compiled the ROFL, but when it tried to pack it, I got

[built] path+file:///home/oa/rofl-oracle#0.1.0
Preparing stage 2 root filesystem...
Unpacking template...
Adding runtime as init...
Creating ext4 filesystem...
Error: failed to create rootfs image: exit status 1

Do I need to install additional dependencies? No other errors seem to be reported.

@kostko
Copy link
Member Author

kostko commented Nov 16, 2024

Yes, let me add some checks whether the required tools exist.

@kostko kostko force-pushed the kostko/feature/rofl-tdx branch 8 times, most recently from 58fc579 to 362edf3 Compare November 20, 2024 11:34
@kostko kostko force-pushed the kostko/feature/rofl-tdx branch from 362edf3 to e872c86 Compare November 26, 2024 10:09
Copy link
Member

@matevz matevz left a comment

Choose a reason for hiding this comment

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

Nice! I can confirm that this actually produces a working tdx orc file.

@kostko kostko merged commit 6b5aefb into master Nov 29, 2024
4 checks passed
@kostko kostko deleted the kostko/feature/rofl-tdx branch November 29, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rofl ROFL related CLI issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants