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

Commit cd82e51

Browse files
committed
Add node -proxy customization via SELENIUM_NODE_PROXY_PARAMS
1 parent e4a900a commit cd82e51

File tree

9 files changed

+90
-24
lines changed

9 files changed

+90
-24
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,30 @@ Note image ids also change after scm-source.json has being updated which trigger
77
###### To get container versions
88
docker exec grid versions
99

10+
## TBD_DOCKER_TAG
11+
+ Date: TBD_DATE
12+
+ Add node -proxy customization via SELENIUM_NODE_PROXY_PARAMS
13+
+ Image tag details:
14+
+ Selenium: vTBD_SELENIUM_VERSION (TBD_SELENIUM_REVISION)
15+
+ Chrome stable: TBD_CHROME_STABLE
16+
+ Firefox stable: TBD_FIREFOX_STABLE
17+
+ Chromedriver: TBD_CHROME_DRIVER (TBD_CHROMEDRIVER_COMMIT)
18+
+ Java: TBD_JAVA_VENDOR Java TBD_JAVA_BUILD
19+
+ Timezone: TBD_TIME_ZONE
20+
+ FROM ubuntu:UBUNTU_FLAVOR-UBUNTU_DATE
21+
+ Python: TBD_PYTHON_VERSION
22+
+ Sauce Connect TBD_SAUCE_CONNECT_VERS, build TBD_SAUCE_CONNECT_BUILD TBD_SAUCE_CONNECT_REVISION
23+
+ BrowserStack Local version TBD_BROWSER_STACK_VERSION
24+
+ Tested on kernel dev host: 4.4.0-29-generic x86_64
25+
+ Tested on kernel CI host: TBD_HOST_UNAME
26+
+ Built at dev host with: Docker version 1.11.2, build b9f10c9
27+
+ Built at CI host with: Docker version TBD_DOCKER_VERS, build TBD_DOCKER_BUILD
28+
+ Built at dev host with: Docker Compose version 1.7.1, build 0a9ab35
29+
+ Built at CI host with: Docker Compose version TBD_DOCKER_COMPOSE_VERS, build TBD_DOCKER_COMPOSE_BUILD
30+
+ Image size: TBD_IMAGE_SIZE
31+
+ Digest: TBD_DIGEST
32+
+ Image ID: TBD_IMAGE_ID
33+
1034
## 2.53.1b
1135
+ Date: 2016-07-01
1236
+ Fix race conditions while using many nodes with docker-compose

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ For pull requests or local commits:
88
open ./images/grid_console.png #to verify the versions are correct
99
git checkout ./images/grid_console.png && open ./videos/chrome/test.mkv
1010
travis lint #if you changed .travis.yml
11-
git checkout -b tmp-2.53.1b #name your branch according to your changes
11+
git checkout -b tmp-2.53.1c #name your branch according to your changes
1212
#git add ... git commit ... git push ... open pull request
1313

1414
For repository owners only:
1515

16-
git commit -m "Fix race conditions while using many nodes with docker-compose"
16+
git commit -m "Add node -proxy customization via SELENIUM_NODE_PROXY_PARAMS"
1717
git tag -d latest #tag latest will be updated from TravisCI
18-
git tag 2.53.1b && git push origin tmp-2.53.1b && git push --tags
18+
git tag 2.53.1c && git push origin tmp-2.53.1c && git push --tags
1919

2020
-- Wait for Travis to pass OK
2121
-- Make sure changes got merged into master by elgalubot
2222

23-
git checkout master && git pull && git branch -d tmp-2.53.1b && git push origin --delete tmp-2.53.1b
23+
git checkout master && git pull && git branch -d tmp-2.53.1c && git push origin --delete tmp-2.53.1c
2424

2525
-- Re-add TBD_* section in CHANGELOG.md starting with TBD_DOCKER_TAG
2626
-- Upgrade release tag in github.com with latest CHANGELOG.md
@@ -37,9 +37,9 @@ Keep certain bins if chrome version changed for example:
3737
## Retry
3838
Failed in Travis? retry
3939

40-
git tag -d 2.53.1b && git push origin :2.53.1b
40+
git tag -d 2.53.1c && git push origin :2.53.1c
4141
#git add ...
42-
git commit --amend && git tag 2.53.1b && git push --force origin tmp-2.53.1b && git push --tags
42+
git commit --amend && git tag 2.53.1c && git push --force origin tmp-2.53.1c && git push --tags
4343

