DeveloperGuide
From XtremWebCH Wiki
Contents |
Platform developer guide
SVN repository
The SVN repository is at svn://www.xtremwebch.net/svn/xwch
A daily snapshot of the SVN trunk is available here: [1], the results of its automatic build here: [2] and a history of builds here: [3]
Moreover, a list of changes (svn log -v) is available here: [4] and a list of critiques of the latest build here: [5]
Please contact our mailing list if you need SVN access.
API documentation
The client and High-Level API's are probably what you are looking for.
- Client API: [6] .. or go directly to xwch client API summary.
- High-Level and Command Line API's [7]
- Coordinator (beans): [8]
- Worker: [9]
- Warehouse: [10]
Demo applications
You will find a description of all the components + build, deploy and test examples in the README file [15].
Developer VM
A virtual machine that can be used for demos is available at [16]. root password is "xwchrocks". In the /root directory you find a script that downloads the SVN trunk, all the required components, compiles everything, starts a coordinator, a worker, and a warehouse, and runs a test.
If you are using VirtualBox to run this VM, please create a host-only adapter by File -> Preferences -> Network -> Add host-only network and enable it in the VM settings.
After running the script, you can access the coordinator with your browser: http://YOUR-VM-IP:8080/XWCHWeb
Normal disclaimers: since this is SVN trunk, some functionality may be unavailable or buggy.
FAQ
Why doesn't my job run well with a Windows worker?
Does you job produce any output? If not, the worker may think it is inactive. Here's a simple way of making a script that can be used for debugging on Windows workers:
echo starting > foo
yourexecuble >> foo 2>foo.err
echo done >>foo
.. where yourexecutable is the executable for Windows (see the first question about modules and executables). Naturally, your application will need to get the files "foo" and "foo.err" as output.
For debugging, how can I make my job run in some specific worker?
Use extrafields="host;workername". See AddJob method[17] for more details.
Can I run my client over HTTPS, for increased security?
Yes, you'll find an example of that in clients/democlient-java's README. However, please bear in mind that the communication between the warehouse and the client is not crypted, even if the communication between the coordinator and client is.
Application developer guide
To build an application, you need an access to the platform (coordinator) and at least 1 worker and 1 warehouse need to be connected to the coordinator. Please note that you need to register an account with the coordinator GUI. You'll get a clientID, a token that will be used in client-server communication. Please note, too, that your account needs to be validated by an administrator. Only after that you can log in and use your applications.
XWCH users can use a module (pre-defined executables) if an administrator has allowed then an access to it. A normal user cannot create a module, you need admin rights for that.
The simplest way to create an application is to call a module. XWCH provides an API and a job description language for that.
The command line client is available here: [18]. After registration (see above), you can use the example job.x below by java -jar XWCH_CLI_PACK.jar -server http://YOURSERVER:YOURPORT -f job.x
type = XWCHJob client_ID = INSERT YOUR CLIENT ID HERE applicationname = apptest moduleID = INSERT THE MODULE ID HERE datainputfilename = data.zip binaryinputfilename = binary.zip jobname = TESTJOB outputfilename = TEST_OUT workercommandline =hello.bat worker listeoutputfiles = foo.txt os = LINUX
The clientdemo.zip file [19] contains a README file explaining the job submit process.