-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feature/304_forward_case_and_step_results
- Loading branch information
Showing
54 changed files
with
7,141 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* check sakuli-go-wrapper not deployed? => fix sakuli-ui feature branche | ||
* change sakuli-ui project to new plugin | ||
* cleanup not used tags, files and dockerimages |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# This Dockerfile is used to build a sakuli image based on Ubuntu | ||
|
||
FROM openjdk:8-jre | ||
|
||
MAINTAINER Tobias Schneck "tobias.schneck@consol.de" | ||
ENV REFRESHED_AT 2018-03-02 | ||
|
||
#### currently not supported | ||
#LABEL io.k8s.description="Sakuli UI container for managing Sakuli tests" \ | ||
# io.k8s.display-name="Sakuli UI container" \ | ||
# io.openshift.expose-services="8080:http" \ | ||
# io.openshift.tags="sakuli, java, sakuli-ui" \ | ||
# io.openshift.non-scalable=true | ||
|
||
### INST config | ||
ENV SAKULI_UI_INST_DIR=/app \ | ||
TERM=xterm \ | ||
STARTUPDIR=/dockerstartup \ | ||
INST_SCRIPTS=/root/install | ||
|
||
### Environment config (overwritable) | ||
ENV HTTP_PORT=8080 \ | ||
SAKULI_UI_USER=admin \ | ||
SAKULI_UI_PW=sakuli \ | ||
SAKULI_UI_DOCKER_USER_ID=1000 \ | ||
SAKULI_ROOT_DIR=/opt/sakuli-ui-root | ||
|
||
ADD ./sakuli-ui/src/common/install/ $INST_SCRIPTS/ | ||
RUN find $INST_SCRIPTS -name '*.sh' -exec chmod a+x {} + | ||
|
||
### Intsall basics for jvm & docker | ||
RUN $INST_SCRIPTS/add_jvm_options.sh | ||
RUN $INST_SCRIPTS/docker.sh | ||
RUN $INST_SCRIPTS/docker-compose.sh | ||
|
||
### Install Sakuli UI | ||
ARG SAKULI_VERSION=1.2.0-SNAPSHOT-308-sakuli-ui | ||
RUN $INST_SCRIPTS/sakuli_ui.sh | ||
|
||
#### configure startup | ||
ADD ./sakuli-ui/src/common/scripts/ $STARTUPDIR | ||
RUN $INST_SCRIPTS/set_user_permission.sh $STARTUPDIR $HOME | ||
|
||
## Connection port for Web Application: | ||
EXPOSE $HTTP_PORT | ||
USER $SAKULI_UI_DOCKER_USER_ID | ||
|
||
ENTRYPOINT ["/dockerstartup/startup.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
### every exit != 0 fails the script | ||
set -e | ||
set -u | ||
|
||
echo "Add JVM options" | ||
|
||
# add source jvm_options.sh script to set correct java JVM options on startup | ||
echo 'source $STARTUPDIR/jvm_options.sh' >> $HOME/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
version=1.19.0 | ||
echo "install latest docker-compose $version" | ||
curl -L https://github.com/docker/compose/releases/download/$version/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose | ||
chmod +x /usr/local/bin/docker-compose | ||
|
||
echo "------------ docker-compose version -----------" | ||
docker-compose version | ||
|
||
echo ".... done!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
### every exit != 0 fails the script | ||
set -e | ||
set -u | ||
|
||
echo "Install Docker CLI from Docker Inc. repositories." | ||
curl -sSL https://get.docker.com/ | sh \ | ||
&& useradd $SAKULI_UI_DOCKER_USER_ID -m -s /bin/bash \ | ||
&& usermod -aG docker $SAKULI_UI_DOCKER_USER_ID | ||
|
||
apt-get clean -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
### every exit != 0 fails the script | ||
set -e | ||
set -u | ||
|
||
LABS_URL=https://labs.consol.de/sakuli/install/sakuli-v${SAKULI_VERSION}.zip | ||
dest=${SAKULI_UI_INST_DIR} | ||
echo "Download and Install Sakuli UI: $dest" | ||
|
||
tmpdir=/tmp/sakuli-ui | ||
mkdir -p $tmpdir && cd $tmpdir | ||
|
||
mkdir -p "$dest" | ||
|
||
echo "DOWNLOAD URL: $LABS_URL" | ||
wget $LABS_URL | ||
unzip -j *.zip '*/sakuli-ui-web.jar' -d "$dest/" | ||
|
||
echo "set correct permissions" | ||
$INST_SCRIPTS/set_user_permission.sh $dest | ||
|
||
rm -rf $tmpdir |
14 changes: 14 additions & 0 deletions
14
docker/sakuli-ui/src/common/install/set_user_permission.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
### every exit != 0 fails the script | ||
set -e | ||
if [[ -z $DEBUG ]]; then | ||
verbose="-v" | ||
fi | ||
|
||
for var in "$@" | ||
do | ||
echo "fix permissions for: $var" | ||
find "$var"/ -name '*.sh' -exec chmod $verbose a+x {} + | ||
find "$var"/ -name '*.desktop' -exec chmod $verbose a+x {} + | ||
chgrp -R 0 "$var" && chmod -R $verbose a+rw "$var" && find "$var" -type d -exec chmod $verbose a+x {} + | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/usr/bin/env bash | ||
# Return reasonable JVM options to run inside a Docker container where memory and | ||
# CPU can be limited with cgroups. | ||
# https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/parallel.html | ||
# | ||
# The script can be used in a custom CMD or ENTRYPOINT | ||
# | ||
# source jvm_options | ||
|
||
# Options: | ||
# JVM_HEAP_RATIO=0.5 Ratio of heap size to available memory | ||
|
||
# If Xmx is not set the JVM will use by default 1/4th (in most cases) of the host memory | ||
# This can cause the Kernel to kill the container if the JVM memory grows over the cgroups limit | ||
# because the JVM is not aware of that limit and doesn't invoke the GC | ||
# Setting it by default to 0.5 times the memory limited by cgroups, customizable with JVM_HEAP_RATIO | ||
|
||
echo "---------------------- Resolve _JAVA_OPTIONS -----------------------------------" | ||
if [ -z "$JVM_HEAP_XMX" ] ; then | ||
CGROUPS_MEM=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes) | ||
echo CGROUPS_MEM: $CGROUPS_MEM bytes, $(($CGROUPS_MEM/1024/1024)) MB | ||
|
||
MEMINFO_MEM=$(($(awk '/MemTotal/ {print $2}' /proc/meminfo)*1024)) | ||
echo MEMINFO_MEM: $MEMINFO_MEM bytes, $(($MEMINFO_MEM/1024/1024)) MB | ||
|
||
MEM_USABLE=$(($MEMINFO_MEM>$CGROUPS_MEM?$CGROUPS_MEM:$MEMINFO_MEM)) | ||
# prevent float issue if $CGROUPS_MEM > bash max value, see https://github.com/ConSol/sakuli/issues/280 | ||
MEM_USABLE=$(($CGROUPS_MEM>$MEMINFO_MEM?$MEMINFO_MEM:$MEMINFO_MEM)) | ||
echo "" | ||
echo MEM_USABLE: $MEM_USABLE bytes, $(($MEM_USABLE/1024/1024)) MB | ||
|
||
JVM_HEAP_RATIO=${JVM_HEAP_RATIO:-0.5} | ||
echo "JVM_HEAP_RATIO $JVM_HEAP_RATIO of MEM $(($MEM_USABLE/1024/1024)) MB" | ||
JVM_HEAP_XMX=$(awk '{printf("%d",$1*$2/1024^2)}' <<<" ${MEM_USABLE} ${JVM_HEAP_RATIO} ") | ||
|
||
JVM_HEAP_XMX_MAX=${JVM_HEAP_XMX_MAX:-300} | ||
JVM_HEAP_XMX_MIN=${JVM_HEAP_XMX_MIN:-96} | ||
if [ $JVM_HEAP_XMX -gt $JVM_HEAP_XMX_MAX ]; then | ||
echo "calculated JVM_HEAP_XMX $JVM_HEAP_XMX MB is too high, choose JVM_HEAP_XMX_MAX: $JVM_HEAP_XMX_MAX MB" | ||
JVM_HEAP_XMX=$JVM_HEAP_XMX_MAX | ||
fi | ||
if [ $JVM_HEAP_XMX -lt $JVM_HEAP_XMX_MIN ]; then | ||
echo "calculated JVM_HEAP_XMX $JVM_HEAP_XMX MB is too small, try to use at the JVM_HEAP_XMX_MIN ($JVM_HEAP_XMX_MIN MB)" | ||
if [ $MEM_USABLE -lt $JVM_HEAP_XMX_MIN ]; then | ||
echo "Container need at least $JVM_HEAP_XMX_MIN MB memory for the JVM! Stop container starup!" | ||
exit -1 | ||
fi | ||
JVM_HEAP_XMX=$JVM_HEAP_XMX_MIN | ||
fi | ||
|
||
fi | ||
echo "" | ||
echo "JVM_HEAP_XMX: $JVM_HEAP_XMX MB" | ||
|
||
# set correct java startup | ||
export _JAVA_OPTIONS="-Duser.home=$HOME -Xmx${JVM_HEAP_XMX}m" | ||
# add docker jvm flags, can maybe removed with JDK9, see https://github.com/ConSol/sakuli/issues/291 | ||
export _JAVA_OPTIONS="$_JAVA_OPTIONS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap" | ||
|
||
echo "set _JAVA_OPTIONS: $_JAVA_OPTIONS" | ||
echo "--------------------------------------------------------------------------------" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
### | ||
# Startup Script for the Sakuli headless testing container | ||
### | ||
|
||
# have to be added to hold all env vars correctly | ||
# also will source $STARTUPDIR/generate_container_user | ||
source $HOME/.bashrc | ||
set -e | ||
set -u | ||
|
||
echo -e "\n\n------------------ START SAKULI UI CONTAINER ---------------------------" | ||
|
||
args="$@" | ||
if [[ "$1" == -* ]]; then | ||
args="${SAKULI_ROOT_DIR} $@" | ||
fi | ||
|
||
javaARG="-Djava.security.egd=file:/dev/./urandom -Dsakuli.ui.root.directory=$args -jar ${SAKULI_UI_INST_DIR-/app}/sakuli-ui-web.jar" | ||
|
||
echo "Executing: 'java $javaARG'" | ||
java -Dsecurity.default-username=${SAKULI_UI_USER} -Dsecurity.default-password=${SAKULI_UI_PW} $javaARG | ||
|
||
echo -e "\n\n------------------ FINISHED SAKULI UI CONTAINER ------------------------" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
# have to be added to hold all env vars correctly | ||
|
||
main() { | ||
export SAKULI_UI_DOCKER_USER_ID=$(id -u) | ||
# If arg 1 is not for sakuli ui jar, execute as it is. | ||
if [[ "$1" == /* ]] || [[ "$1" == -* ]]; then | ||
$STARTUPDIR/sakuli_startup.sh "$@" | ||
else | ||
# execute any other command | ||
echo -e "\n\n------------------ EXECUTE COMMAND ------------------" | ||
echo "Executing command: '$@'" | ||
exec "$@" | ||
fi | ||
} | ||
|
||
if [ $# -gt 0 ]; then | ||
# pass all parameters | ||
main "$@" | ||
else | ||
# no parameters | ||
# - run the Sakuli UI at $SAKULI_UI_ROOT, if set | ||
# or | ||
# - run at /opt/sakuli-ui(fallback) | ||
main "${SAKULI_UI_ROOT-/opt/sakuli-ui-root}" | ||
fi |
Oops, something went wrong.