From d93ff04b49f1fab765834027a0d9cc553223d1ec Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Tue, 18 Nov 2014 12:14:35 -0700 Subject: [PATCH] Change Firefox Node to run Selenium Node Directly Remove init script for running Selenium node in favor of running the jar directly. Part of #3 --- Makefile | 18 +----------- NodeFirefox/Dockerfile | 19 +++++++++++++ {build/firefox => NodeFirefox}/config.json | 0 build/Dockerfile | 7 ----- build/firefox/install.sh | 14 ---------- build/full/config.json | 31 --------------------- build/full/etc/service/sel-hub-emulator/run | 5 ---- build/full/install.sh | 10 ------- build/install.sh | 14 ---------- 9 files changed, 20 insertions(+), 98 deletions(-) create mode 100644 NodeFirefox/Dockerfile rename {build/firefox => NodeFirefox}/config.json (100%) delete mode 100644 build/Dockerfile delete mode 100644 build/firefox/install.sh delete mode 100644 build/full/config.json delete mode 100644 build/full/etc/service/sel-hub-emulator/run delete mode 100644 build/full/install.sh delete mode 100644 build/install.sh diff --git a/Makefile b/Makefile index b08a5c8c90..a68ddf3cd4 100644 --- a/Makefile +++ b/Makefile @@ -25,20 +25,7 @@ chrome: nodebase cd ./NodeChrome && docker build -t $(NAME)/node-chrome:$(VERSION) . firefox: nodebase - rm -rf firefox_image - mkdir -p firefox_image/build/firefox - cp build/Dockerfile firefox_image/Dockerfile - cp build/install.sh firefox_image/build/install.sh - cp $(COPYARGS) build/firefox firefox_image/build/ - cd ./firefox_image && docker build -t $(NAME)/node-firefox:$(VERSION) . - -full: nodebase - rm -rf full_image - mkdir -p full_image/build/ - cp build/Dockerfile full_image/Dockerfile - cp $(COPYARGS) build/ full_image/build/ - cp $(COPYARGS) Hub/etc/ full_image/build/full/etc/ - cd ./full_image && docker build -t $(NAME)/full:$(VERSION) . + cd ./NodeFirefox && docker build -t $(NAME)/node-firefox:$(VERSION) . tag_latest: docker tag $(NAME)/base:$(VERSION) $(NAME)/base:latest @@ -46,7 +33,6 @@ tag_latest: docker tag $(NAME)/node-base:$(VERSION) $(NAME)/node-base:latest docker tag $(NAME)/node-chrome:$(VERSION) $(NAME)/node-chrome:latest docker tag $(NAME)/node-firefox:$(VERSION) $(NAME)/node-firefox:latest - docker tag $(NAME)/full:$(VERSION) $(NAME)/full:latest release: tag_latest @if ! docker images $(NAME)/base | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/base version $(VERSION) is not yet built. Please run 'make build'"; false; fi @@ -54,13 +40,11 @@ release: tag_latest @if ! docker images $(NAME)/node-base | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/node-base version $(VERSION) is not yet built. Please run 'make build'"; false; fi @if ! docker images $(NAME)/node-chrome | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/node-chrome version $(VERSION) is not yet built. Please run 'make build'"; false; fi @if ! docker images $(NAME)/node-firefox | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/node-firefox version $(VERSION) is not yet built. Please run 'make build'"; false; fi - @if ! docker images $(NAME)/full | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME)/full version $(VERSION) is not yet built. Please run 'make build'"; false; fi docker push $(NAME)/base docker push $(NAME)/hub docker push $(NAME)/node-base docker push $(NAME)/node-chrome docker push $(NAME)/node-firefox - docker push $(NAME)/full @echo "*** Don't forget to create a tag. git tag rel-$(VERSION) && git push origin rel-$(VERSION)" clean: diff --git a/NodeFirefox/Dockerfile b/NodeFirefox/Dockerfile new file mode 100644 index 0000000000..0da9a0b2c9 --- /dev/null +++ b/NodeFirefox/Dockerfile @@ -0,0 +1,19 @@ +FROM selenium/node-base:2.44.0 +MAINTAINER Selenium + +USER root + +#========= +# Firefox +#========= +RUN apt-get update -qqy \ + && apt-get -qqy --no-install-recommends install \ + firefox \ + && rm -rf /var/lib/apt/lists/* + +#======================== +# Selenium Configuration +#======================== +COPY config.json /opt/selenium/config.json + +USER seluser diff --git a/build/firefox/config.json b/NodeFirefox/config.json similarity index 100% rename from build/firefox/config.json rename to NodeFirefox/config.json diff --git a/build/Dockerfile b/build/Dockerfile deleted file mode 100644 index e915aa2c3a..0000000000 --- a/build/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM elgalu/selenium-node-base:2.44.0 -MAINTAINER Selenium - -COPY ./build /tmp/build -RUN chmod +x /tmp/build/install.sh \ - && chmod +x /tmp/build/**/install.sh -RUN ./tmp/build/install.sh diff --git a/build/firefox/install.sh b/build/firefox/install.sh deleted file mode 100644 index f6b9f0d1cc..0000000000 --- a/build/firefox/install.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -e -set -x - -#================= -# Mozilla Firefox -#================= -apt-get update -qqy -apt-get -qqy --no-install-recommends install firefox - -#======================== -# Selenium Configuration -#======================== -cp /tmp/build/firefox/config.json /opt/selenium/config.json diff --git a/build/full/config.json b/build/full/config.json deleted file mode 100644 index 867a02fa79..0000000000 --- a/build/full/config.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "capabilities": [ - { - "browserName": "*googlechrome", - "maxInstances": 5, - "seleniumProtocol": "Selenium" - }, - { - "browserName": "*firefox", - "maxInstances": 5, - "seleniumProtocol": "Selenium" - }, - { - "browserName": "chrome", - "maxInstances": 5, - "seleniumProtocol": "WebDriver" - }, - { - "browserName": "firefox", - "maxInstances": 5, - "seleniumProtocol": "WebDriver" - } - ], - "configuration": { - "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy", - "maxSession": 5, - "port": 5555, - "register": true, - "registerCycle": 5000 - } -} diff --git a/build/full/etc/service/sel-hub-emulator/run b/build/full/etc/service/sel-hub-emulator/run deleted file mode 100644 index aef1559c09..0000000000 --- a/build/full/etc/service/sel-hub-emulator/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -export HUB_LOG="/tmp/sel-hub.log" - -# Start a GUI xTerm to easily debug the headless instance -x-terminal-emulator -geometry 100x30-10+10 -ls -title "selenium hub log" -e "tail -f $HUB_LOG" diff --git a/build/full/install.sh b/build/full/install.sh deleted file mode 100644 index 484741a367..0000000000 --- a/build/full/install.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -e -set -x - -#======================== -# Selenium Configuration -#======================== -cp /tmp/build/full/config.json /opt/selenium/config.json - -cp -rT /tmp/build/full/etc/ /etc/ diff --git a/build/install.sh b/build/install.sh deleted file mode 100644 index dcba081fc7..0000000000 --- a/build/install.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -e -set -x - -for d in /tmp/build/**/install.sh ; do - . $d -done - -chmod +x /etc/service/**/run - -apt-get clean -rm -rf /tmp/* -rm -rf /var/tmp/* -rm -rf /var/lib/apt/lists/*