Skip to content

Commit 98b0d2c

Browse files
authored
Merge pull request #10 from BrowserOperator/chore/restructuring
Chore/restructuring
2 parents 355b80a + 9fc7360 commit 98b0d2c

File tree

243 files changed

+36791
-177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+36791
-177
lines changed

.gitmodules

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
[submodule "kernel-images"]
2-
path = kernel-images
2+
path = submodules/kernel-images
33
url = https://github.com/onkernel/kernel-images.git
44

55
[submodule "browser-operator-core"]
6-
path = browser-operator-core
6+
path = submodules/browser-operator-core
77
url = git@github.com:BrowserOperator/browser-operator-core.git
88
shallow = true
9+
10+
[submodule "webarena"]
11+
path = submodules/webarena
12+
url = https://github.com/web-arena-x/webarena.git

CLAUDE.md

Lines changed: 306 additions & 74 deletions
Large diffs are not rendered by default.

Dockerfile.devtools

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,20 @@ FROM devtools-base AS devtools-local
6868

6969
# Copy local changes from browser-operator-core submodule FIRST
7070
# This happens before checking out upstream, so we copy over the upstream code
71-
COPY browser-operator-core/front_end /workspace/devtools/devtools-frontend/front_end
71+
COPY submodules/browser-operator-core/front_end /workspace/devtools/devtools-frontend/front_end
7272
COPY browser-agent-server /workspace/devtools/devtools-frontend/browser-agent-server
7373

7474
WORKDIR /workspace/devtools/devtools-frontend
7575

7676
# Force automated mode
7777
RUN sed -i 's/AUTOMATED_MODE: false/AUTOMATED_MODE: true/' front_end/panels/ai_chat/core/BuildConfig.ts || true
7878

79+
# Force complete regeneration of build files by removing the entire out directory
80+
# This ensures the build system picks up all changes in BUILD.gn files
81+
RUN rm -rf out/Default
82+
7983
# Build Browser Operator version with local changes
80-
# This build is much faster since we're only building the changed files
84+
# This will regenerate all build files from scratch based on the copied BUILD.gn
8185
RUN npm run build
8286

8387
# Create marker file

Dockerfile.kernel-cloud

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ ARG TARGETOS
66
ARG TARGETARCH
77
ENV CGO_ENABLED=0
88

9-
COPY kernel-images/server/go.mod ./
10-
COPY kernel-images/server/go.sum ./
9+
COPY submodules/kernel-images/server/go.mod ./
10+
COPY submodules/kernel-images/server/go.sum ./
1111
RUN go mod download
1212

13-
COPY kernel-images/server/ .
13+
COPY submodules/kernel-images/server/ .
1414
RUN GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} \
1515
go build -ldflags="-s -w" -o /out/kernel-images-api ./cmd/api
1616

1717
# webrtc client
1818
FROM node:22-bullseye-slim AS client
1919
WORKDIR /src
20-
COPY kernel-images/images/chromium-headful/client/package*.json ./
20+
COPY submodules/kernel-images/images/chromium-headful/client/package*.json ./
2121
RUN npm install
22-
COPY kernel-images/images/chromium-headful/client/ .
22+
COPY submodules/kernel-images/images/chromium-headful/client/ .
2323
RUN npm run build
2424

