Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ node_modules/
*.swp

# Ignoring generated files during the build process
Node*Debug/selenium-debug.conf
Node*Debug/start-*.sh
StandaloneC*/selenium.conf
StandaloneF*/selenium.conf
StandaloneO*/selenium.conf
StandaloneC*/start-*.sh
StandaloneF*/start-*.sh
StandaloneO*/start-*.sh

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

Expand Down
6 changes: 4 additions & 2 deletions Base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:bionic-20200630
FROM ubuntu:bionic-20200807
LABEL authors="Selenium <[email protected]>"

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

Expand Down
32 changes: 3 additions & 29 deletions Distributor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,12 @@ LABEL authors=SeleniumHQ
USER 1200

#========================
# Selenium Configuration
# Selenium Distributor Configuration
#========================

EXPOSE 4442
EXPOSE 4443
EXPOSE 4444
EXPOSE 5553

# As integer, maps to "maxSession"
ENV GRID_MAX_SESSION 5
# In milliseconds, maps to "newSessionWaitTimeout"
ENV GRID_NEW_SESSION_WAIT_TIMEOUT -1
# As a boolean, maps to "throwOnCapabilityNotPresent"
ENV GRID_THROW_ON_CAPABILITY_NOT_PRESENT true
# As an integer
ENV GRID_JETTY_MAX_THREADS -1
# In milliseconds, maps to "cleanUpCycle"
ENV GRID_CLEAN_UP_CYCLE 5000
# In seconds, maps to "browserTimeout"
ENV GRID_BROWSER_TIMEOUT 0
# In seconds, maps to "timeout"
ENV GRID_TIMEOUT 1800
# Debug
ENV GRID_DEBUG false
# As integer, maps to "port"
ENV GRID_HUB_PORT 4444
# As string, maps to "host"
ENV GRID_HUB_HOST "0.0.0.0"

COPY generate_config \
start-selenium-grid-distributor.sh \
COPY start-selenium-grid-distributor.sh \
/opt/bin/

COPY selenium-grid-distributor.conf /etc/supervisor/conf.d/

RUN /opt/bin/generate_config > /opt/selenium/config.json
32 changes: 3 additions & 29 deletions Distributor/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,12 @@
USER 1200

#========================
# Selenium Configuration
# Selenium Distributor Configuration
#========================

EXPOSE 4442
EXPOSE 4443
EXPOSE 4444
EXPOSE 5553

# As integer, maps to "maxSession"
ENV GRID_MAX_SESSION 5
# In milliseconds, maps to "newSessionWaitTimeout"
ENV GRID_NEW_SESSION_WAIT_TIMEOUT -1
# As a boolean, maps to "throwOnCapabilityNotPresent"
ENV GRID_THROW_ON_CAPABILITY_NOT_PRESENT true
# As an integer
ENV GRID_JETTY_MAX_THREADS -1
# In milliseconds, maps to "cleanUpCycle"
ENV GRID_CLEAN_UP_CYCLE 5000
# In seconds, maps to "browserTimeout"
ENV GRID_BROWSER_TIMEOUT 0
# In seconds, maps to "timeout"
ENV GRID_TIMEOUT 1800
# Debug
ENV GRID_DEBUG false
# As integer, maps to "port"
ENV GRID_HUB_PORT 4444
# As string, maps to "host"
ENV GRID_HUB_HOST "0.0.0.0"

COPY generate_config \
start-selenium-grid-distributor.sh \
COPY start-selenium-grid-distributor.sh \
/opt/bin/

COPY selenium-grid-distributor.conf /etc/supervisor/conf.d/

RUN /opt/bin/generate_config > /opt/selenium/config.json
18 changes: 0 additions & 18 deletions Distributor/generate_config

This file was deleted.

36 changes: 35 additions & 1 deletion Distributor/start-selenium-grid-distributor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,38 @@ set -e

echo "Starting Selenium Grid Distributor..."

java -jar /opt/selenium/selenium-server.jar distributor
if [[ -z "${SE_EVENT_BUS_HOST}" ]]; then
echo "SE_EVENT_BUS_HOST not set, exiting!" 1>&2
exit 1
fi