4444
## Docker push from Travis CI
4545
Travis [steps](https://docs.travis-ci.com/user/docker/#Pushing-a-Docker-Image-to-a-Registry) involve `docker login` and docker credentials encryptions.

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,7 @@ ENV FIREFOX_VERSION="${FF_VER}" \
963963
# Selenium additional params:
964964
SELENIUM_HUB_PARAMS="" \
965965
SELENIUM_NODE_PARAMS="" \
966+
SELENIUM_NODE_PROXY_PARAMS="" \
966967
# To taggle issue #58 see https://goo.gl/fz6RTu
967968
CHROME_ARGS="--no-sandbox" \
968969
# e.g. CHROME_ARGS="--no-sandbox --ignore-certificate-errors" \

bin/entry.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ elif [ "${PICK_ALL_RANDMON_PORTS}" = "true" ]; then
170170
fi
171171
fi
172172

173+
if [[ "${SELENIUM_NODE_PROXY_PARAMS}" != "" ]]; then
174+
CUSTOM_SELENIUM_NODE_PROXY_PARAMS="-proxy ${SELENIUM_NODE_PROXY_PARAMS}"
175+
fi
176+
173177
#----------------------------------------
174178
# Remove lock files, thanks @garagepoort
175179
# clear_x_locks.sh

docs/docker-compose.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Either clone this repository or download the file [docker-compose.yml](../docker
1010
wget -nv "https://raw.githubusercontent.com/elgalu/docker-selenium/master/docker-compose.yml"
1111

1212
### Run
13-
Either start with `docker-compose up` and `scale` later or scale directly and run in daemon mode:
13+
Either start with `docker-compose ... scale` as shown in below example or you can also use `docker-compose up` and scale after in a second command.
1414

1515
SELENIUM_HUB_PORT=4444 docker-compose -p selenium scale hub=1 chrome=3 firefox=3
1616

misc/misc.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ Miscellaneous internal notes, do not read!
22

33
## Build
44

5-
time (docker build -t elgalu/selenium:local . ;echo $?;beep)
6-
docker run --rm -ti -m 3000M --name=local -p=4444:24444 -p=5900:25900 -e VIDEO=true -v /dev/shm:/dev/shm elgalu/selenium:local
5+
time (docker build -t elgalu/selenium . ;echo $?;beep)
6+
docker run --rm -ti -m 3000M --name=local -p=4444:24444 -p=5900:25900 -e VIDEO=true -v /dev/shm:/dev/shm elgalu/selenium
77

88
### Wait
99
Wait and get versions
@@ -25,9 +25,9 @@ Push setup, first time only:
2525

2626
Build a grid with extra nodes
2727

28-
docker run --rm --name=local -p 4444:24444 -p 5900:25900 -v /dev/shm:/dev/shm -e VNC_PASSWORD=hola elgalu/selenium:local
28+
docker run --rm --name=local -p 4444:24444 -p 5900:25900 -v /dev/shm:/dev/shm -e VNC_PASSWORD=hola elgalu/selenium
2929

30-
docker run --rm --name=node -e DISP_N=13 -e SSHD_PORT=22223 -e SUPERVISOR_HTTP_PORT=29003 -e VNC_PORT=25903 -e SELENIUM_NODE_CH_PORT=25330 -e SELENIUM_NODE_FF_PORT=25331 -e GRID=false -e CHROME=true -e FIREFOX=true --net=container:local elgalu/selenium:local
30+
docker run --rm --name=node -e DISP_N=13 -e SSHD_PORT=22223 -e SUPERVISOR_HTTP_PORT=29003 -e VNC_PORT=25903 -e SELENIUM_NODE_CH_PORT=25330 -e SELENIUM_NODE_FF_PORT=25331 -e GRID=false -e CHROME=true -e FIREFOX=true --net=container elgalu/selenium
3131

3232
See logs
3333

@@ -54,18 +54,18 @@ List firefox versions via docker exe
5454

5555
## To update image id and digest
5656

57-
docker inspect -f='{{.Id}}' elgalu/selenium:local
57+
docker inspect -f='{{.Id}}' elgalu/selenium
5858
docker images --digests
5959

6060
## Run with shared dir
6161

6262
docker run --rm --name=local -p=127.0.0.1:4460:24444 -p=127.0.0.1:5910:25900 \
63-
-v /e2e/uploads:/e2e/uploads elgalu/selenium:local
63+
-v /e2e/uploads:/e2e/uploads elgalu/selenium
6464
docker run --rm --name=local -p=4460:24444 -p=5910:25900 \
65-
-v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):$(which docker) elgalu/selenium:local
65+
-v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):$(which docker) elgalu/selenium
6666

6767

68-
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:local
68+
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
6969

7070
## Run without shared dir and bind ports to all network interfaces
7171

@@ -88,11 +88,11 @@ List firefox versions via docker exe
8888
## Run without dir and bind to all interfaces
8989
Note anything after the image will be taken as arguments for the cmd/entrypoint
9090

91-
docker run --rm --name=local -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:5900:25900 -e SCREEN_WIDTH=1800 -e SCREEN_HEIGHT=1110 -e VNC_PASSWORD=hola -e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" elgalu/selenium:local
91+
docker run --rm --name=local -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:5900:25900 -e SCREEN_WIDTH=1800 -e SCREEN_HEIGHT=1110 -e VNC_PASSWORD=hola -e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" elgalu/selenium
9292