2525
# xorg dependencies
@@ -31,7 +31,7 @@ RUN set -eux; \
3131
apt-get install -y \
3232
git gcc pkgconf autoconf automake libtool make xorg-dev xutils-dev \
3333
&& rm -rf /var/lib/apt/lists/*;
34-
COPY kernel-images/images/chromium-headful/xorg-deps/ /xorg/
34+
COPY submodules/kernel-images/images/chromium-headful/xorg-deps/ /xorg/
3535
# build xf86-video-dummy v0.3.8 with RandR support
3636
RUN set -eux; \
3737
cd xf86-video-dummy/v0.3.8; \
@@ -169,19 +169,19 @@ ENV WIDTH=1024
169169
ENV WITHDOCKER=true
170170
ENV PORT=8080
171171

172-
COPY kernel-images/images/chromium-headful/xorg.conf /etc/neko/xorg.conf
173-
COPY kernel-images/images/chromium-headful/neko.yaml /etc/neko/neko.yaml
172+
COPY submodules/kernel-images/images/chromium-headful/xorg.conf /etc/neko/xorg.conf
173+
COPY submodules/kernel-images/images/chromium-headful/neko.yaml /etc/neko/neko.yaml
174174
COPY --from=neko /usr/bin/neko /usr/bin/neko
175175
COPY --from=client /src/dist/ /var/www
176176
COPY --from=xorg-deps /usr/local/lib/xorg/modules/drivers/dummy_drv.so /usr/lib/xorg/modules/drivers/dummy_drv.so
177177
COPY --from=xorg-deps /usr/local/lib/xorg/modules/input/neko_drv.so /usr/lib/xorg/modules/input/neko_drv.so
178178

179-
COPY kernel-images/images/chromium-headful/image-chromium/ /
180-
COPY kernel-images/images/chromium-headful/start-chromium.sh /images/chromium-headful/start-chromium.sh
179+
COPY submodules/kernel-images/images/chromium-headful/image-chromium/ /
180+
COPY submodules/kernel-images/images/chromium-headful/start-chromium.sh /images/chromium-headful/start-chromium.sh
181181
RUN chmod +x /images/chromium-headful/start-chromium.sh
182-
COPY kernel-images/images/chromium-headful/supervisord.conf /etc/supervisor/supervisord.conf
182+
COPY submodules/kernel-images/images/chromium-headful/supervisord.conf /etc/supervisor/supervisord.conf
183183
COPY supervisord-cloudrun.conf /etc/supervisor/supervisord-cloudrun.conf
184-
COPY kernel-images/images/chromium-headful/supervisor/services/ /etc/supervisor/conf.d/services/
184+
COPY submodules/kernel-images/images/chromium-headful/supervisor/services/ /etc/supervisor/conf.d/services/
185185
# Copy Cloud Run-specific supervisor configs
186186
COPY supervisor-cloudrun/ /etc/supervisor/conf.d/services-cloudrun/
187187
# Copy Cloud Run-specific chromium start script

Readme.md

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,99 @@ Edit `service.yaml` to modify Chrome behavior:
425425
For production WebRTC, configure a TURN server:
426426

427427
```yaml
428-
- name: NEKO_ICESERVERS
428+
- name: NEKO_ICESERVERS
429429
value: '[{"urls": ["turn:turn.example.com:3478"], "username": "user", "credential": "pass"}]'
430430
```
431431

432+
### WebArena Configuration (Optional)
433+
434+
The platform supports running **WebArena benchmark evaluations** against self-hosted test websites. This is completely optional and only needed if you're running WebArena tasks.
435+
436+
#### What is WebArena?
437+
438+
WebArena is a research benchmark with 812 tasks across 7 self-hosted websites (e-commerce, forums, GitLab, Wikipedia, etc.). To run these evaluations, you need to route specific domains to a custom IP address.
439+
440+
#### Quick Setup
441+
442+
**1. Configure environment variables in `evals/.env`:**
443+
444+
```bash
445+
cd evals
446+
cp .env.example .env
447+
vim .env
448+
```
449+
450+
Add:
451+
```bash
452+
# WebArena Infrastructure Configuration
453+
WEBARENA_HOST_IP=172.16.55.59 # IP where WebArena sites are hosted
454+
WEBARENA_NETWORK=172.16.55.0/24 # Network CIDR for routing
455+
456+
# WebArena Site URLs (optional - customize if needed)
457+
SHOPPING=http://onestopmarket.com
458+
SHOPPING_ADMIN=http://onestopmarket.com/admin
459+
REDDIT=http://reddit.com
460+
GITLAB=http://gitlab.com
461+
WIKIPEDIA=http://wikipedia.org
462+
```
463+
464+
**2. Start container (configuration is auto-loaded):**
465+
466+
```bash
467+
make compose-up # OR make run
468+
```
469+
470+
**3. Verify WebArena routing is enabled:**
471+
472+
```bash
473+
docker logs kernel-browser-extended | grep -i webarena
474+
```
475+
476+
You should see:
477+
```
478+
🌐 [init] Configuring WebArena DNS mapping to 172.16.55.59...
479+
🌐 [init] Adding route to 172.16.55.0/24 via 172.17.0.1...
480+
```
481+
482+
**4. Run WebArena evaluations:**
483+
484+
```bash
485+
cd evals
486+
python3 run_webarena.py --task-id 1 --verbose
487+
```
488+
489+
#### How It Works
490+
491+
When `WEBARENA_HOST_IP` is set:
492+
- **DNS Mapping**: Chromium routes WebArena domains (gitlab.com, reddit.com, etc.) to your specified IP
493+
- **Network Routing**: Container adds route to reach the WebArena network
494+
- **Automatic**: Configuration happens on container startup via `scripts/init-container.sh`
495+
496+
Without configuration (default):
497+
- System works normally with standard DNS resolution
498+
- WebArena routing is completely disabled
499+
- No impact on regular browser automation
500+
501+
#### Deployment-Specific IPs
502+
503+
You can use different IP addresses for different environments:
504+
505+
```bash
506+
# Local development
507+
WEBARENA_HOST_IP=172.16.55.59
508+
WEBARENA_NETWORK=172.16.55.0/24
509+
510+
# Cloud deployment
511+
WEBARENA_HOST_IP=34.123.45.67
512+
WEBARENA_NETWORK=34.123.45.0/24
513+
514+
# Disable WebArena (default)
515+
WEBARENA_HOST_IP=
516+
WEBARENA_NETWORK=
517+
```
518+
519+
**See `CLAUDE.md` for detailed WebArena configuration documentation.**
520+
432521
## 📁 Project Structure
433522

434523
```

browser-operator-core

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.
File renamed without changes.

Dockerfile.cloudrun renamed to deployments/cloudrun/Dockerfile

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,20 @@ ARG TARGETOS
7070
ARG TARGETARCH
7171
ENV CGO_ENABLED=0
7272

73-
COPY kernel-images/server/go.mod ./
74-
COPY kernel-images/server/go.sum ./
73+
COPY submodules/kernel-images/server/go.mod ./
74+
COPY submodules/kernel-images/server/go.sum ./
7575
RUN go mod download
7676

77-
COPY kernel-images/server/ .
77+
COPY submodules/kernel-images/server/ .
7878
RUN GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} \
7979
go build -ldflags="-s -w" -o /out/kernel-images-api ./cmd/api
8080

8181
# WebRTC client build
8282
FROM node:22-bullseye-slim AS client
8383
WORKDIR /src
84-
COPY kernel-images/images/chromium-headful/client/package*.json ./
84+
COPY submodules/kernel-images/images/chromium-headful/client/package*.json ./
8585
RUN npm install
86-
COPY kernel-images/images/chromium-headful/client/ .
86+
COPY submodules/kernel-images/images/chromium-headful/client/ .
8787
RUN npm run build
8888

8989
# Xorg dependencies
@@ -95,7 +95,7 @@ RUN set -eux; \
9595
apt-get install -y \
9696
git gcc pkgconf autoconf automake libtool make xorg-dev xutils-dev \
9797
&& rm -rf /var/lib/apt/lists/*;
98-
COPY kernel-images/images/chromium-headful/xorg-deps/ /xorg/
98+
COPY submodules/kernel-images/images/chromium-headful/xorg-deps/ /xorg/
9999
# build xf86-video-dummy v0.3.8 with RandR support
100100
RUN set -eux; \
101101
cd xf86-video-dummy/v0.3.8; \
@@ -248,19 +248,22 @@ ENV WITHDOCKER=true
248248
ENV PORT=8080
249249

250250
# Copy configurations
251-
COPY kernel-images/images/chromium-headful/xorg.conf /etc/neko/xorg.conf
252-
COPY kernel-images/images/chromium-headful/neko.yaml /etc/neko/neko.yaml
251+
COPY submodules/kernel-images/images/chromium-headful/xorg.conf /etc/neko/xorg.conf
252+
COPY submodules/kernel-images/images/chromium-headful/neko.yaml /etc/neko/neko.yaml
253253
COPY --from=neko /usr/bin/neko /usr/bin/neko
254254
COPY --from=client /src/dist/ /var/www
255255
COPY --from=xorg-deps /usr/local/lib/xorg/modules/drivers/dummy_drv.so /usr/lib/xorg/modules/drivers/dummy_drv.so
256256
COPY --from=xorg-deps /usr/local/lib/xorg/modules/input/neko_drv.so /usr/lib/xorg/modules/input/neko_drv.so
257257

258-
COPY kernel-images/images/chromium-headful/image-chromium/ /
259-
COPY kernel-images/images/chromium-headful/start-chromium.sh /images/chromium-headful/start-chromium.sh
258+
COPY submodules/kernel-images/images/chromium-headful/image-chromium/ /
259+
260+
# Copy custom start-chromium.sh with patches
261+
COPY deployments/cloudrun/scripts/start-chromium.sh /images/chromium-headful/start-chromium.sh
260262
RUN chmod +x /images/chromium-headful/start-chromium.sh
261-
COPY kernel-images/images/chromium-headful/supervisord.conf /etc/supervisor/supervisord.conf
263+
264+
COPY submodules/kernel-images/images/chromium-headful/supervisord.conf /etc/supervisor/supervisord.conf
262265
COPY deployment/cloudrun/supervisord-cloudrun.conf /etc/supervisor/supervisord-cloudrun.conf
263-
COPY kernel-images/images/chromium-headful/supervisor/services/ /etc/supervisor/conf.d/services/
266+
COPY submodules/kernel-images/images/chromium-headful/supervisor/services/ /etc/supervisor/conf.d/services/
264267

265268
# Copy the kernel-images API binary
266269
COPY --from=server-builder /out/kernel-images-api /usr/local/bin/kernel-images-api
File renamed without changes.

0 commit comments

Comments
 (0)