Skip to content
This repository was archived by the owner on Jun 30, 2021. It is now read-only.

Commit 49b06b5

Browse files
committed
wily-20150829, -e NOVNC=true, supervisor 2015-08-24, pull race condition, grid-hub issues
1 parent 4951102 commit 49b06b5

File tree

7 files changed

+64
-54
lines changed

7 files changed

+64
-54
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ How to get container versions
1919
+ Upgrade supervisor 4.0.0.dev0 from 2015-06-24 commit to 2015-08-24.
2020
+ Fix race condition after docker pull and run the image the first time.
2121
+ Fix SSH_AUTH_KEYS detected issue
22+
+ Fix grid-hub registration issues
2223
+ Image tag details:
2324
+ Selenium: v2.47.1 (411b314)
2425
+ Chrome stable: 45.0.2454.85

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,18 @@ The important part above is `-e CHROME=false -e FIREFOX=false` which tells the d
105105

106106
You can lunch a node only container via environment variables:
107107

108-
docker run --rm --name=node -p=5940:25900 -p=2224:22222 -p=6082:26080 \
109-
-e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" -e VIDEO=true \
110-
-e SELENIUM_HUB_HOST=10.161.128.170 \
111-
-e SELENIUM_HUB_PORT=4444 \
112-
-e SELENIUM_NODE_HOST=10.161.131.6 \
108+
docker run --rm --name=node -p=5940:25900 \
113109
-p 25550:25550 -p 25551:25551 \
110+
-e SELENIUM_HUB_HOST=docker.host \
111+
-e SELENIUM_HUB_PORT=4444 \
112+
-e SELENIUM_NODE_HOST=docker.host \
114113
-e GRID=false -e CHROME=true -e FIREFOX=true \
115-
-v $(pwd)/videos:/videos \
116114
elgalu/selenium:2.47.1j
117115

118116
The important part above is `-e GRID=false` which tells the container to be a node-only node, this this case with 2 browsers `-e CHROME=true -e FIREFOX=true` but could be just 1.
119117

118+
Note `SELENIUM_HUB_HOST` and `SELENIUM_NODE_HOST` represent a network firewall config challenge when running on different machines and should be changed to the proper host names or IP addresses of those.
119+
120120
## Chrome crashed
121121

122122
If your tests crashes in Chrome you may need to increase shm size or simply start your container by sharing `-v /dev/shm:/dev/shm`

READMELeo.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
## Build
22

33
time (docker build -t="elgalu/selenium:2.47.1j" . ;echo $?;beep)
4-
docker run --rm -ti -m 4000M --cpu-quota=0 --name=ch -p=4470:24444 -p=5920:25900 -p=2222:22222 -e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" -v $(pwd)/videos:/videos -e DISABLE_ROLLBACK=true -e VIDEO=true -e MEM_JAVA="1024m" elgalu/selenium:2.47.1j
4+
docker run --rm -ti -m 4000M --cpu-quota=0 --name=grid -p=4470:24444 -p=5920:25900 -p=2222:22222 -e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" -v $(pwd)/videos:/videos -e DISABLE_ROLLBACK=true -e VIDEO=true -e MEM_JAVA="1024m" elgalu/selenium:2.47.1j
5+
6+
Extra nodes
7+
8+
docker run --rm --name=grid -p 4444:24444 -p 5920:25900 -v /dev/shm:/dev/shm -e VNC_PASSWORD=hola elgalu/selenium:2.47.1j
9+
10+
docker run --rm --name=node -p=5940:25900 -e SELENIUM_HUB_HOST=docker.host -e SELENIUM_HUB_PORT=4444 -e SELENIUM_NODE_HOST=docker.host -p 25550:25550 -p 25551:25551 -e GRID=false -e CHROME=true -e FIREFOX=true elgalu/selenium:2.47.1j
511

612
See logs
713

8-
docker exec -ti ch bash -c "ls -lah /var/log/sele/"
14+
docker exec -ti grid bash -c "ls -lah /var/log/sele/"
915

1016
Testing in ssh [email protected]
1117

12-
docker run --rm --name=ch -p=4470:24444 -p=5920:25900 -p=2222:22222 -e SSH_AUTH_KEYS="$(cat ~/.ssh/authorized_keys)" -e VNC_PASSWORD=Hola3 os-registry.stups.zalan.do/tip/selenium:2.47.1j
18+
docker run --rm --name=grid -p=4470:24444 -p=5920:25900 -p=2222:22222 -e SSH_AUTH_KEYS="$(cat ~/.ssh/authorized_keys)" -e VNC_PASSWORD=Hola3 os-registry.stups.zalan.do/tip/selenium:2.47.1j
1319

