Skip to content

Commit da26d7c

Browse files
author
Thomas Parikka
committed
Updated Dockerfile.txt and generate_config for Hub, NodeBase, NodeChrome, NodeFirefox.
1 parent 2b6bf9c commit da26d7c

18 files changed

+103
-61
lines changed

Hub/Dockerfile

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,20 @@ MAINTAINER Selenium <[email protected]>
1111

1212
EXPOSE 4444
1313

14-
ENV GRID_THROW_ON_CAPABILITY_NOT_PRESENT true
15-
# In milliseconds
14+
# As integer, maps to "maxSession"
15+
ENV GRID_MAX_SESSION 5
16+
# In milliseconds, maps to "newSessionWaitTimeout"
1617
ENV GRID_NEW_SESSION_WAIT_TIMEOUT -1
18+
# As a boolean, maps to "throwOnCapabilityNotPresent"
19+
ENV GRID_THROW_ON_CAPABILITY_NOT_PRESENT true
20+
# As an integer
1721
ENV GRID_JETTY_MAX_THREADS -1
18-
# In milliseconds
19-
ENV GRID_NODE_POLLING 5000
20-
# In milliseconds
22+
# In milliseconds, maps to "cleanUpCycle"
2123
ENV GRID_CLEAN_UP_CYCLE 5000
22-
# In seconds
23-
ENV GRID_TIMEOUT 30
24-
# In seconds
24+
# In seconds, maps to "browserTimeout"
2525
ENV GRID_BROWSER_TIMEOUT 0
26-
ENV GRID_MAX_SESSION 5
27-
# In milliseconds
28-
ENV GRID_UNREGISTER_IF_STILL_DOWN_AFTER 30000
26+
# In seconds, maps to "timeout"
27+
ENV GRID_TIMEOUT 30
2928

3029
COPY generate_config /opt/selenium/generate_config
3130
COPY entry_point.sh /opt/bin/entry_point.sh
@@ -34,5 +33,4 @@ RUN chown -R seluser /opt/selenium
3433

3534
USER seluser
3635

37-
CMD ["/opt/bin/entry_point.sh"]
38-
36+
CMD ["/opt/bin/entry_point.sh"]

Hub/Dockerfile.txt

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@ MAINTAINER Selenium <[email protected]>
66

77
EXPOSE 4444
88

9-
ENV GRID_THROW_ON_CAPABILITY_NOT_PRESENT true
10-
# In milliseconds
9+
# As integer, maps to "maxSession"
10+
ENV GRID_MAX_SESSION 5
11+
# In milliseconds, maps to "newSessionWaitTimeout"
1112
ENV GRID_NEW_SESSION_WAIT_TIMEOUT -1
13+
# As a boolean, maps to "throwOnCapabilityNotPresent"
14+
ENV GRID_THROW_ON_CAPABILITY_NOT_PRESENT true
15+
# As an integer
1216
ENV GRID_JETTY_MAX_THREADS -1
13-
# In milliseconds
14-
ENV GRID_NODE_POLLING 5000
15-
# In milliseconds
17+
# In milliseconds, maps to "cleanUpCycle"
1618
ENV GRID_CLEAN_UP_CYCLE 5000
17-
# In seconds
18-
ENV GRID_TIMEOUT 30
19-
# In seconds
19+
# In seconds, maps to "browserTimeout"
2020
ENV GRID_BROWSER_TIMEOUT 0
21-
ENV GRID_MAX_SESSION 5
22-
# In milliseconds
23-
ENV GRID_UNREGISTER_IF_STILL_DOWN_AFTER 30000
21+
# In seconds, maps to "timeout"
22+
ENV GRID_TIMEOUT 30
2423

2524
COPY generate_config /opt/selenium/generate_config
2625
COPY entry_point.sh /opt/bin/entry_point.sh
@@ -29,5 +28,4 @@ RUN chown -R seluser /opt/selenium
2928

3029
USER seluser
3130

