Skip to content

Conversation

@Sayan-
Copy link
Contributor

@Sayan- Sayan- commented Jun 26, 2025

Description

We want to be able to capture the screen for headful use cases. The path we chose to do this is simply:

  1. Create an http server we'll embed into the image. This server will expose a set of endpoints to start, stop, and download recordings
  2. We'll use this interface externally as necessary to capture the screen

For the moment we're encoding semantics that the server will have one "main" recording. I've implemented the rest of the backend without this restriction so it's easy to relax down the line.

Under the hood this uses ffmpeg and expects that binary to be available. In tests running in docker and unikraft cloud the behavior around pause+resume was flaky. Instead of attempting to prevent data loss / corruption I took the strategy of minimizing the damage via ffmpeg fragmentation.

I setup the server using what felt like ~sane defaults. The meat of this PR is in ffmpeg.go. I recommend reviewing this commit by commit

Testing

  • Added units tests where sensible
  • Setup github actions for aforementioned units
  • Performed a number of end to end tests both locally in docker + unikraft cloud using another locally running api to orchestrate the unikernels to replicate normal user workflows for persistent and non-persistent browsers

@Sayan- Sayan- requested a review from rgarcia June 26, 2025 22:20
Copy link
Contributor

@rgarcia rgarcia left a comment

Choose a reason for hiding this comment

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

this is great. I have zero comments to add after reading through it!

I assume next step is figuring out how to incorporate a compiled binary of the server onto our docker / unikernel images?

@Sayan-
Copy link
Contributor Author

Sayan- commented Jun 27, 2025

Yep! I wanted to separate out the meat of implementation from bundling into the images!

@Sayan- Sayan- merged commit e0f4d09 into main Jun 27, 2025
1 check passed
@Sayan- Sayan- deleted the sayan/kernel-26-browser-replay-support branch June 27, 2025 16:47
@Sayan- Sayan- mentioned this pull request Jun 27, 2025
6 tasks
Sayan- added a commit that referenced this pull request Jul 1, 2025
### Description

In #17 we built a new API server. In this PR we integrate it into the container + unikernel image builds. It's off by default and can be turned + configured with env vars

### Testing

- [x] Built docker container
- [x] Ran docker container locally without the server
- [x] Ran docker container locally with `WITH_KERNEL_IMAGES_API=true`. Confirmed the server started up and was able to perform the basic start, stop, down workflow successfully 
- [x] Built unikernel container
- [x] Ran unikernel in the cloud without the server
- [x] Ran unikernel in the cloud with `WITH_KERNEL_IMAGES_API=true`. Confirmed the server started up and was able to perform the basic start, stop, download workflow successfully
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