Skip to content

Commit a3149a3

Browse files
committed
Adding a docker image for the distributor
1 parent 078c881 commit a3149a3

13 files changed

+164
-69
lines changed

Distributor/Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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-5-20200326
6+
LABEL authors=SeleniumHQ
7+
8+
USER seluser
9+
10+
#========================
11+
# Selenium Configuration
12+
#========================
13+
14+
EXPOSE 4442
15+
EXPOSE 4443
16+
EXPOSE 4444
17+
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 \
41+
/opt/bin/
42+
43+
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: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
USER seluser
2+
3+
#========================
4+
# Selenium Configuration
5+
#========================
6+
7+
EXPOSE 4442
8+
EXPOSE 4443
9+
EXPOSE 4444
10+
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 \
34+
/opt/bin/
35+
36+
COPY selenium-grid-distributor.conf /etc/supervisor/conf.d/
37+
38+
RUN /opt/bin/generate_config > /opt/selenium/config.json

Distributor/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

Distributor/generate_config

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
cat <<_EOF
4+
{
5+
"host": "${GRID_HUB_HOST}",
6+
"port": ${GRID_HUB_PORT},
7+
"role": "hub",
8+
"maxSession": ${GRID_MAX_SESSION},
9+
"newSessionWaitTimeout": ${GRID_NEW_SESSION_WAIT_TIMEOUT},
10+
"capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
11+
"throwOnCapabilityNotPresent": ${GRID_THROW_ON_CAPABILITY_NOT_PRESENT},
12+
"jettyMaxThreads": ${GRID_JETTY_MAX_THREADS},
13+
"cleanUpCycle": ${GRID_CLEAN_UP_CYCLE},
14+
"browserTimeout": ${GRID_BROWSER_TIMEOUT},
15+
"timeout": ${GRID_TIMEOUT},
16+
"debug": ${GRID_DEBUG}
17+
}
18+
_EOF
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-distributor]
4+
5+
priority=0
6+
command=/opt/bin/start-selenium-grid-distributor.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 Distributor..."
7+
8+
java -jar /opt/selenium/selenium-server.jar distributor

Hub/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ ENV GRID_HUB_PORT 4444
3737
ENV GRID_HUB_HOST "0.0.0.0"
3838

3939
COPY generate_config \
40-
start-selenium-hub.sh \
40+
start-selenium-grid-hub.sh \
4141
/opt/bin/
4242

43-
COPY selenium-hub.conf /etc/supervisor/conf.d/
43+
COPY selenium-grid-hub.conf /etc/supervisor/conf.d/
4444

4545
RUN /opt/bin/generate_config > /opt/selenium/config.json

Hub/Dockerfile.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ ENV GRID_HUB_PORT 4444
3030
ENV GRID_HUB_HOST "0.0.0.0"
3131

3232
COPY generate_config \
33-
start-selenium-hub.sh \
33+
start-selenium-grid-hub.sh \
3434
/opt/bin/
3535

36-
COPY selenium-hub.conf /etc/supervisor/conf.d/
36+
COPY selenium-grid-hub.conf /etc/supervisor/conf.d/
3737

3838
RUN /opt/bin/generate_config > /opt/selenium/config.json

Hub/README-short.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

Hub/README.md

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

0 commit comments

Comments
 (0)