32-
CMD ["/opt/bin/entry_point.sh"]
33-
31+
CMD ["/opt/bin/entry_point.sh"]

Hub/entry_point.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@ java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
2626
NODE_PID=$!
2727

2828
trap shutdown SIGTERM SIGINT
29-
wait $NODE_PID
30-
29+
wait $NODE_PID

Hub/generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> ./Dockerfile
66
echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> ./Dockerfile
77
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ./Dockerfile
88
echo FROM selenium/base:$VERSION >> ./Dockerfile
9-
cat ./Dockerfile.txt >> ./Dockerfile
9+
cat ./Dockerfile.txt >> ./Dockerfile

Hub/generate_config

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@ echo "
44
{
55
\"host\": null,
66
\"port\": 4444,
7-
\"prioritizer\": null,
7+
\"maxSession\": $GRID_MAX_SESSION,
8+
\"newSessionWaitTimeout\": $GRID_NEW_SESSION_WAIT_TIMEOUT,
89
\"capabilityMatcher\": \"org.openqa.grid.internal.utils.DefaultCapabilityMatcher\",
910
\"throwOnCapabilityNotPresent\": $GRID_THROW_ON_CAPABILITY_NOT_PRESENT,
10-
\"newSessionWaitTimeout\": $GRID_NEW_SESSION_WAIT_TIMEOUT,
1111
\"jettyMaxThreads\": $GRID_JETTY_MAX_THREADS,
12-
\"nodePolling\": $GRID_NODE_POLLING,
1312
\"cleanUpCycle\": $GRID_CLEAN_UP_CYCLE,
14-
\"timeout\": $GRID_TIMEOUT,
1513
\"browserTimeout\": $GRID_BROWSER_TIMEOUT,
16-
\"maxSession\": $GRID_MAX_SESSION,
17-
\"unregisterIfStillDownAfter\": $GRID_UNREGISTER_IF_STILL_DOWN_AFTER
18-
}"
19-
20-
14+
\"timeout\": $GRID_TIMEOUT,
15+
\"prioritizer\": null,
16+
}"

NodeBase/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ ENV DISPLAY :99.0
3535

3636
USER seluser
3737

38-
CMD ["/opt/bin/entry_point.sh"]
38+
CMD ["/opt/bin/entry_point.sh"]

NodeBase/Dockerfile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ ENV DISPLAY :99.0
3030

3131
USER seluser
3232

33-
CMD ["/opt/bin/entry_point.sh"]
33+
CMD ["/opt/bin/entry_point.sh"]

NodeBase/entry_point.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR"
4444
NODE_PID=$!
4545

4646
trap shutdown SIGTERM SIGINT
47-
wait $NODE_PID
47+
wait $NODE_PID

NodeBase/functions.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
# https://github.com/SeleniumHQ/docker-selenium/issues/184
44
function get_server_num() {
55
echo $(echo $DISPLAY | sed -r -e 's/([^:]+)?:([0-9]+)(\.[0-9]+)?/\2/')
6-
}
7-
6+
}

NodeBase/generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> ./Dockerfile
66
echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> ./Dockerfile
77
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ./Dockerfile
88
echo FROM selenium/base:$VERSION >> ./Dockerfile
9-
cat ./Dockerfile.txt >> ./Dockerfile
9+
cat ./Dockerfile.txt >> ./Dockerfile

NodeChrome/Dockerfile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,23 @@ RUN wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.stor
4141
#========================
4242
# Selenium Configuration
4343
#========================
44+
# As integer, maps to "maxInstances"
4445
ENV NODE_MAX_INSTANCES 1
46+
# As integer, maps to "maxSession"
4547
ENV NODE_MAX_SESSION 1
46-
ENV NODE_REGISTER_CYCLE 5000
48+
# As integer, maps to "port"
4749
ENV NODE_PORT 5555
50+
# In milliseconds, maps to "registerCycle"
51+
ENV NODE_REGISTER_CYCLE 5000
52+
# In milliseconds, maps to "nodePolling"
53+
ENV NODE_POLLING 5000
54+
# In milliseconds, maps to "unregisterIfStillDownAfter"
55+
ENV NODE_UNREGISTER_IF_STILL_DOWN_AFTER 60000
56+
# As integer, maps to "downPollingLimit"
57+
ENV NODE_DOWN_POLLING_LIMIT 2
58+
# As string, maps to "applicationName"
4859
ENV NODE_APPLICATION_NAME ""
60+
4961
COPY generate_config /opt/selenium/generate_config
5062
RUN chmod +x /opt/selenium/generate_config
5163

