Enable unattended install of sikuli #69

Closed
pghalliday opened this Issue Oct 14, 2014 · 25 comments

Projects

None yet

5 participants

@pghalliday

Using Sikuli 1.0.1

After googling for a while it seems that an unattended install of sikuli is not possible as interaction with a GUI is required when using the sikuli_setup.jar. I did see some mention of a zip file but think it must be for an older version as I can't find any such package.

The problem is that I wish to use sikuli to drive GUIs on build servers as part of a build process involving other tools that require GUI interaction. As I want to automate everything I also automate the deployment and set up of my build servers (using Chef). I found it ironic that the tool I want to use to automate other GUIs could only be installed by interacting with a GUI :)

Hence I'd like to make a feature request for an installer that does not require any interaction from a user, or for a desktop environment (display) to be present during installation (this is something that I also set up separately and should only need when running sikuli scripts).

It seems that any options could be specified though the launch command although it may be more difficult to run the tests after installation (these could be skipped for unattended installs on the assumption that the user knows what they're doing)

thanks for the great work,
Pete

@RaiMan
Owner
RaiMan commented Oct 14, 2014

version 1.1.0 has the possibility to run setup unattended:

java -jar sikulixsetup-1.1.0.jar options 1.1 2 3

according to the numbered options of the attended setup.

@dhoer
dhoer commented Oct 14, 2014

Great, thanks. I too was needing a way to automate Sikuli installs.

@RaiMan
Owner
RaiMan commented Oct 14, 2014

... but I have to finally test it ;-)

@RaiMan RaiMan closed this Oct 14, 2014
@pghalliday

That's great :)

@RaiMan
Owner
RaiMan commented Oct 16, 2014

available now (2014-10-16):

usage:
java -jar sikulixsetup-1.1.0.jar options x y z

x, y or z or more might be any of
1.1
1.2
1.3
2
3
4
4.1
4.2
4.3
5

The settings 4.x allow to setup stuff for other systems (1 Windows, 2 Mac, 3 Linux).
Be aware: currently the final tests will fail in this case with libraries not found ;-) but can be ignored.

The other settings are according to the numbering in the setup dialog.

@dhoer
dhoer commented Oct 22, 2014

Thanks, Kudos on adding remote server as well. It is nice to see this added to the core. I have added this to the chef sikulix cookbook: https://github.com/dhoer/chef-sikulix

@RaiMan
Owner
RaiMan commented Oct 22, 2014

@dhoer
thanks for pointing me to your solution. interesting.

anything else I can do to better support unattended setup and distribution of SikuliX?

@dhoer
dhoer commented Oct 22, 2014

Having the ability to easily configure logging on remote server would be a plus. The proxy host and port would be nice for the silent setup, even though I don't need it.

@RaiMan
Owner
RaiMan commented Oct 23, 2014

thanks - good points.

@dhoer
dhoer commented Oct 23, 2014

FYI: I released version 1.0.0 of SikuliX cookbook to Chef's Supermarket: https://supermarket.getchef.com/cookbooks/sikulix.

I had to add jvm_args attribute to SikuliX Setup and default it to '-Xmx128m' to prevent the following issue during a setup of remoteserver:
Unable to allocate 64064KB bitmaps for parallel garbage collection for the requested 2050048KB heap.

This error was on an AWS Windows 2012 R2 m3.large with Java 1.7 u67.

@RaiMan
Owner
RaiMan commented Oct 24, 2014

to understand right:
when you run setup with option 5, you get this problem?

@dhoer
dhoer commented Oct 25, 2014

Opened issue #77

@cesine cesine referenced this issue in FieldDB/FieldDB Dec 2, 2014
Closed

Run sikuli tests from Travis #1755

@cesine
cesine commented Dec 2, 2014

We can't get an unattended run of the setup.jar on a mac, on both cases the "Please read carefully before proceeding" popup appears.

tried 1.0.1 12NOV2013120000

$ java -jar sikuli-setup.jar options 1
[debug] SikuliX Setup Build: 1.0.1 12NOV2013120000
[debug] ... starting with options 1 

screen shot 2014-12-02 at 10 43 14 am

tried 1.1.0 2014-11-24_01:00nightly

$ java -jar sikulixsetup-1.1.0.jar options 1
[debug] ... starting with: options 1 
***** System Information Dump *****
...
***** System Information Dump ***** end *****
[debug] Setup in: /Users/username/sikuli
using: /Users/username/sikuli/sikulixsetup-1.1.0.jar
[debug] SikuliX Setup Build: 1.1.0 2014-11-24_01:00nightly
[debug] 
popInfo: --------------------
Please read carefully before proceeding!! 

screen shot 2014-12-02 at 10 41 03 am

@RaiMan
Owner
RaiMan commented Dec 2, 2014

see above comment from oct 16th:

simply 1 is not valid

@cesine
cesine commented Dec 2, 2014

thanks, i saw that comment and tried something from it, but didn't land at the right combo of jar version and options.

corrected example of unattended run of sikulix v1.1x :

$ java -jar sikulixsetup-1.1.0.jar options 1.1

I'm testing unattended on a ubuntu machine now (for jenkins automation)... it gets beyond the popup but something is a bit odd with the setup, I'm pretty sure it is timing out and assuming a YES, which means the unattended setup is working for me now, thanks :)

