Skip to content

Commit 0bc7fe7

Browse files
author
hp23 Server
committed
Update README and fix linux demo run
1 parent ae31467 commit 0bc7fe7

File tree

4 files changed

+50
-3
lines changed

4 files changed

+50
-3
lines changed

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,53 @@ This repository is a fork of [WPT](https://github.com/web-platform-tests/wpt), t
66
All test and analysis code for our paper can be found in the [_hp](./_hp/README.md) directory.
77
Our modified version of the wptserve HTTP server implementation can be found in the `tools/serve` and `tools/wptserve` directories. All other directories are untouched and required for `wptserve` to run, we removed the other WPT directories for clarity.
88

9+
The project is made out of 6 parts:
10+
1. Modified WPT server
11+
- Dockerized and works on MacOS and Linux
12+
- Optional: Configure settings: in `docker-compose.yml` and TODO, e.g., setup working certificates
13+
- Start with `(sudo) docker compose up`, this starts a database, configures the HTTP responses, and starts our modified WPT server
14+
- (Optional) Run tests to verify server is setup correctly: `sudo docker compose exec header-testing-server bash -c "poetry run -C _hp pytest /app/_hp"`
15+
- The server is now serving all the tests pages and reponses for our paper. Depending on the configuration the server is now available within and outside the Docker network. E.g., by default it should bind to port 80 and 443 and `curl -I http://localhost/_hp/common/empty.html` and `curl -I -k https://localhost/_hp/common/empty.html` (our dummy certificates are not valid, thus `-k`/insecure is required) on the host should return a response from `BaseHTTP/0.6 Python/3.11.5`
16+
2. (Optional) Analysis scripts
17+
- Dockerized jupyter-lab and works on MacOS and Linux
18+
- Run: `(sudo) docker compose exec header-testing-server bash -c "cd /app/_hp/hp/tools/analysis && poetry run jupyter-lab --allow-root --ip 0.0.0.0"` and access the URL printed on your local browser
19+
- Open `analysis_ae.ipynb` and run it to analyze the browser runs; If none of the test runners were executed yet, no
20+
- The files `analysis_may_2024.ipynb` and `analysis_december_2024.ipynb` contain the full analysis for the original browser run and the updated browser run experiments described in the paper, including the output of the analysis. Re-running them requires access to our originally collected data.
21+
3. (Optional) Test runner for desktop linux browsers
22+
- Dockerized and only work on Linux (issues with the MacOS Linux emulation)
23+
- Run: `(sudo) docker compose exec header-testing-server bash -c "cd /app/_hp/hp/tools/crawler/ && poetry run python desktop_selenium.py --debug_browsers --resp_type debug --ignore_certs"` for a quick check that data can be collected
24+
- This should take around 2-3m
25+
- Check `_hp/hp/tools/crawler/logs/desktop-selenium/` for logs, there should be two rows with `Start chrome (128)` and two with `Finish chrome (128)` and no additional rows. The results of these tests can also be seen in the database or checked with the `analysis_ae.ipynb` script
26+
- Reproduce the basic experiment:
27+
- TODO (copy from below + verify, there are some issues with dockerized setup e.g. `--no-sandbox`?)
28+
- Run `(sudo) docker compose exec header-testing-server bash -c "cd /app/_hp/hp/tools/crawler/ && for i in {1..5}; do poetry run python desktop_selenium.py --num_browsers 50 --resp_type basic --ignore_certs; done"`
29+
- Reproduce the parsing experiment:
30+
- TODO
31+
- Reproduce the updated browser experiment and other notes:
32+
- TODO
33+
- The test runner can be also used outside of the docker container for efficiency:
34+
- Requires `python 3.11.5`, `poetry`, various browser dependencies and if run on a server without a screen `Xvfb` installed. Check `setup.bash` on how to install them (verified to work on Ubuntu 22.04)
35+
- Then install all dependencies: `cd _hp && poetry install`
36+
- Lastly, the modified WPT server needs to be reachable. One option is to modify `/etc/hosts/` to point the required hosts to the docker container (see `_hp/host-config.txt`)
37+
- Then `poetry run python desktop_selenium.py --help` can be used to see all settings of the test runner and then executed as wanted
38+
4. (Optional) Test runner for macOS browser
39+
- Requires access to a macOS device with a display
40+
- The Safari version is bound to the operating system, for an exact reproduction of our results, macOS devices in the correct version are required. To test the test runner on macOS, the used version can be updated in `desktop_selenium.py`
41+
- Requirements: `python=3.11.5`, `poetry` (see `setup.bash`) and access to the modified WPT server
42+
- Install `poetry install`
43+
- Run: TODO, copy from below (some manual steps in Safari are required) (Note: the device is not fully usable during the testing)
44+
5. (Optional) Test runner for iPadOS browser
45+
- Requires access to iPadOS devices (in the correct version)
46+
- Only works in a setup where the server is setup to be reachable from the iPadOS (e.g., via public internet) and the server needs valid certificates
47+
- Run: TODO, copy from below
48+
6. (Optional) Test runner for emulated Android browsers
49+
- Requires access to a linux machine
50+
- TODO: copy from below, install and run
51+
52+
53+
----
54+
Old review below:
55+
956
## Setup and Start the Header Testing Server
1057
- Create a fresh Ubuntu22 container/VM: `lxc launch ubuntu:22.04 <name>` and connect to it `lxc exec <name> bash` (Other environments might also work but are not tested)
1158
- Switch to the ubuntu user: `su - ubuntu`

TODOS.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
- [ ] Move all configs in one place/less places?
55
- [ ] Remove hardcoded stuff
66
- [ ] Test, test, test! + fix bugs/remove manual steps (e.g., brave is currently manually managed?)
7-
- [ ] New readme
87
- [ ] analysis_ae.ipynb basic analysis script that simply works
9-
- [ ] Improve readme/documentation! What is where and so on
8+
- [ ] Improve and update REAMDE! What is where and so on
109
- [ ] Create artifact eval document
1110
- [ ] ...

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ services:
1717

1818
header-testing-server:
1919
platform: linux/amd64 # This is required for running desktop linux browsers; It is possible to run on arm Macs, but it will be slow
20+
shm_size: 2g
2021
build: .
2122
extra_hosts:
2223
- "headers.websec.saarland:0.0.0.0"

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if grep -qi "VirtualApple" /proc/cpuinfo; then
1111
echo "Running under Rosetta emulation – skipping Xvfb"
1212
else
1313
echo "Starting Xvfb and x11vnc available at port 5900 with passwd abc"
14-
rm /tmp/.X99-lock
14+
rm -f /tmp/.X99-lock
1515
Xvfb :99 -screen 0 1920x1080x24 &
1616
# Wait until Xvfb is listening
1717
for i in $(seq 1 20); do

0 commit comments

Comments
 (0)