1420
## Transfer used browser source artifacts to keep them in the cloud
1521

@@ -19,11 +25,11 @@ Testing in ssh [email protected]
1925

2026
List chrome versions via docker exec
2127

22-
docker exec -ti ch bash -c "ls -lah /home/application/chrome-deb/"
28+
docker exec -ti grid bash -c "ls -lah /home/application/chrome-deb/"
2329

2430
List firefox versions via docker exe
2531

26-
docker exec -ti ch bash -c "ls -lah /home/application/firefox-src/ && ls -lah /home/application/selenium/firefox**/firefox/firefox"
32+
docker exec -ti grid bash -c "ls -lah /home/application/firefox-src/ && ls -lah /home/application/selenium/firefox**/firefox/firefox"
2733

2834
## Transfer the other way around
2935

@@ -37,17 +43,17 @@ List firefox versions via docker exe
3743

3844
## Run with shared dir
3945

40-
docker run --rm --name=ch -p=127.0.0.1:4460:24444 -p=127.0.0.1:5910:25900 \
46+
docker run --rm --name=grid -p=127.0.0.1:4460:24444 -p=127.0.0.1:5910:25900 \
4147
-v /e2e/uploads:/e2e/uploads elgalu/selenium:2.47.1j
42-
docker run --rm --name=ch -p=4460:24444 -p=5910:25900 \
48+
docker run --rm --name=grid -p=4460:24444 -p=5910:25900 \
4349
-v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):$(which docker) elgalu/selenium:2.47.1j
4450

4551

4652
docker run --rm --name=ff -p=127.0.0.1:4461:24444 -p=127.0.0.1:5911:25900 -v /e2e/uploads:/e2e/uploads elgalu/selenium:2.47.1j
4753

4854
## Run without shared dir and bind ports to all network interfaces
4955

50-
docker run -d --name=ch -p=0.0.0.0:4444:24444 -p=0.0.0.0:5900:25900 elgalu/selenium:0.1
56+
docker run -d --name=grid -p=0.0.0.0:4444:24444 -p=0.0.0.0:5900:25900 elgalu/selenium:0.1
5157

5258
## Opening tunnels
5359

@@ -66,11 +72,11 @@ List firefox versions via docker exe
6672
## Run without dir and bind to all interfaces
6773
Note anything after the image will be taken as arguments for the cmd/entrypoint
6874

69-
docker run --rm --name=ch -p=0.0.0.0:8813:8484 -p=0.0.0.0:2222:2222 -p=0.0.0.0:4470:24444 -p=0.0.0.0:5920:25900 -e SCREEN_WIDTH=1800 -e SCREEN_HEIGHT=1110 -e VNC_PASSWORD=hola -e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" elgalu/selenium:2.47.1j
75+
docker run --rm --name=grid -p=0.0.0.0:8813:8484 -p=0.0.0.0:2222:2222 -p=0.0.0.0:4470:24444 -p=0.0.0.0:5920:25900 -e SCREEN_WIDTH=1800 -e SCREEN_HEIGHT=1110 -e VNC_PASSWORD=hola -e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" elgalu/selenium:2.47.1j
7076

71-
docker run --rm --name=ch -p=4470:24444 -p=5920:25900 -e VNC_PASSWORD=hola elgalu/selenium:2.47.1j
72-
docker run --rm --name=ch -p=4470:24444 -p=5920:25900 -e VNC_PASSWORD=hola docker.io/elgalu/selenium:2.47.1j
73-
docker run --rm --name=ch -p=0.0.0.0:4470:24444 -p=0.0.0.0:5920:25900 --add-host myserver.dev:172.17.42.1 elgalu/selenium:2.47.1j
77+
docker run --rm --name=grid -p=4470:24444 -p=5920:25900 -e VNC_PASSWORD=hola elgalu/selenium:2.47.1j
78+
docker run --rm --name=grid -p=4470:24444 -p=5920:25900 -e VNC_PASSWORD=hola docker.io/elgalu/selenium:2.47.1j
79+
docker run --rm --name=grid -p=0.0.0.0:4470:24444 -p=0.0.0.0:5920:25900 --add-host myserver.dev:172.17.42.1 elgalu/selenium:2.47.1j
7480

7581
However adding a custom host IP to server-selenium.local (e.g. bsele ssh config) is more work:
7682

scm-source.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"url": "https://github.com/elgalu/docker-selenium",
3-
"revision": "c9161b539f482b234b6651e5ca016d083ce1285c",
3+
"revision": "4951102f2f29de3b4d0b165e3d60315c5a8f77c2",
44
"author": "lgallucci",
55
"status": ""
66
}