$ java -jar sikulixsetup-1.1.0.jar options 1.1
...
[debug] SikuliX Setup Build: 1.1.0 2014-11-24_01:00nightly
[debug] 
popAsk: --------------------
null
--- Native support libraries for null (sikulixlibs...)
--- Package 1 ---
1.1.0-1.jar (IDE/Scripting)
 - with Jython
Only click NO, if you want to terminate setup now!
Click YES even if you want to use local copies in Downloads!
@RaiMan
Owner
RaiMan commented Dec 2, 2014

I admit, it was a quick and dirty solution ;-)

It does not "wait" for an answer, it simply ignores the return from the "popups".
It is only a simple logging of the popup content that happens here

@cesine
cesine commented Dec 4, 2014

quick and dirty is not a problem :) its exciting to get even close to running sikulix in a continuous integration environment.

what i meant by timeout was this part:

Only click NO, if you want to terminate setup now!
Click YES even if you want to use local copies in Downloads!

Do you know if it is timing out and assuming YES, or is it waiting for user input...

Here is some more context with what is happening on Travis, so it really does appear to be requiring X11...

Dec 03, 2014 2:06:00 AM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
[debug] ... starting with: options 1.1 
[debug] Setup in: /home/travis/sikuli
using: /home/travis/sikuli/sikulixsetup-1.1.0.jar
[debug] SikuliX Setup Build: 1.1.0 2014-11-24_01:00nightly
[debug] 
popAsk: --------------------
null
--- Native support libraries for null (sikulixlibs...)
--- Package 1 ---
1.1.0-1.jar (IDE/Scripting)
 - with Jython
Only click NO, if you want to terminate setup now!
Click YES even if you want to use local copies in Downloads!
--------------------
Exception in thread "main" java.awt.HeadlessException: 
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
    at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)
    at java.awt.Window.<init>(Window.java:535)
    at java.awt.Frame.<init>(Frame.java:420)
    at java.awt.Frame.<init>(Frame.java:385)
    at javax.swing.JFrame.<init>(JFrame.java:180)
    at org.sikuli.basics.SplashFrame.<init>(SplashFrame.java:69)
    at org.sikuli.setup.RunSetup.download(RunSetup.java:1765)
    at org.sikuli.setup.RunSetup.getSikulixJarFromMaven(RunSetup.java:1836)
    at org.sikuli.setup.RunSetup.main(RunSetup.java:930)

(our setup debugging builds are here https://travis-ci.org/cesine/DyslexDisorthGame/builds )

@RaiMan
Owner
RaiMan commented Dec 4, 2014

--- Do you know if it is timing out and assuming YES, or is it waiting for user input...
Sorry for not being clear enough:
when running silently, it simply does not produce any user dialogs and hence does not wait for anything, but simply assumes yes in all cases (which accidentally fits ;-)

--- The "needs-headless"-problem is produced by the download popups.
I fixed it. You should check with the latest build, which now should run in your environment.

@dhoer
dhoer commented Dec 4, 2014

If I have time, I will add Ubuntu to the Chef recipe and test it out.

Is 1.3 jruby addons option no longer a valid?

@RaiMan
Owner
RaiMan commented Dec 4, 2014

@dhoer
--- Is 1.3 jruby addons option no longer a valid?
What is the reason for your question? It should be valid still.

@dhoer
dhoer commented Dec 4, 2014

@RaiMan
--- Is 1.3 jruby addons option no longer a valid?
What is the reason for your question? It should be valid still.

I don't see it as an option in the gui screenshot: http://www.sikulix.com/quickstart.html#qs3

@RaiMan
Owner
RaiMan commented Dec 5, 2014

Got me: have to upload an actual one ;-)

@RaiMan
Owner
RaiMan commented Dec 5, 2014

Hi Dennis,

no, this is not ok.

if ok it should look like this:
[debug] Jython: Trying to run functional test: running script statements via SikuliScript
testSetup: Jython: success
[debug] JRuby: Trying to run functional test: running script statements via SikuliScript
testSetup: JRuby: success

In your case, the Jython test run had a problem, that left the "run-only-one-script-at-a-time" in on-state, which led to that the JRuby test did not run at all.

The setup log file should have more information.
But I guess, it is due to a problem with the libVisionProxy.so

I will force the switch to be reset in any case during setup, since the tests are done here strictly sequential.

thanks.

Raimund

On 05 Dec 2014, at 00:22, Dennis Hoer notifications@github.com wrote:

Ubuntu 14.04 testing

I get this error when running options 1.1 and 1.2 together, but it exits 0. So is it safe to assume this is ok?
[debug] Jython: Trying to run functional test: running script statements via SikuliScript
[debug] JRuby: Trying to run functional test: running script statements via SikuliScript
[error] SikuliScript: can only run one at a time!
Install of java api (option 2) exits 1. What are your thought on this? I tried to get more verbose logging, but it didn't add any more detail.
[debug] Trying to run functional test: JAVA-API
vagrant@sikulix-ubuntu-1404:/usr/local/sikulix$ echo $?
1

Reply to this email directly or view it on GitHub #69 (comment).

@AnthonyMastrean

Is there a CLI option for setting the install directory? Or does the setup JAR have to be in that location?

@RaiMan
Owner
RaiMan commented Jan 25, 2015

@AnthonyMastrean
No there is no such option and will not be.
setup creates the artefacts and the other needed stuff in the folder it is located.
see your other issue: #91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment