File tree Expand file tree Collapse file tree 8 files changed +72
-33
lines changed
Expand file tree Collapse file tree 8 files changed +72
-33
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,7 @@ CHROME_PORT=9222 # External port mapped in Docker
3030echo "Starting Chromium on internal port $INTERNAL_PORT"
3131DISPLAY=:1 chromium \
3232 --remote-debugging-port=$INTERNAL_PORT \
33- --no-sandbox \
34- --disable-dev-shm-usage \
35- --disable-gpu \
36- --start-maximized \
37- --disable-software-rasterizer \
38- --remote-allow-origins=* \
39- --no-zygote >&2 &
33+ ${CHROMIUM_FLAGS:-} >&2 &
4034
4135echo "Setting up ncat proxy on port $CHROME_PORT"
4236ncat \
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ docker build -t onkernel/kernel-chromium:latest -f containers/docker/Dockerfile
1313## 2. Run the Container
1414
1515``` bash
16- docker run -p 8501:8501 -p 8080:8080 -p 6080:6080 -p 9222:9222 kernel-chromium
16+ docker run -e CHROMIUM_FLAGS= " --no-sandbox --disable-dev-shm-usage --disable-gpu --start-maximized --disable-software-rasterizer --remote-allow-origins=* --no-zygote " - p 8501:8501 -p 8080:8080 -p 6080:6080 -p 9222:9222 kernel-chromium
1717```
1818
1919This exposes three ports:
@@ -24,10 +24,12 @@ This exposes three ports:
2424- ` 8501 ` : Streamlit interfaced used by Computer Use
2525
2626## Live View Configuration
27- You can set the browser width and height with the environment variables ` WIDTH ` and ` HEIGHT ` in the ` docker run ` command:
27+ You can set the browser width and height with the environment variables ` WIDTH ` and ` HEIGHT ` , and control Chromium startup flags with ` CHROMIUM_FLAGS ` in the ` docker run ` command:
2828
2929``` bash
30- docker run -e WIDTH=1920 -e HEIGHT=1080 -p 8501:8501 -p 8080:8080 -p 6080:6080 -p 9222:9222 kernel-chromium
30+ docker run -e WIDTH=1920 -e HEIGHT=1080 \
31+ -e CHROMIUM_FLAGS=" --start-maximized --disable-gpu" \
32+ -p 8501:8501 -p 8080:8080 -p 6080:6080 -p 9222:9222 kernel-chromium
3133```
3234
3335## 👾 Connect via Chrome DevTools Protocol
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # This script MUST be sourced (i.e. use `source start-buildkit.sh`).
4+
5+ # Variable used by KraftKit, hence the requirement for sourcing the script
6+ export KRAFTKIT_BUILDKIT_HOST=docker-container://buildkit
7+
8+ # Install container if not already installed.
9+ docker container inspect buildkit > /dev/null 2>&1
10+ if test $? -eq 0; then
11+ echo " Container 'buildkit' is already installed. Nothing to do."
12+ else
13+ echo " Installing 'buildkit' container ... "
14+ docker run -d --name buildkit --privileged moby/buildkit:latest
15+ return $?
16+ fi
17+
18+ test " $( docker container inspect -f ' {{.State.Running}}' buildkit 2> /dev/null) " = " true"
19+ if test $? -eq 0; then
20+ echo " Container 'buidlkitd' is already running. Nothing to do."
21+ else
22+ echo " Starting 'buildkit' container ... "
23+ docker start buildkit
24+ return $?
25+ fi
Original file line number Diff line number Diff line change @@ -11,8 +11,11 @@ This deploys headful Chromium on a unikernel. It also exposes a remote GUI throu
1111## 2. Add Unikraft Secret to Your CLI
1212` export UKC_METRO=<region> and UKC_TOKEN=<secret> `
1313
14- ## 3. Deploy the Implementation
15- ` ./deploy.sh `
14+ ## 3. Build the image
15+ ` ./build.sh `
16+
17+ ## 4. Run it
18+ ` ./run.sh `
1619
1720When the deployment finishes successfully, the Kraft CLI will print out something like this:
1821```
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # namespace here (onkernel) should match UKC_TOKEN's username
4+ image=" onkernel/kernel-cu-test:latest"
5+
6+ # fail if UKC_TOKEN and UKC_METRO are not set
7+ if [ -z " $UKC_TOKEN " ] || [ -z " $UKC_METRO " ]; then
8+ echo " UKC_TOKEN and UKC_METRO must be set"
9+ exit 1
10+ fi
11+ source ../../shared/start-buildkit.sh
12+
13+ kraft pkg \
14+ --name index.unikraft.io/$image \
15+ --plat kraftcloud --arch x86_64 \
16+ --strategy overwrite \
17+ --push \
18+ .
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ image=" onkernel/kernel-cu-test:latest"
4+ name=" kernel-cu-test"
5+
6+ kraft cloud inst create \
7+ --start
8+ -M 8192 \
9+ -p 443:6080/http+tls \
10+ -p 9222:9222/tls \
11+ -e DISPLAY_NUM=1 \
12+ -e HEIGHT=768 \
13+ -e WIDTH=1024 \
14+ -e HOME=/ \
15+ -e CHROMIUM_FLAGS=" --no-sandbox --disable-dev-shm-usage --disable-gpu --start-maximized --disable-software-rasterizer --remote-allow-origins=* --no-zygote" \
16+ -n " $name " \
17+ $image
Original file line number Diff line number Diff line change @@ -24,13 +24,7 @@ CHROME_PORT=9222 # External port mapped to host
2424echo " Starting Chromium on internal port $INTERNAL_PORT "
2525DISPLAY=:1 chromium \
2626 --remote-debugging-port=$INTERNAL_PORT \
27- --no-sandbox \
28- --disable-dev-shm-usage \
29- --disable-gpu \
30- --start-maximized \
31- --disable-software-rasterizer \
32- --remote-allow-origins=* \
33- --no-zygote >&2 &
27+ ${CHROMIUM_FLAGS:- } >&2 &
3428echo " Setting up ncat proxy on port $CHROME_PORT "
3529ncat \
3630 --sh-exec " ncat 0.0.0.0 $INTERNAL_PORT " \
You can’t perform that action at this time.
0 commit comments