selenium-hub/bin/wait-selenium-hub.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ SEL_STATUS_URL="http://localhost:${SELENIUM_HUB_PORT}/wd/hub/status"
55
# Exit immediately if a command exits with a non-zero status
66
set -e
77

8-
if [ "${GRID}" = "true" ]; then
9-
echo "Waiting for Selenium Hub to be ready..."
10-
# This is annoying but json endpoint /wd/hub/status returns different things
11-
# - on grid/hub .status should be 13
12-
# - on node .state should be "success"
13-
while ! curl -s "${SEL_STATUS_URL}" | jq '.status' | grep "13"; do
14-
echo -n '.'
15-
sleep 0.1
16-
done
17-
echo "Done wait-selenium-hub.sh"
18-
else
19-
echo "Won't start selenium node chrome due to GRID env var false"
8+
if [ "${GRID}" != "true" ]; then
9+
echo "Won't start selenium grid due to GRID env var false"
10+
exit 0
2011
fi
12+
13+
echo "Waiting for Selenium Hub to be ready..."
14+
# This is annoying but json endpoint /wd/hub/status returns different things
15+
# - on grid/hub .status should be 13
16+
# - on node .state should be "success"
17+
while ! curl -s "${SEL_STATUS_URL}" | jq '.status' | grep "13"; do
18+
echo -n '.'
19+
sleep 0.1
20+
done
21+
echo "Done wait-selenium-hub.sh"

selenium-node-chrome/bin/wait-selenium-node-chrome.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ SEL_STATUS_URL="http://localhost:${SELENIUM_NODE_CH_PORT}/wd/hub/status"
55
# Exit immediately if a command exits with a non-zero status
66
set -e
77

8-
if [ "${CHROME}" = "true" ]; then
9-
echo "Waiting for Selenium Node Chrome ${CHROME_FLAVOR} to be ready..."
10-
# This is annoying but json endpoint /wd/hub/status returns different things
11-
# - on grid/hub .status should be 13
12-
# - on node .state should be "success"
13-
while ! curl -s "${SEL_STATUS_URL}" | jq '.state' | grep "success"; do
14-
echo -n '.'
15-
sleep 0.1
16-
done
17-
echo "Done wait-selenium-node-chrome-${CHROME_FLAVOR}.sh"
18-
else
8+
if [ "${CHROME}" != "true" ]; then
199
echo "Won't start selenium node chrome due to CHROME env var false"
10+
exit 0
2011
fi
12+
13+
echo "Waiting for Selenium Node Chrome ${CHROME_FLAVOR} to be ready..."
14+
# This is annoying but json endpoint /wd/hub/status returns different things
15+
# - on grid/hub .status should be 13
16+
# - on node .state should be "success"
17+
while ! curl -s "${SEL_STATUS_URL}" | jq '.state' | grep "success"; do
18+
echo -n '.'
19+
sleep 0.1
20+
done
21+
echo "Done wait-selenium-node-chrome-${CHROME_FLAVOR}.sh"

selenium-node-firefox/bin/wait-selenium-node-firefox.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
# Exit immediately if a command exits with a non-zero status
44
set -e
55

6-
if [ "${FIREFOX}" = "true" ]; then
7-
echo "Waiting for Selenium Node Firefox ${FIREFOX_VERSION} to be ready..."
8-
# This is annoying but json endpoint /wd/hub/status returns different things
9-
# - on grid/hub .status should be 13
10-
# - on node .state should be "success"
11-
while ! curl -s "http://localhost:${SELENIUM_NODE_FF_PORT}/wd/hub/status" \
12-
| jq '.state' | grep "success"; do
13-
echo -n '.'
14-
sleep 0.1
15-
done
16-
echo "Done wait-selenium-node-firefox-${FIREFOX_VERSION}"
17-
else
6+
if [ "${FIREFOX}" != "true" ]; then
187
echo "Won't start selenium node firefox due to FIREFOX env var false"
8+
exit 0
199
fi
10+
11+
echo "Waiting for Selenium Node Firefox ${FIREFOX_VERSION} to be ready..."
12+
# This is annoying but json endpoint /wd/hub/status returns different things
13+
# - on grid/hub .status should be 13
14+
# - on node .state should be "success"
15+
while ! curl -s "http://localhost:${SELENIUM_NODE_FF_PORT}/wd/hub/status" \
16+
| jq '.state' | grep "success"; do
17+
echo -n '.'
18+
sleep 0.1
19+
done
20+
echo "Done wait-selenium-node-firefox-${FIREFOX_VERSION}"

0 commit comments

Comments
 (0)