GitHub - hyperlight-dev/hyperlight-kubeconNA2024-demo (original) (raw)
Hyperlight KubeCon NA 2024 Demo
This repo houses the code for the demo we will be presenting during our keynote at KubeCon NA 2024.
Project Structure
.
├── Cargo.lock
├── Cargo.toml
├── README.md
├── demo-guest
├── demo-main
├── puml
└── target
demo-guest
:x86_64-unknown-none
native Hyperlight guest application.demo-main
: HTTP server using Hyperlight's host SDK.
demo-guest
Hyperlight executes arbitrary code safely and quickly. It does that by booting up an OS-less VM that executes functions.
demo-guest
exports two guest functions:PrintOutput
, andDereferenceRawNullPointer
.
Note: OS-less VMs cannot make any syscalls, so we escape the VM to make host function calls to, say, print to standard output.
demo-main
How to run?
How to debug?
To spawn a Hyperlight VM and attach a debugger to it, you:
- Start a devcontainer
- Run the demo with the
gdb
feature:
cd demo-main
cargo run --features gdb
- Open a separate terminal and send an HTTP request to the demo server to spawn a cold Hyperlight VM:
curl http://localhost:3030/hyperlight/hello-world/cold
- Attach a debugger to the spawned VM by using one of the
Run and Debug
configurations in your VSCode editor:
Remote LLDB attach
Remote GDB attach
- Enjoy debugging!