From Fedora Project Wiki

(Created page with '= Prerequisities = Installed Fedora 14, preferably in a virtual environment. = Installation = Install and configure mysql yum install mysql-server chkconfig mysqld on serv...')
 
No edit summary
Line 6: Line 6:


Install and configure mysql
Install and configure mysql
  yum install mysql-server
  yum install mysql-server
  chkconfig mysqld on
  chkconfig mysqld on
Line 20: Line 19:


Prepare virtualenv environment
Prepare virtualenv environment
  yum install gcc sqlite-devel python-virtualenv
  yum install gcc sqlite-devel python-virtualenv


Line 29: Line 27:


Download ResultsDB from GIT
Download ResultsDB from GIT
  git clone git://git.fedorahosted.org/ResultsDB.git resultsdb
  git clone git://git.fedorahosted.org/ResultsDB.git resultsdb
  cd resultsdb/resultsdb
  cd resultsdb/resultsdb


Install dependencies and setup the application
Install dependencies and setup the application
  yum install python-pycurl python-fedora MySQL-python
  yum install python-pycurl python-fedora MySQL-python
  python setup.py develop
  python setup.py develop
  paster setup-app development.ini
  paster setup-app development.ini


= Running ResultsDB =
= ResultsDB =


Start the ResultsDB instance in [http://www.manpagez.com/man/1/screen/ screen]
screen -S resultsdb
paster serve development.ini --reload


screen
Turbogears welcome screen should be now visible on [http://localhost:8081 http://localhost:8081]. Either press <code>Ctrl+ad</code> to send screen to background, or open another terminal.
paster serve development.ini --reload


Turbogears welcome screen should be now visible on [http://localhost:8081], Press
== Test the XMLRPC interface ==
# press Ctrl+ad to send screen to background, or open another terminal
python


import xmlrpclib
s = xmlrpclib.ServerProxy("http://localhost:8081/xmlrpc", allow_none = 1)
s.get_metadata("https://fedoraproject.org/wiki/User:Jskladan/Sandbox:Rpmlint_Testcase_Metadata")


# test xmlrpc interface
Expected result:
python
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy("http://localhost:8081/xmlrpc", allow_none = 1)
>>> s.get_metadata("https://fedoraproject.org/wiki/User:Jskladan/Sandbox:Rpmlint_Testcase_Metadata")
  {'required_keyval': ['pkg_name', 'envr', 'arch', 'owner']}
  {'required_keyval': ['pkg_name', 'envr', 'arch', 'owner']}


# shut down the tg app & virtualenv
Exit Python shell
screen -r
exit()
# press ctrl+c to kill the app
 
deactivate
== Stop the application ==
 
If you used the screen terminal to run ResultsDB, reattach it using
screen -r resultsdb
or switch to the terminal window in which you started the application.
 
 
Press <code>Ctrl+c</code> to kill the running Turbogears application, and kill the virtualenv
deactivate




Category:ResultsDB
Category:ResultsDB

Revision as of 13:29, 17 May 2011

Prerequisities

Installed Fedora 14, preferably in a virtual environment.

Installation

Install and configure mysql

yum install mysql-server
chkconfig mysqld on
service mysqld start
/usr/bin/mysqladmin -u root password 'new-password'
mysql -u root -p
create database resultsdb;
grant usage on *.* to resultsdb@localhost identified by '9zWyNtmBmHcUe6Yn';
grant all privileges on resultsdb.* to resultsdb@localhost;
exit

Prepare virtualenv environment

yum install gcc sqlite-devel python-virtualenv
virtualenv tg2env
cd tg2env
source bin/activate
easy_install -i http://www.turbogears.org/2.1/downloads/current/index tg.devtools

Download ResultsDB from GIT

git clone git://git.fedorahosted.org/ResultsDB.git resultsdb
cd resultsdb/resultsdb

Install dependencies and setup the application

yum install python-pycurl python-fedora MySQL-python
python setup.py develop
paster setup-app development.ini

ResultsDB

Start the ResultsDB instance in screen

screen -S resultsdb
paster serve development.ini --reload

Turbogears welcome screen should be now visible on http://localhost:8081. Either press Ctrl+ad to send screen to background, or open another terminal.

Test the XMLRPC interface

python
import xmlrpclib
s = xmlrpclib.ServerProxy("http://localhost:8081/xmlrpc", allow_none = 1)
s.get_metadata("https://fedoraproject.org/wiki/User:Jskladan/Sandbox:Rpmlint_Testcase_Metadata")

Expected result:

{'required_keyval': ['pkg_name', 'envr', 'arch', 'owner']}

Exit Python shell

exit()

Stop the application

If you used the screen terminal to run ResultsDB, reattach it using

screen -r resultsdb

or switch to the terminal window in which you started the application.


Press Ctrl+c to kill the running Turbogears application, and kill the virtualenv

deactivate


Category:ResultsDB