93-
docker run --rm --name=local -p=4470:24444 -p=5900:25900 -e VNC_PASSWORD=hola elgalu/selenium:local
94-
docker run --rm --name=local -p=4470:24444 -p=5900:25900 -e VNC_PASSWORD=hola docker.io/elgalu/selenium:local
95-
docker run --rm --name=local -p=0.0.0.0:4470:24444 -p=0.0.0.0:5900:25900 --add-host myserver.dev:172.17.42.1 elgalu/selenium:local
93+
docker run --rm --name=local -p=4470:24444 -p=5900:25900 -e VNC_PASSWORD=hola elgalu/selenium
94+
docker run --rm --name=local -p=4470:24444 -p=5900:25900 -e VNC_PASSWORD=hola docker.io/elgalu/selenium
95+
docker run --rm --name=local -p=0.0.0.0:4470:24444 -p=0.0.0.0:5900:25900 --add-host myserver.dev:172.17.42.1 elgalu/selenium
9696

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

@@ -101,18 +101,18 @@ However adding a custom host IP to server-selenium.local (e.g. bsele ssh config)
101101

102102
vncv localhost:5900 -Scaling=60% &
103103

104-
docker run --rm --name=ff -p=0.0.0.0:4471:24444 -p=0.0.0.0:5921:25900 elgalu/selenium:local
104+
docker run --rm --name=ff -p=0.0.0.0:4471:24444 -p=0.0.0.0:5921:25900 elgalu/selenium
105105

106106
Automatic builds not working for me right now, maybe there is an issue with docker registry v1 vs v2
107107
https://registry.hub.docker.com/u/elgalu/docker-selenium/builds_history/31621/
108108

109109
## Pulling
110110

111-
docker pull registry.hub.docker.com/elgalu/selenium:local
111+
docker pull registry.hub.docker.com/elgalu/selenium
112112

113113
## Pull
114114

115-
docker run -d --name=max -p=0.0.0.0:4411:24444 -p=0.0.0.0:5911:25900 elgalu/selenium:local
115+
docker run -d --name=max -p=0.0.0.0:4411:24444 -p=0.0.0.0:5911:25900 elgalu/selenium
116116

117117
How to connect through vnc (need a vnc client)
118118

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ java ${JAVA_OPTS} \
2626
-cleanUpCycle ${SEL_CLEANUPCYCLE_MS} \
2727
-nodePolling ${SEL_NODEPOLLING_MS} \
2828
-Dwebdriver.chrome.driver="${SEL_HOME}/chromedriver" \
29-
${SELENIUM_NODE_PARAMS}
29+
${SELENIUM_NODE_PARAMS} \
30+
${CUSTOM_SELENIUM_NODE_PROXY_PARAMS}
3031

3132
# Note to double pipe output and keep this process logs add at the end:
3233
# 2>&1 | tee $SELENIUM_LOG

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ java ${JAVA_OPTS} \
2626
-browserTimeout ${SEL_BROWSER_TIMEOUT_SECS} \
2727
-cleanUpCycle ${SEL_CLEANUPCYCLE_MS} \
2828
-nodePolling ${SEL_NODEPOLLING_MS} \
29-
${SELENIUM_NODE_PARAMS}
29+
${SELENIUM_NODE_PARAMS} \
30+
${CUSTOM_SELENIUM_NODE_PROXY_PARAMS}
3031

3132
# Note to double pipe output and keep this process logs add at the end:
3233
# 2>&1 | tee $SELENIUM_LOG

test/before_install_docker_linux

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
3+
# set -e: exit asap if a command exits with a non-zero status
4+
# set -x: print each command right before it is executed
5+
set -xe
6+
7+
# cleanup
8+
service docker stop || true
9+
rm -f /etc/apt/sources.list.d/docker.list
10+
apt-get -qqy purge lxc-docker || true
11+
apt-get -qqy purge docker-engine || true
12+
/etc/init.d/apparmor stop || true
13+
rm -rf /var/lib/docker /dev/mapper/docker* /usr/bin/docker /run/docker /etc/docker
14+
rm -rf /etc/apt/sources.list.d/docker* /etc/default/docker /etc/init.d/docker /etc/apparmor.d/cache/docker
15+
rm -rf /etc/apparmor.d/docker /etc/bash_completion.d/docker /var/log/upstart/docker*
16+
rm -rf /var/lib/apt/lists/*docker* /var/lib/dpkg/info/*docker* /dev/disk/by-id/*docker*
17+
rm -rf /var/cache/apt/archives/docker*
18+
19+
# install
20+
CODE_NAME=$(lsb_release -sc) #e.g. trusty
21+
[ "${CODE_NAME}" == "" ] && CODE_NAME=trusty
22+
echo "deb https://apt.dockerproject.org/repo ubuntu-${CODE_NAME} main" >> /etc/apt/sources.list.d/docker.list
23+
# sed -i.bak '/docker/d' /etc/apt/sources.list.d/docker.list
24+
apt-get -qqy update
25+
apt-get -qqy install apt-transport-https ca-certificates
26+
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
27+
apt-cache policy docker-engine || true
28+
apt-get -qqy install linux-image-extra-$(uname -r)
29+
apt-get -qqy install apparmor
30+
/etc/init.d/apparmor start || true
31+
export DEBCONF_NONINTERACTIVE_SEEN=true
32+
apt-get -qqy install docker-engine
33+
service docker start || true
34+
35+
docker --version

0 commit comments

Comments
 (0)