Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 81
Update README to include unikernels#5
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
acb0bad58f54aed34ec0e305c6830936b4c53ce1105336b1fdd2e1920a9abe2dfbc6ccffc56f87c2cca071e8c80679050b7af1c65f640f8d4c9cd9bc456b4647dc239File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -182,3 +182,6 @@ TODO | ||
| # tmp | ||
| infra/tests/* | ||
| # Unikraft | ||
| .unikraft | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,104 +1,80 @@ | ||
| # Kernel Containers | ||
| <p align="center"> | ||
| <img src="static/images/Kernel-Wordmark_Accent.svg" alt="Kernel Logo" width="55%"> | ||
| <br/><br/> | ||
| Deployment-ready browsers. Run 'em anywhere | ||
| <br/><br/> | ||
| </p> | ||
| ## Overview | ||
| <p align="center"> | ||
| <img alt="GitHub License" src="https://img.shields.io/github/license/onkernel/kernel-images"> | ||
| <a href="https://discord.gg/FBrveQRcud"><img src="https://img.shields.io/discord/1342243238748225556?logo=discord&logoColor=white&color=7289DA" alt="Discord"></a> | ||
| <a href="https://x.com/juecd__"><img src="https://img.shields.io/twitter/follow/juecd__" alt="Follow @juecd__"></a> | ||
| <a href="https://x.com/rfgarcia"><img src="https://img.shields.io/twitter/follow/rfgarcia" alt="Follow @rfgarcia"></a> | ||
| </p> | ||
| Kernel provides containerized, ready-to-use Chrome browser environments for agentic workflows that need to access the Internet. `containers/docker/Dockerfile` and `unikernels/unikraft-cu` are the core infra that powers our [hosted services](https://docs.onkernel.com/introduction). | ||
| ## 📜 Table of Contents | ||
| - [Overview](#overview) | ||
| - [Key Features](#key-features) | ||
| - [What You Can Do With It](#what-you-can-do-with-it) | ||
| - [Quickstarts](#quickstarts) | ||
| - [Contributing](#contributing) | ||
| - [License](#license) | ||
| - [Support](#support) | ||
| ### Key Features | ||
| ## 🤙 Overview | ||
| Kernel provides sandboxed, ready-to-use Chrome browser environments for agentic workflows that need to access the Internet. `containers/docker/Dockerfile` and `unikernels/unikraft-cu` are the core infra that powers our hosted services. | ||
| 🌟[__Sign-up for the waitlist__](https://onkernel.com)🌟 | ||
|  | ||
| ### *️⃣ Key Features | ||
| - Pre-configured Chrome browser that Chrome DevTools-based browser frameworks (Playwright, Puppeteer) can connect to | ||
| - GUI access for visual monitoring and remote control | ||
| - Anthropic's [Computer Use](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo) agent loop & chat interface baked in | ||
| ### What You Can Do With It | ||
| ### 💡 What You Can Do With It | ||
| - Run automated browser-based workflows | ||
| - Develop and test AI agents that need web capabilities | ||
| - Develop and test AI agents that use browsers | ||
| - Build custom tools that require controlled browser environments | ||
| ## Quickstart | ||
| ### 1. Build From the Source | ||
| ```bash | ||
| git clone https://github.com/onkernel/kernel-containers.git | ||
| cd kernel-containers | ||
| docker build -t kernel-chromium -f containers/docker/Dockerfile . | ||
| ``` | ||
| ### 2. Run the Container | ||
| ```bash | ||
| docker run -p 8501:8501 -p 8080:8080 -p 6080:6080 -p 9222:9222 kernel-chromium | ||
| ``` | ||
| This exposes three ports: | ||
| - `8080`: Anthropic's Computer Use web application, which includes a chat interface and remote GUI | ||
| - `6080`: NoVNC interface for visual monitoring via browser-based VNC client | ||
| - `9222`: Chrome DevTools Protocol for browser automation via Playwright and Puppeteer | ||
| - `8501`: Streamlit interfaced used by Computer Use | ||
| ### 🛜 Implementation | ||
| ## Connecting to the Browser | ||
| `containers/docker` and `unikernels/unikraft-cu` functionally do the same thing: | ||
| 1. Pull from Anthropic's Computer Use reference implementation | ||
| 2. Install Chromium | ||
| 3. Expose ports so Chrome DevTools-based frameworks (Playwright, Puppeteer) can connect to the instance | ||
| 4. Expose a remote GUI through noVNC | ||
| ### Via Chrome DevTools Protocol | ||
| The unikernel implementation works the same as the Docker-only image but has the additional benefits of running on a unikernel: | ||
| - Automated standby / "sleep mode" when there isn't any network activity (consuming negligible resources when it does) | ||
| - When it goes into standby mode, the unikernel’s state gets snapshotted and can be restored exactly as it was when it went to sleep. This could be useful if you want to reuse a session’s state (browser auth cookies, interact with local files, browser settings, even the exact page and window zoom you were on). | ||
| - Extremely fast cold restarts (<20ms), which could be useful for any application that requires super low latency event handlers. | ||
| You can connect to the browser using any CDP client. | ||
| ## 🚀 Quickstarts | ||
| First, fetch the browser's CDP websocket endpoint: | ||
| - [Unikernel ✨](./unikernels/unikraft-cu/README.md) | ||
| - [Docker](./containers/docker/README.md) | ||
| ```typescript | ||
| const response = await fetch("http://localhost:9222/json/version"); | ||
| if (response.status !== 200) { | ||
| throw new Error( | ||
| `Failed to retrieve browser instance: ${ | ||
| response.statusText | ||
| } ${await response.text()}` | ||
| ); | ||
| } | ||
| const { webSocketDebuggerUrl } = await response.json(); | ||
| ``` | ||
| ## 🧑💻 Demo | ||
| Then, connect a remote Playwright or Puppeteer client to it: | ||
| https://github.com/user-attachments/assets/c62b7ff8-9ba0-4463-9df4-e0dd7f1292ba | ||
| ```typescript | ||
| const browser = await puppeteer.connect({ | ||
| browserWSEndpoint: webSocketDebuggerUrl, | ||
| }); | ||
| ``` | ||
| or: | ||
| ```typescript | ||
| browser = await chromium.connectOverCDP(cdp_ws_url); | ||
| ``` | ||
| ### Via GUI (NoVNC) | ||
| For visual monitoring, access the browser via NoVNC by opening: | ||
| ``` | ||
| http://localhost:6080/vnc.html | ||
| ``` | ||
| ### Via Anthropic Computer Use's Web Application | ||
| For a unified interface that includes Anthropic Computer Use's chat (via Streamlit) plus GUI (via noVNC), visit: | ||
| ``` | ||
| http://localhost:8080 | ||
| ``` | ||
| ## Contributing | ||
| ## 🤝 Contributing | ||
| We welcome contributions to improve this example or add new ones! Please read our [contribution guidelines](./CONTRIBUTING.md) before submitting pull requests. | ||
| ## License | ||
| ## 🫰 License | ||
| See the [LICENSE](./LICENSE) file for details. | ||
| ## Support | ||
| ## 🏄 Support | ||
| For issues, questions, or feedback, please [open an issue](https://github.com/onkernel/kernel-images/issues) on this repository. | ||
| For issues, questions, or feedback, please [open an issue](https://github.com/onkernel/kernel-containers/issues) on this repository. | ||
| To learn more about our hosted services, [join our waitlist](https://onkernel.com) and our [Discord](https://discord.gg/FBrveQRcud). | ||
| To learn more about our hosted services, visit [our docs](https://docs.onkernel.com/introduction) and request an API key on [Discord](https://discord.gg/FBrveQRcud). | ||
|  | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # 🐋 Chromium x Docker | ||
| This Dockerfile extends Anthropic's [Computer Use reference implementation](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo) by: (1) installing headful Chromium (2) Exposing Chromium's port `9222` so Chrome DevTools Protocol-based frameworks (Playwright, Puppeteer) can connect to it. | ||
| ## 1. Build From the Source | ||
| ```bash | ||
| git clone https://github.com/onkernel/kernel-images.git | ||
| cd kernel-images | ||
| docker build -t kernel-chromium -f containers/docker/Dockerfile . | ||
| ``` | ||
| ## 2. Run the Container | ||
| ```bash | ||
| docker run -p 8501:8501 -p 8080:8080 -p 6080:6080 -p 9222:9222 kernel-chromium | ||
| ``` | ||
| This exposes three ports: | ||
| - `8080`: Anthropic's Computer Use web application, which includes a chat interface and remote GUI | ||
| - `6080`: NoVNC interface for visual monitoring via browser-based VNC client | ||
| - `9222`: Chrome DevTools Protocol for browser automation via Playwright and Puppeteer | ||
| - `8501`: Streamlit interfaced used by Computer Use | ||
| ## 👾 Connect via Chrome DevTools Protocol | ||
| We expose port `9222` via ncat, allowing you to connect Chrome DevTools Protocol-based browser frameworks like Playwright and Puppeteer (and CDP-based SDKs like Browser Use). You can use these frameworks to drive the browser in the cloud. | ||
| First, fetch the browser's CDP websocket endpoint: | ||
| ```typescript | ||
| const url = "http://localhost:9222/json/version"; | ||
| const response = await fetch(url); | ||
| if (response.status !== 200) { | ||
| throw new Error( | ||
| `Failed to retrieve browser instance: ${ | ||
| response.statusText | ||
| } ${await response.text()}` | ||
| ); | ||
| } | ||
| const { webSocketDebuggerUrl } = await response.json(); | ||
| ``` | ||
| Then, connect a remote Playwright or Puppeteer client to it: | ||
| ```typescript | ||
| const browser = await puppeteer.connect({ | ||
| browserWSEndpoint: webSocketDebuggerUrl, | ||
| }); | ||
| ``` | ||
| or: | ||
| ```typescript | ||
| const browser = await chromium.connectOverCDP(webSocketDebuggerUrl); | ||
| ``` | ||
| ## 🧑💻 Connect via remote GUI (noVNC) | ||
| For visual monitoring, access the browser via NoVNC by opening: | ||
| ```bash | ||
| http://localhost:6080/vnc.html | ||
| ``` | ||
| ## 🛜 Connect via Anthropic Computer Use's web app | ||
| For a unified interface that includes Anthropic Computer Use's chat (via Streamlit) plus GUI (via noVNC), visit: | ||
| ```bash | ||
| http://localhost:8080 | ||
| ``` | ||
| ## 🤝 License & Contributing | ||
| See [here](/README.md) for license and contributing details. |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps worth sending people to a signup or waitlist link directly, but idk how that will work, so up to you.