if [[ -z "${SE_EVENT_BUS_PUBLISH_PORT}" ]]; then
echo "SE_EVENT_BUS_PUBLISH_PORT not set, exiting!" 1>&2
exit 1
fi

if [[ -z "${SE_EVENT_BUS_SUBSCRIBE_PORT}" ]]; then
echo "SE_EVENT_BUS_SUBSCRIBE_PORT not set, exiting!" 1>&2
exit 1
fi

if [[ -z "${SE_SESSIONS_MAP_HOST}" ]]; then
echo "SE_SESSIONS_MAP_HOST not set, exiting!" 1>&2
exit 1
fi

if [[ -z "${SE_SESSIONS_MAP_PORT}" ]]; then
echo "SE_SESSIONS_MAP_PORT not set, exiting!" 1>&2
exit 1
fi

if [ ! -z "$SE_OPTS" ]; then
echo "Appending Selenium options: ${SE_OPTS}"
fi

java -jar /opt/selenium/selenium-server.jar distributor \
--sessions-host "${SE_SESSIONS_MAP_HOST}" --sessions-port ${SE_SESSIONS_MAP_PORT} \
--publish-events tcp://"${SE_EVENT_BUS_HOST}":${SE_EVENT_BUS_PUBLISH_PORT} \
--subscribe-events tcp://"${SE_EVENT_BUS_HOST}":${SE_EVENT_BUS_SUBSCRIBE_PORT} \
--bind-bus false \
${SE_OPTS}
24 changes: 24 additions & 0 deletions EventBus/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED.
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/base:4.0.0-alpha-6-20200730
LABEL authors=SeleniumHQ

USER 1200

#=================================
# Selenium Event Bus Configuration
#=================================

# Port where events are published
EXPOSE 4442
# Port where to subscribe for events
EXPOSE 4443
# Event Bus port
EXPOSE 5557

COPY start-selenium-grid-eventbus.sh \
/opt/bin/

COPY selenium-grid-eventbus.conf /etc/supervisor/conf.d/
17 changes: 17 additions & 0 deletions EventBus/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
USER 1200

#=================================
# Selenium Event Bus Configuration
#=================================

# Port where events are published
EXPOSE 4442
# Port where to subscribe for events
EXPOSE 4443
# Event Bus port
EXPOSE 5557

COPY start-selenium-grid-eventbus.sh \
/opt/bin/

COPY selenium-grid-eventbus.conf /etc/supervisor/conf.d/
14 changes: 14 additions & 0 deletions EventBus/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

VERSION=$1
NAMESPACE=$2
AUTHORS=$3

echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" > ./Dockerfile
echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> ./Dockerfile
echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> ./Dockerfile
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ./Dockerfile
echo FROM ${NAMESPACE}/base:${VERSION} >> ./Dockerfile
echo LABEL authors="$AUTHORS" >> ./Dockerfile
echo "" >> ./Dockerfile
cat ./Dockerfile.txt >> ./Dockerfile
15 changes: 15 additions & 0 deletions EventBus/selenium-grid-eventbus.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; Documentation of this file format -> http://supervisord.org/configuration.html

[program:selenium-grid-eventbus]

priority=0
command=/opt/bin/start-selenium-grid-eventbus.sh
autostart=true
autorestart=false
startsecs=0
startretries=0

;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
8 changes: 8 additions & 0 deletions EventBus/start-selenium-grid-eventbus.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

# set -e: exit asap if a command exits with a non-zero status
set -e

echo "Starting Selenium Grid EventBus..."

java -jar /opt/selenium/selenium-server.jar event-bus ${SE_OPTS}
2 changes: 1 addition & 1 deletion Hub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LABEL authors=SeleniumHQ
USER 1200

#========================
# Selenium Configuration
# Selenium Hub Configuration
#========================

EXPOSE 4442
Expand Down
2 changes: 1 addition & 1 deletion Hub/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
USER 1200

#========================
# Selenium Configuration
# Selenium Hub Configuration
#========================

EXPOSE 4442
Expand Down
6 changes: 5 additions & 1 deletion Hub/start-selenium-grid-hub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ set -e

echo "Starting Selenium Grid Hub..."

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

java -jar /opt/selenium/selenium-server.jar hub ${SE_OPTS}
Loading