RaiMan / SikuliX-2014

SikuliX version 1.1.2 (until February 2018)
http://sikulix.com
806 stars 234 forks source link

Enable unattended install of sikuli #69

Closed pghalliday closed 10 years ago

pghalliday commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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

RaiMan commented 10 years ago

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

pghalliday commented 10 years ago

That's great :)

RaiMan commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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

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

dhoer commented 9 years ago

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 commented 9 years ago

thanks - good points.

dhoer commented 9 years ago

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 commented 9 years ago

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

dhoer commented 9 years ago

Opened issue #77

cesine commented 9 years ago

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 commented 9 years ago

see above comment from oct 16th:

simply 1 is not valid

cesine commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

--- 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 commented 9 years ago

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 commented 9 years ago

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

dhoer commented 9 years ago

@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 commented 9 years ago

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

RaiMan commented 9 years ago

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 https://github.com/RaiMan/SikuliX-2014/issues/69#issuecomment-65722231.

AnthonyMastrean commented 9 years ago

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

RaiMan commented 9 years ago

@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: https://github.com/RaiMan/SikuliX-2014/issues/91