rPath Appliance Platform Agent:Plugin Development Environment
From rPath Wiki
|
Establish an environment for rPath Appliance Platform plugin development by installing rPath Appliance Platform Agent, creating directories for development, and changing the software to development mode. This should be separate from any Conary-based appliance development (Conary Build Environment), though the resulting plugin should be packaged in Conary and added to the groups defining an appliance.
Install Software
Since cherrypy 3 is not packaged currently for rPath Linux, the following directions will allow you to setup a rPath Appliance Platform Agent Development Environment.
- rPath makes use of mercurial for version control of software. You will need to use mercurial to 'checkout' the appropriate rAPA files needed for plugin development. If you do not have mercurial installed on the system please issue the following command:
sudo conary update mercurial
- Checkout the rPath Appliance Platform Agent codebase in rPath's repository:
- hg clone http://hg.rdu.rpath.com/hg/raa/
| Extra dependencies may have to be installed on your system to complete the 'make' command. Execute the following command to install all needed software packages: |
sudo conary update make sudo xmlto tar simplejson kid:runtime ConfigObj PyPAM sudo --resolve
- Change directory into the raa directory. Run the 'make' command. This will create some needed generated files.
- Move up one directory level (i.e. cd ../)
- Create a new directory called raa-devel.
- Change directory into the raa-devel directory.
- In your raa-devel directory create symbolic links to the following files in your raa repo:
ln -s ../raa/dev.cfg ln -s ../raa/raa ln -s ../raa/raaplugins ln -s ../raa/raa-service ln -s ../raa/start-raa-service.sh ln -s ../raa/start-raa-web.sh ln -s ../raa/raa_service_dev.conf ln -s ../raa/raa/content content ln -s ../raa/raa-web
- Create a file in raa-devel called raa_service.conf that has the following one line in it (replace username with your Linux user name):
listenerUser username
- Create a file in raa-devel called custom.cfg that has the following contents (replace username with your Linux user name):
[global] server.run_user = 'username' server.run_group = 'username' server.lock_path = '.'
- Create a directory called cherrypy and enter the directory.
- Download the Cherrypy 3.0.3 tarball (from http://download.cherrypy.org/CherryPy/3.0.3/CherryPy-3.0.3.tar.gz) into the cherrypy directory on your system, and extract it.
- Create (or append to) the environment variable PYTHONPATH to point at <where you extracted>/Cherrypy-3.0.3. As an example, if one extracted the tarball to a directory /home/username/cherrypy, one would execute the command:
export PYTHONPATH=/home/username/cherrypy/CherryPy-3.0.3
- Now create test HTTPS certificates in raa-devel
../raa/distro/bin/raa-gendummycert.sh $(pwd)/test.key $(pwd)/test.crt
- Setup Plugin Generator by executing the following command:
ln -s ../raa/plugingenerator.py && ln -s ../raa/plugintemplate/
The development environment is now setup to facilitate plugin development.
Starting rAPA 3
The development environment rAPA install listens on port 8003 and 8004 by default, which is the same as the system rAPA. Make sure that rAPA is stopped on your system before launching it. You can now start rAPA by running start-raa-web and start-raa-service from raa-devel from 2 different terminals (requires sudo installed and configured for the current user). If you open a new terminal, you will need to set your $PYTHONPATH again in that terminal.
$> sudo /sbin/service raa stop $> ./start-raa-web.sh
Open a second terminal, then:
$> ./start-raa-service.sh
The URL for rAPA is http://localhost.localdomain:8004/ or https://127.0.0.1:8003/