@@ -61,4 +73,4 @@ RUN chown -R seluser:seluser /opt/selenium
6173
# https://github.com/SeleniumHQ/docker-selenium/issues/87
6274
RUN echo "DBUS_SESSION_BUS_ADDRESS=/dev/null" >> /etc/environment
6375

64-
USER seluser
76+
USER seluser

NodeChrome/Dockerfile.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,23 @@ RUN wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.stor
3636
#========================
3737
# Selenium Configuration
3838
#========================
39+
# As integer, maps to "maxInstances"
3940
ENV NODE_MAX_INSTANCES 1
41+
# As integer, maps to "maxSession"
4042
ENV NODE_MAX_SESSION 1
41-
ENV NODE_REGISTER_CYCLE 5000
43+
# As integer, maps to "port"
4244
ENV NODE_PORT 5555
45+
# In milliseconds, maps to "registerCycle"
46+
ENV NODE_REGISTER_CYCLE 5000
47+
# In milliseconds, maps to "nodePolling"
48+
ENV NODE_POLLING 5000
49+
# In milliseconds, maps to "unregisterIfStillDownAfter"
50+
ENV NODE_UNREGISTER_IF_STILL_DOWN_AFTER 60000
51+
# As integer, maps to "downPollingLimit"
52+
ENV NODE_DOWN_POLLING_LIMIT 2
53+
# As string, maps to "applicationName"
4354
ENV NODE_APPLICATION_NAME ""
55+
4456
COPY generate_config /opt/selenium/generate_config
4557
RUN chmod +x /opt/selenium/generate_config
4658

@@ -56,4 +68,4 @@ RUN chown -R seluser:seluser /opt/selenium
5668
# https://github.com/SeleniumHQ/docker-selenium/issues/87
5769
RUN echo "DBUS_SESSION_BUS_ADDRESS=/dev/null" >> /etc/environment
5870

59-
USER seluser
71+
USER seluser

NodeChrome/generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> ./Dockerfile
66
echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> ./Dockerfile
77
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ./Dockerfile
88
echo FROM selenium/node-base:$VERSION >> ./Dockerfile
9-
cat ./Dockerfile.txt >> ./Dockerfile
9+
cat ./Dockerfile.txt >> ./Dockerfile

NodeChrome/generate_config

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ echo "
1818
\"port\": $NODE_PORT,
1919
\"register\": true,
2020
\"registerCycle\": $NODE_REGISTER_CYCLE
21-
}"
22-
21+
\"nodePolling\": $NODE_POLLING,
22+
\"unregisterIfStillDownAfter\": $NODE_UNREGISTER_IF_STILL_DOWN_AFTER,
23+
\"downPollingLimit\": $NODE_DOWN_POLLING_LIMIT
24+
}"

NodeChromeDebug/entry_point.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ SERVERNUM=$(get_server_num)
3636
rm -f /tmp/.X*lock
3737

3838
env | cut -f 1 -d "=" | sort > asroot
39-
sudo -E -u seluser -i env | cut -f 1 -d "=" | sort > asseluser
40-
sudo -E -i -u seluser \
41-
"$(for E in $(grep -vxFf asseluser asroot); do echo $E=$(eval echo \$$E); done)" \
39+
sudo -E -u seluser -i env | cut -f 1 -d "=" | sort > asseluser
40+
sudo -E -i -u seluser \
41+
$(for E in $(grep -vxFf asseluser asroot); do echo $E=$(eval echo \$$E); done) \
4242
DISPLAY=$DISPLAY \
4343
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
4444
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
@@ -63,4 +63,4 @@ fluxbox -display $DISPLAY &
6363

