Skip to content

Commit d794af0

Browse files
authored
Readme improvements (#1098)
1 parent ac5701e commit d794af0

33 files changed

+549
-520
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ node_modules/
88
*.swp
99

1010
# Ignoring generated files during the build process
11-
Node*Debug/selenium-debug.conf
12-
Node*Debug/start-*.sh
1311
StandaloneC*/selenium.conf
1412
StandaloneF*/selenium.conf
13+
StandaloneO*/selenium.conf
1514
StandaloneC*/start-*.sh
1615
StandaloneF*/start-*.sh
16+
StandaloneO*/start-*.sh
1717

1818
# Created by https://www.gitignore.io/api/virtualenv
1919

Base/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:bionic-20200630
1+
FROM ubuntu:bionic-20200807
22
LABEL authors="Selenium <[email protected]>"
33

44
#================================================
@@ -71,8 +71,10 @@ COPY supervisord.conf /etc
7171
RUN mkdir -p /opt/selenium /var/run/supervisor /var/log/supervisor \
7272
&& touch /opt/selenium/config.json \
7373
&& chmod -R 777 /opt/selenium /var/run/supervisor /var/log/supervisor /etc/passwd \
74-
&& wget --no-verbose https://selenium-release.storage.googleapis.com/4.0-alpha-6/selenium-server-4.0.0-alpha-6.jar \
74+
&& wget --no-verbose https://github.com/SeleniumHQ/docker-selenium/raw/alpha-jars/selenium-server-4.0.0-alpha-7.jar \
7575
-O /opt/selenium/selenium-server.jar \
76+
# && wget --no-verbose https://selenium-release.storage.googleapis.com/4.0-alpha-6/selenium-server-4.0.0-alpha-6.jar \
77+
# -O /opt/selenium/selenium-server.jar \
7678
&& chgrp -R 0 /opt/selenium ${HOME} /var/run/supervisor /var/log/supervisor \
7779
&& chmod -R g=u /opt/selenium ${HOME} /var/run/supervisor /var/log/supervisor
7880

Distributor/Dockerfile

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,12 @@ LABEL authors=SeleniumHQ
88
USER 1200
99

1010
#========================
11-
# Selenium Configuration
11+
# Selenium Distributor Configuration
1212
#========================
1313

14-
EXPOSE 4442
15-
EXPOSE 4443
16-
EXPOSE 4444
14+
EXPOSE 5553
1715

18-
# As integer, maps to "maxSession"
19-
ENV GRID_MAX_SESSION 5
20-
# In milliseconds, maps to "newSessionWaitTimeout"
21-
ENV GRID_NEW_SESSION_WAIT_TIMEOUT -1
22-
# As a boolean, maps to "throwOnCapabilityNotPresent"
23-
ENV GRID_THROW_ON_CAPABILITY_NOT_PRESENT true
24-
# As an integer
25-
ENV GRID_JETTY_MAX_THREADS -1
26-
# In milliseconds, maps to "cleanUpCycle"
27-
ENV GRID_CLEAN_UP_CYCLE 5000
28-
# In seconds, maps to "browserTimeout"
29-
ENV GRID_BROWSER_TIMEOUT 0
30-
# In seconds, maps to "timeout"
31-
ENV GRID_TIMEOUT 1800
32-
# Debug
33-
ENV GRID_DEBUG false
34-
# As integer, maps to "port"
35-
ENV GRID_HUB_PORT 4444
36-
# As string, maps to "host"
37-
ENV GRID_HUB_HOST "0.0.0.0"
38-
39-
COPY generate_config \
40-
start-selenium-grid-distributor.sh \
16+
COPY start-selenium-grid-distributor.sh \
4117
/opt/bin/
4218

4319
COPY selenium-grid-distributor.conf /etc/supervisor/conf.d/
44-
45-
RUN /opt/bin/generate_config > /opt/selenium/config.json

Distributor/Dockerfile.txt

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,12 @@
11
USER 1200
22

33
#========================
4-
# Selenium Configuration
4+
# Selenium Distributor Configuration
55
#========================
66

7-
EXPOSE 4442
8-
EXPOSE 4443
9-
EXPOSE 4444
7+
EXPOSE 5553
108

11-
# As integer, maps to "maxSession"
12-
ENV GRID_MAX_SESSION 5
13-
# In milliseconds, maps to "newSessionWaitTimeout"
14-
ENV GRID_NEW_SESSION_WAIT_TIMEOUT -1
15-
# As a boolean, maps to "throwOnCapabilityNotPresent"
16-
ENV GRID_THROW_ON_CAPABILITY_NOT_PRESENT true
17-
# As an integer
18-
ENV GRID_JETTY_MAX_THREADS -1
19-
# In milliseconds, maps to "cleanUpCycle"
20-
ENV GRID_CLEAN_UP_CYCLE 5000
21-
# In seconds, maps to "browserTimeout"
22-
ENV GRID_BROWSER_TIMEOUT 0
23-
# In seconds, maps to "timeout"
24-
ENV GRID_TIMEOUT 1800
25-
# Debug
26-
ENV GRID_DEBUG false
27-
# As integer, maps to "port"
28-
ENV GRID_HUB_PORT 4444
29-
# As string, maps to "host"
30-
ENV GRID_HUB_HOST "0.0.0.0"
31-
32-
COPY generate_config \
33-
start-selenium-grid-distributor.sh \
9+
COPY start-selenium-grid-distributor.sh \
3410
/opt/bin/
3511

3612
COPY selenium-grid-distributor.conf /etc/supervisor/conf.d/
37-
38-
RUN /opt/bin/generate_config > /opt/selenium/config.json

Distributor/generate_config

Lines changed: 0 additions & 18 deletions
This file was deleted.

Distributor/start-selenium-grid-distributor.sh

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,38 @@ set -e
55

66
echo "Starting Selenium Grid Distributor..."
77

8-
java -jar /opt/selenium/selenium-server.jar distributor
8+
if [[ -z "${SE_EVENT_BUS_HOST}" ]]; then
9+
echo "SE_EVENT_BUS_HOST not set, exiting!" 1>&2
10+
exit 1
11+
fi
12+
13+
if [[ -z "${SE_EVENT_BUS_PUBLISH_PORT}" ]]; then
14+
echo "SE_EVENT_BUS_PUBLISH_PORT not set, exiting!" 1>&2
15+
exit 1
16+
fi
17+
18+
if [[ -z "${SE_EVENT_BUS_SUBSCRIBE_PORT}" ]]; then
19+
echo "SE_EVENT_BUS_SUBSCRIBE_PORT not set, exiting!" 1>&2
20+
exit 1
21+
fi
22+
23+
if [[ -z "${SE_SESSIONS_MAP_HOST}" ]]; then
24+
echo "SE_SESSIONS_MAP_HOST not set, exiting!" 1>&2
25+
exit 1
26+
fi
27+
28+
if [[ -z "${SE_SESSIONS_MAP_PORT}" ]]; then
29+
echo "SE_SESSIONS_MAP_PORT not set, exiting!" 1>&2
30+
exit 1
31+
fi
32+
33+
if [ ! -z "$SE_OPTS" ]; then
34+
echo "Appending Selenium options: ${SE_OPTS}"
35+
fi
36+
37+
java -jar /opt/selenium/selenium-server.jar distributor \
38+
--sessions-host "${SE_SESSIONS_MAP_HOST}" --sessions-port ${SE_SESSIONS_MAP_PORT} \
39+
--publish-events tcp://"${SE_EVENT_BUS_HOST}":${SE_EVENT_BUS_PUBLISH_PORT} \
40+
--subscribe-events tcp://"${SE_EVENT_BUS_HOST}":${SE_EVENT_BUS_SUBSCRIBE_PORT} \
41+
--bind-bus false \
42+
${SE_OPTS}

EventBus/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2+
# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED.
3+
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
4+
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5+
FROM selenium/base:4.0.0-alpha-6-20200730
6+
LABEL authors=SeleniumHQ
7+
8+
USER 1200
9+
10+
#=================================
11+
# Selenium Event Bus Configuration
12+
#=================================
13+
14+
# Port where events are published
15+
EXPOSE 4442
16+
# Port where to subscribe for events
17+
EXPOSE 4443
18+
# Event Bus port
19+
EXPOSE 5557
20+
21+
COPY start-selenium-grid-eventbus.sh \
22+
/opt/bin/
23+
24+
COPY selenium-grid-eventbus.conf /etc/supervisor/conf.d/

EventBus/Dockerfile.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
USER 1200
2+
3+
#=================================
4+
# Selenium Event Bus Configuration
5+
#=================================
6+
7+
# Port where events are published
8+
EXPOSE 4442
9+
# Port where to subscribe for events
10+
EXPOSE 4443
11+
# Event Bus port
12+
EXPOSE 5557
13+
14+
COPY start-selenium-grid-eventbus.sh \
15+
/opt/bin/
16+
17+
COPY selenium-grid-eventbus.conf /etc/supervisor/conf.d/

EventBus/generate.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
VERSION=$1
4+
NAMESPACE=$2
5+
AUTHORS=$3
6+
7+
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" > ./Dockerfile
8+
echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> ./Dockerfile
9+
echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> ./Dockerfile
10+
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ./Dockerfile
11+
echo FROM ${NAMESPACE}/base:${VERSION} >> ./Dockerfile
12+
echo LABEL authors="$AUTHORS" >> ./Dockerfile
13+
echo "" >> ./Dockerfile
14+
cat ./Dockerfile.txt >> ./Dockerfile

EventBus/selenium-grid-eventbus.conf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
; Documentation of this file format -> http://supervisord.org/configuration.html
2+
3+
[program:selenium-grid-eventbus]
4+
5+
priority=0
6+
command=/opt/bin/start-selenium-grid-eventbus.sh
7+
autostart=true
8+
autorestart=false
9+
startsecs=0
10+
startretries=0
11+
12+
;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
13+
redirect_stderr=true
14+
stdout_logfile=/dev/stdout
15+
stdout_logfile_maxbytes=0
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
# set -e: exit asap if a command exits with a non-zero status
4+
set -e
5+
6+
echo "Starting Selenium Grid EventBus..."
7+
8+
java -jar /opt/selenium/selenium-server.jar event-bus ${SE_OPTS}

Hub/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LABEL authors=SeleniumHQ
88
USER 1200
99

1010
#========================
11-
# Selenium Configuration
11+
# Selenium Hub Configuration
1212
#========================
1313

1414
EXPOSE 4442

Hub/Dockerfile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
USER 1200
22

33
#========================
4-
# Selenium Configuration
4+
# Selenium Hub Configuration
55
#========================
66

77
EXPOSE 4442

Hub/start-selenium-grid-hub.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ set -e
55

66
echo "Starting Selenium Grid Hub..."
77

8-
java -jar /opt/selenium/selenium-server.jar hub
8+
if [ ! -z "$SE_OPTS" ]; then
9+
echo "Appending Selenium options: ${SE_OPTS}"
10+
fi
11+
12+
java -jar /opt/selenium/selenium-server.jar hub ${SE_OPTS}

0 commit comments

Comments
 (0)