-
Notifications
You must be signed in to change notification settings - Fork 5.7k
feat: introduce docker integration #16382
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
Merged
aslushnikov
merged 15 commits into
microsoft:main
from
aslushnikov:introduce-docker-integration
Sep 9, 2022
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c910a9b
feat: introduce docker integration
aslushnikov 7f20c79
jammy -> focal
mxschmitt c18738b
tests
aslushnikov 9009277
address initial batch of comments
aslushnikov dfeeef7
move docker
aslushnikov 0cacf87
split out build script
aslushnikov 5da9e46
add deps
aslushnikov ea1164d
add note on docker desktop
aslushnikov c93f118
wip
aslushnikov 6f4c1ff
fix docker
aslushnikov d86fb3c
fix docker
aslushnikov 0c4b5c4
nicer docker container
aslushnikov 533da87
wip
aslushnikov d629655
address max comments
aslushnikov e01a3ea
rename build.sh into build_docker_image.sh
aslushnikov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| [*] | ||
| ./utilsBundle.ts | ||
| docker/ | ||
| matchers/ | ||
| reporters/ | ||
| third_party/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| export NOVNC_REF='1.3.0' | ||
| export WEBSOCKIFY_REF='0.10.0' | ||
| export DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| # Install FluxBox, VNC & noVNC | ||
| mkdir -p /opt/bin && chmod +x /dev/shm \ | ||
| && apt-get update && apt-get install -y unzip fluxbox x11vnc \ | ||
| && curl -L -o noVNC.zip "https://github.com/novnc/noVNC/archive/v${NOVNC_REF}.zip" \ | ||
| && unzip -x noVNC.zip \ | ||
| && rm -rf noVNC-${NOVNC_REF}/{docs,tests} \ | ||
| && mv noVNC-${NOVNC_REF} /opt/bin/noVNC \ | ||
| && cp /opt/bin/noVNC/vnc.html /opt/bin/noVNC/index.html \ | ||
| && rm noVNC.zip \ | ||
| && curl -L -o websockify.zip "https://github.com/novnc/websockify/archive/v${WEBSOCKIFY_REF}.zip" \ | ||
| && unzip -x websockify.zip \ | ||
| && rm websockify.zip \ | ||
| && rm -rf websockify-${WEBSOCKIFY_REF}/{docs,tests} \ | ||
| && mv websockify-${WEBSOCKIFY_REF} /opt/bin/noVNC/utils/websockify | ||
|
|
||
| # Configure FluxBox menus | ||
| mkdir /root/.fluxbox | ||
| cd /ms-playwright-agent | ||
| cat <<'EOF' | node > /root/.fluxbox/menu | ||
| const { chromium, firefox, webkit } = require('playwright-core'); | ||
|
|
||
| console.log(` | ||
| [begin] (fluxbox) | ||
| [submenu] (Browsers) {} | ||
| [exec] (Chromium) { ${chromium.executablePath()} --no-sandbox --test-type= } <> | ||
| [exec] (Firefox) { ${firefox.executablePath()} } <> | ||
| [exec] (WebKit) { ${webkit.executablePath()} } <> | ||
| [end] | ||
| [include] (/etc/X11/fluxbox/fluxbox-menu) | ||
| [end] | ||
| `); | ||
| EOF | ||
|
|
||
| # Create entrypoint.sh | ||
| cat <<'EOF' > /entrypoint.sh | ||
| #!/bin/bash | ||
| set -e | ||
| SCREEN_WIDTH=1360 | ||
| SCREEN_HEIGHT=1020 | ||
| SCREEN_DEPTH=24 | ||
| SCREEN_DPI=96 | ||
| GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH" | ||
|
|
||
| nohup /usr/bin/xvfb-run --server-num=$DISPLAY_NUM \ | ||
| --listen-tcp \ | ||
| --server-args="-screen 0 "$GEOMETRY" -fbdir /var/tmp -dpi "$SCREEN_DPI" -listen tcp -noreset -ac +extension RANDR" \ | ||
| /usr/bin/fluxbox -display "$DISPLAY" >/dev/null 2>&1 & | ||
|
|
||
| for i in $(seq 1 500); do | ||
| if xdpyinfo -display $DISPLAY >/dev/null 2>&1; then | ||
| break | ||
| fi | ||
| echo "Waiting for Xvfb..." | ||
| sleep 0.2 | ||
| done | ||
|
|
||
| nohup x11vnc -forever -shared -rfbport 5900 -rfbportv6 5900 -display "$DISPLAY" >/dev/null 2>&1 & | ||
| nohup /opt/bin/noVNC/utils/novnc_proxy --listen 7900 --vnc localhost:5900 >/dev/null 2>&1 & | ||
|
|
||
| cd /ms-playwright-agent | ||
|
|
||
| fbsetbg -c /ms-playwright-agent/node_modules/playwright-core/lib/server/chromium/appIcon.png | ||
|
|
||
| NOVNC_UUID=$(cat /proc/sys/kernel/random/uuid) | ||
| echo "novnc is listening on http://127.0.0.1:7900?path=$NOVNC_UUID&resize=scale&autoconnect=1" | ||
|
|
||
| PW_UUID=$(cat /proc/sys/kernel/random/uuid) | ||
| npx playwright run-server --port=5400 --path=/$PW_UUID | ||
| EOF | ||
| chmod 755 /entrypoint.sh |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.