6464
x11vnc -forever -usepw -shared -rfbport 5900 -display $DISPLAY &
6565

66-
wait $NODE_PID
66+
wait $NODE_PID

NodeFirefox/Dockerfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,23 @@ RUN wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geck
3737
#========================
3838
# Selenium Configuration
3939
#========================
40+
# As integer, maps to "maxInstances"
4041
ENV NODE_MAX_INSTANCES 1
42+
# As integer, maps to "maxSession"
4143
ENV NODE_MAX_SESSION 1
42-
ENV NODE_REGISTER_CYCLE 5000
44+
# As integer, maps to "port"
4345
ENV NODE_PORT 5555
46+
# In milliseconds, maps to "registerCycle"
47+
ENV NODE_REGISTER_CYCLE 5000
48+
# In milliseconds, maps to "nodePolling"
49+
ENV NODE_POLLING 5000
50+
# In milliseconds, maps to "unregisterIfStillDownAfter"
51+
ENV NODE_UNREGISTER_IF_STILL_DOWN_AFTER 60000
52+
# As integer, maps to "downPollingLimit"
53+
ENV NODE_DOWN_POLLING_LIMIT 2
54+
# As string, maps to "applicationName"
4455
ENV NODE_APPLICATION_NAME ""
56+
4557
COPY generate_config /opt/selenium/generate_config
4658
RUN chmod +x /opt/selenium/generate_config \
4759
&& chown -R seluser:seluser /opt/selenium

NodeFirefox/Dockerfile.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,23 @@ RUN wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geck
3232
#========================
3333
# Selenium Configuration
3434
#========================
35+
# As integer, maps to "maxInstances"
3536
ENV NODE_MAX_INSTANCES 1
37+
# As integer, maps to "maxSession"
3638
ENV NODE_MAX_SESSION 1
37-
ENV NODE_REGISTER_CYCLE 5000
39+
# As integer, maps to "port"
3840
ENV NODE_PORT 5555
41+
# In milliseconds, maps to "registerCycle"
42+
ENV NODE_REGISTER_CYCLE 5000
43+
# In milliseconds, maps to "nodePolling"
44+
ENV NODE_POLLING 5000
45+
# In milliseconds, maps to "unregisterIfStillDownAfter"
46+
ENV NODE_UNREGISTER_IF_STILL_DOWN_AFTER 60000
47+
# As integer, maps to "downPollingLimit"
48+
ENV NODE_DOWN_POLLING_LIMIT 2
49+
# As string, maps to "applicationName"
3950
ENV NODE_APPLICATION_NAME ""
51+
4052
COPY generate_config /opt/selenium/generate_config
4153
RUN chmod +x /opt/selenium/generate_config \
4254
&& chown -R seluser:seluser /opt/selenium

NodeFirefox/generate_config

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ echo "
66
{
77
\"capabilities\": [
88
{
9-
\"version\": \"$FIREFOX_VERSION\",
10-
\"browserName\": \"firefox\",
9+
\"version\": \"$CHROME_VERSION\",
10+
\"browserName\": \"chrome\",
1111
\"maxInstances\": $NODE_MAX_INSTANCES,
1212
\"seleniumProtocol\": \"WebDriver\",
1313
\"applicationName\": \"$NODE_APPLICATION_NAME\"
@@ -18,5 +18,7 @@ echo "
1818
\"port\": $NODE_PORT,
1919
\"register\": true,
2020
\"registerCycle\": $NODE_REGISTER_CYCLE
21-
}"
22-
21+
\"nodePolling\": $NODE_POLLING,
22+
\"unregisterIfStillDownAfter\": $NODE_UNREGISTER_IF_STILL_DOWN_AFTER,
23+
\"downPollingLimit\": $NODE_DOWN_POLLING_LIMIT
24+
}"

0 commit comments

Comments
 (0)