From 3a2bae0e595483fdbf640d4dbed974ef81d854a9 Mon Sep 17 00:00:00 2001 From: Lazarus404 Date: Tue, 7 Jul 2020 19:12:22 +0100 Subject: [PATCH] Add Dockerfile and entrypoint files --- Dockerfile | 99 +++++++++++++++++++ .../js.iceconnection.apprtc.config.json | 7 +- KITE-AppRTC-Test/js/package.json | 2 +- docker-compose.yml | 32 ++++++ scripts/entrypoint.sh | 9 ++ 5 files changed, 146 insertions(+), 3 deletions(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100755 scripts/entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..09d57269 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,99 @@ +FROM ubuntu:groovy as KiteBase + +ARG DEBIAN_FRONTEND=noninteractive +ENV DEBIAN_FRONTEND=noninteractive + +USER root +RUN apt update +RUN apt -y upgrade +RUN apt update +RUN apt -y install \ + curl \ + dirmngr \ + apt-transport-https \ + lsb-release \ + ca-certificates \ + default-jre \ + default-jdk \ + openjdk-8-jdk \ + maven \ + git \ + gcc \ + build-essential \ + nano \ + wget \ + dpkg \ + unzip \ + xvfb \ + nodejs \ + fonts-liberation \ + libappindicator3-1 \ + libgbm1 \ + libgtk-3-0 \ + libxss1 \ + xdg-utils \ + keyboard-configuration \ + nmap \ + xterm +RUN apt -y update +RUN apt -y install npm + +# KITE +RUN git clone https://github.com/webrtc/KITE.git KITE + +WORKDIR /KITE/ +COPY ./scripts ./scripts/ +COPY ./third_party ./third_party/ +COPY ./configureLinux.sh . + +RUN chmod +x *.sh ./configureLinux.sh + +ENV KITE_HOME=/KITE +RUN export KITE_HOME +ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 + +RUN export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/bin +ENV MAVEN_HOME=/usr/share/maven +RUN export MAVEN_HOME +RUN /bin/bash -c "source ~/.bashrc" +RUN echo 'export PATH=$PATH:/KITE/localGrid/chrome' >> ~/.bashrc + +ARG testpathdir +ENV KITE_TEST_PATH=$testpathdir +ARG configfilename +ENV KITE_CONFIG_NAME=$configfilename + +WORKDIR /KITE/$KITE_TEST_PATH +RUN /KITE/scripts/linux/path/c all +WORKDIR /KITE + +RUN yes | /KITE/configureLinux.sh + +FROM KiteBase + +COPY ./KITE-Framework . +COPY ./KITE-Engine . +COPY ./scripts/linux/setupLocalGrid.sh . +COPY ./scripts/linux/gridConfig.sh . +COPY ./scripts/linux/path/c . +COPY ./scripts/linux/path/r . +COPY ./scripts/linux/path/t . +COPY ./scripts/linux/path/a . +COPY ./scripts/linux/path/kite_init . +COPY ./scripts/linux/createFolderLocalGrid.sh . +COPY ./scripts/linux/installChrome.sh . +COPY ./scripts/linux/installFirefox.sh . +COPY ./scripts/linux/installSelenium.sh . +COPY ./scripts/linux/installMaven.sh . +COPY ./scripts/linux/installDrivers.sh . +COPY ./scripts/linux/interactiveInstallation.sh . +COPY ./scripts/entrypoint.sh ./scripts/ + +ADD pom.xml /KITE/pom.xml + +VOLUME /KITE/$KITE_TEST_PATH +VOLUME /KITE/scripts + +WORKDIR /KITE/$KITE_TEST_PATH + +ENTRYPOINT ["/KITE/scripts/entrypoint.sh"] diff --git a/KITE-AppRTC-Test/configs/js.iceconnection.apprtc.config.json b/KITE-AppRTC-Test/configs/js.iceconnection.apprtc.config.json index ba3c4190..c8070e45 100644 --- a/KITE-AppRTC-Test/configs/js.iceconnection.apprtc.config.json +++ b/KITE-AppRTC-Test/configs/js.iceconnection.apprtc.config.json @@ -4,7 +4,7 @@ "grids": [ { "type": "local", - "url": "http://localhost:4444/wd/hub" + "url": "http://hub:4444/wd/hub" } ], "tests": [ @@ -17,6 +17,7 @@ "url": "https://appr.tc", "port": 30000, "testTimeout": 60, + "windowSize": "800x600", "getStats" : { "enabled": true, "statsCollectionTime": 2, @@ -30,7 +31,9 @@ "clients": [ { "browserName": "chrome", - "platform": "localhost" + "platform": "localhost", + "platform": "LINUX", + "headless": true } ] } diff --git a/KITE-AppRTC-Test/js/package.json b/KITE-AppRTC-Test/js/package.json index 04438468..4d10dc8e 100644 --- a/KITE-AppRTC-Test/js/package.json +++ b/KITE-AppRTC-Test/js/package.json @@ -12,8 +12,8 @@ }, "license": "ISC", "dependencies": { - "kite-common": "^0.1.14", "express": "^4.15.2", + "kite-common": "^0.1.14", "socket.io": "^2.2.0" } } diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..9e29595f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,32 @@ +# To execute this docker-compose yml file use `docker-compose -f up` +# Add the `-d` flag at the end for detached execution +version: "3" +services: + hub: + image: selenium/hub:3.141.59 + container_name: hub + ports: + - 4444:4444 + + chrome: + image: selenium/node-chrome:3.141.59 + depends_on: + - hub + environment: + - HUB_HOST=hub + + kite: + build: + context: . + args: + testpathdir: KITE-AppRTC-Test + configfilename: js.iceconnection.apprtc.config.json + volumes: + - /dev/shm:/dev/shm + - ./KITE-AppRTC-Test:/KITE/KITE-AppRTC-Test + - ./scripts:/KITE/scripts + depends_on: + - hub + environment: + - HUB_HOST=hub + - HUB_PORT=4444 \ No newline at end of file diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh new file mode 100755 index 00000000..b85bf418 --- /dev/null +++ b/scripts/entrypoint.sh @@ -0,0 +1,9 @@ +#! /bin/bash + +cd "/KITE/${KITE_TEST_PATH}/js" +rm -rf node_modules +npm install + +cd /KITE/${KITE_TEST_PATH} + +/KITE/r "configs/${KITE_CONFIG_NAME}"