Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-containers: change sakuli runtime to usermode, to support openshift #218

Closed
toschneck opened this issue Oct 31, 2016 · 9 comments
Closed

Comments

@toschneck
Copy link
Contributor

toschneck commented Oct 31, 2016

Since ConSol/docker-headless-vnc-container#3 is closed we can no change the sakuli implementation to support openshift

@toschneck toschneck added this to the rel-v1.1 milestone Oct 31, 2016
@toschneck toschneck self-assigned this Oct 31, 2016
toschneck pushed a commit that referenced this issue Oct 31, 2016
@rbo rbo self-assigned this Nov 7, 2016
@rbo
Copy link

rbo commented Nov 7, 2016

feature/#218_docker_usermod_openshift - sakuli-ubuntu-xfce works with disabled chmod -R a+rw $2. I think we should set a umask and don't run chmod. @toschneck what do you think?

@rbo
Copy link

rbo commented Nov 7, 2016

Added umask and remove chmod. Leeks very well:

     2252      4 drwxrwxr-x   5 root     root         4096 Nov  7 16:07 /sakuli/example_test_suites/example_xfce/
     4171      4 drwxrwxrwx   4 1984     root         4096 Nov  7 16:07 /sakuli/example_test_suites/example_xfce/_logs
     4183      4 drwxrwxrwx   2 1984     root         4096 Nov  7 16:07 /sakuli/example_test_suites/example_xfce/_logs/playback
     4543      4 -rw-rw-rw-   1 1984     root         2707 Nov  7 16:07 /sakuli/example_test_suites/example_xfce/_logs/index.htm
     4538      8 -rw-rw-rw-   1 1984     root         4586 Nov  7 16:07 /sakuli/example_test_suites/example_xfce/_logs/sakuli_demo__07Nov2016__16_07_08.htm
     4174     12 -rw-rw-rw-   1 1984     root         9162 Nov  7 16:07 /sakuli/example_test_suites/example_xfce/_logs/_sakuli.log
     4172      4 drwxrwxrwx   2 1984     root         4096 Nov  7 16:07 /sakuli/example_test_suites/example_xfce/_logs/_screenshots

@rbo
Copy link

rbo commented Nov 7, 2016

"works"

ERROR [2016-11-07 16:50:08.427] - Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.sikuli.script.App

@rbo
Copy link

rbo commented Nov 7, 2016

It looks like the base image consol/ubuntu-xfce-vnc:dev is the problem:
Tested with minor adjustments:

diff --git a/docker/sakuli-ubuntu-xfce/Dockerfile b/docker/sakuli-ubuntu-xfce/Dockerfile
index 14ccd61..9e0f774 100644
--- a/docker/sakuli-ubuntu-xfce/Dockerfile
+++ b/docker/sakuli-ubuntu-xfce/Dockerfile
@@ -1,6 +1,7 @@
 # This Dockerfile is used to build an sakuli image based on Ubuntu

-FROM consol/ubuntu-xfce-vnc:1.0.2
+FROM consol/ubuntu-xfce-vnc:dev
+USER 0
 MAINTAINER Tobias Schneck "[email protected]"
 ENV REFRESHED_AT 2016-11-02

diff --git a/docker/sakuli-ubuntu-xfce/scripts/sakuli_startup.sh b/docker/sakuli-ubuntu-xfce/scripts/sakuli_startup.sh
index 40c4766..7d3f3ae 100644
--- a/docker/sakuli-ubuntu-xfce/scripts/sakuli_startup.sh
+++ b/docker/sakuli-ubuntu-xfce/scripts/sakuli_startup.sh
@@ -1,6 +1,6 @@
 #!/bin/bash

-/root/scripts/vnc_startup.sh
+/headless/scripts/vnc_startup.sh

 # modify $SAKULI_TEST_SUITE permissions to ensure, that volume-mounted log files can be deleted afterwards
 modify_testsuite_permissions(){
@@ -33,4 +33,4 @@ if [ "${1:0:1}" == "-" ] || [ "${1:0:3}" == "run" ] || [ "${1:0:7}" == "encrypt"
         exit $res
 else
         exec $1
-fi
\ No newline at end of file
+fi

Errro

        ======== test case "case1" ended with ERRORS =================
        test case id: case1
        name: case1
        RESULT STATE: ERRORS
        result code: 4
        ERRORS:Unexpected error during creating an instance of class 'org.sakuli.actions.environment.Application'
                        Suppressed EXCEPTION: null
        db primary key: -1
        duration: -1.0 sec.
        warning time: 40 sec.
        critical time: 60 sec.
        start URL: http://sahi.example.com/_s_/dyn/Driver_initialized
        last URL: null
===========  SAKULI Testsuite "example_xfce" execution FINISHED - ERRORS ======================

ERROR [2016-11-07 17:04:17.119] - ERROR:
CASE "case1": Unexpected error during creating an instance of class 'org.sakuli.actions.environment.Application'
                Suppressed EXCEPTION: null

SAKULI_RETURN_VAL: 6

Update: Centos works very well with the same small adjustments.

@toschneck
Copy link
Contributor Author

@rbo so far as remember chmod i only have added, if you mount a testsuite into the container, that the log and erros files won't get inaccessible. So i think we don't need it anymore if we start the container as normal user. Do you know who other images handle the file permissions of mounted volumes as non-root container?

@rbo
Copy link

rbo commented Nov 8, 2016

Do you know who other images handle the file permissions of mounted volumes as non-root container?

I think I've read something with chmod 777 and NFS....

@rbo
Copy link

rbo commented Nov 8, 2016

sakuli-centos-xfce, works very well:

...
===========  SAKULI Testsuite "example_xfce" execution FINISHED - OK ======================

SAKULI_RETURN_VAL: 0

@rbo
Copy link

rbo commented Nov 9, 2016

Problem with sakuli-ubuntu-xfce image: https://gist.github.com/rbo/e356c375d2ac615512487f8f28f41212

toschneck pushed a commit that referenced this issue Jan 27, 2017
toschneck pushed a commit that referenced this issue Jan 31, 2017
toschneck pushed a commit that referenced this issue Jan 31, 2017
toschneck pushed a commit that referenced this issue Feb 9, 2017
- call sakuli_startup from a subshell to fix weired environment variable passing and firefox startup
- smaller refactoring of startup script: move to a more generic place `/dockerstartup`
toschneck pushed a commit that referenced this issue Feb 13, 2017
@toschneck
Copy link
Contributor Author

toschneck commented Feb 16, 2017

also add some correct heap sizing due to this fact: http://matthewkwilliams.com/index.php/2016/03/17/docker-cgroups-memory-constraints-and-java-cautionary-tale/

Solution: script from PR docker-library/openjdk#71

toschneck pushed a commit that referenced this issue Feb 17, 2017
toschneck pushed a commit that referenced this issue Feb 17, 2017
toschneck pushed a commit that referenced this issue Feb 20, 2017
toschneck pushed a commit that referenced this issue Feb 20, 2017
toschneck pushed a commit that referenced this issue Feb 20, 2017
toschneck pushed a commit that referenced this issue Feb 20, 2017
toschneck pushed a commit to ConSol/sakuli-examples that referenced this issue Mar 3, 2017
toschneck pushed a commit that referenced this issue Mar 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants