Difference between revisions of "Setup keystone in Eclipse"
Line 1: | Line 1: | ||
− | + | This page describes how to setup Eclipse [[PyDev]] Dev Env for keystone project. | |
− | |||
− | |||
− | |||
− | |||
− | This page describes how to setup Eclipse [[PyDev]] Dev Env for keystone project. | ||
− | + | __TOC__ | |
= Assumptions = | = Assumptions = | ||
Line 46: | Line 41: | ||
we can see where it is cloned on local directory: | we can see where it is cloned on local directory: | ||
− | [[ | + | [[File:gitclientdir.png]] |
Just shown by above figure, the code is under "/root/test/git/python-keystoneclient". | Just shown by above figure, the code is under "/root/test/git/python-keystoneclient". | ||
Line 67: | Line 62: | ||
right click on "working directory" and then choose "import project..." to import keystone into Eclipse workspace as "general project" since there is no [[PyDev]] project metadata in GIT: | right click on "working directory" and then choose "import project..." to import keystone into Eclipse workspace as "general project" since there is no [[PyDev]] project metadata in GIT: | ||
− | [[ | + | [[File:keystone.png]] |
== set keystone project as [[PyDev]] project == | == set keystone project as [[PyDev]] project == | ||
Switch to [[PyDev]] perspective and set keystone project as [[PyDev]] project: | Switch to [[PyDev]] perspective and set keystone project as [[PyDev]] project: | ||
− | [[ | + | [[File:pydevkeystone.png]] |
Call out project's properties dialogue by right context menu properties to set project's PYTHONPATH: | Call out project's properties dialogue by right context menu properties to set project's PYTHONPATH: | ||
− | [[ | + | [[File:keystonepythonpath.png]] |
== confiure keystone and setup db == | == confiure keystone and setup db == | ||
Line 96: | Line 91: | ||
* '''a)''' set up a debug configuration for keystone in Eclipse | * '''a)''' set up a debug configuration for keystone in Eclipse | ||
− | [[ | + | [[File:keystonedebugconfigure.png]] |
b. setup debug configuration | b. setup debug configuration | ||
− | [[ | + | [[File:keystoneworkdir.png]] |
c: launch keystone | c: launch keystone | ||
Line 106: | Line 101: | ||
To run we can click "Debug" button on "Debug Configuration" dialogue or run it from "Debug/Run" pull down tool bar button: | To run we can click "Debug" button on "Debug Configuration" dialogue or run it from "Debug/Run" pull down tool bar button: | ||
− | [[ | + | [[File:runningkeystone.png]] |
d: initialize keystone with keystone client | d: initialize keystone with keystone client | ||
Line 120: | Line 115: | ||
'''List of pages in this category:''' | '''List of pages in this category:''' | ||
− | << | + | <categorytree mode=pages>Eclipse</categorytree> |
---- | ---- |
Revision as of 22:49, 17 February 2013
This page describes how to setup Eclipse PyDev Dev Env for keystone project.
Contents
Assumptions
OS: redhat 6.1 bit64
Libvirtd: libvirtd and libvirt client are installed ( use "virsh -c qemu:///system list" to test its availability)
development env: GCC and related header files (for install needed python modules)
mysql: server and client, with root password for mysql root account ( use "echo "show databases" | mysql -uroot -proot" to test it)
OS user to use: root
To setup eclipse
1.make sure there is one java available: java -version.
2.download eclipse
we had better download Eclipse IDE for Java EE Developers. Please choose proper platform version according to the OS used. Unzip it into a dir, for example /root/eclipse.
3. prepare PyDev
After start the Eclipse, we install pydev with p2 site “http://pydev.org/updates”. To install it, just call out Eclipse's "install" dialogue by menu "help->install new software...".
with PyDev installed, we need to configiure PyDev preference. call out preference dialogue by menu "window->preferences":
{{http://wiki.openstack.org/Setup keystone in Eclipse?action=AttachFile&do=get&target=PydevPreferences.png||height="454px",width="612px"}}
4. install EGIT
install EGIT plugins into Eclipse with site "http://download.eclipse.org/egit/updates".
Play with Keystone
clone the client GIT repo
switch to "Git repository exploring" perspective and clone the keystoneclient Git repo "https://github.com/openstack/python-keystoneclient.git":
- {{http://wiki.openstack.org/gongysh@cn.ibm.com?action=AttachFile&do=get&target=gitkeystone.png||height="538px",width="572px"}}
we can see where it is cloned on local directory:
Just shown by above figure, the code is under "/root/test/git/python-keystoneclient".
install keystoneclient
keystoneclient will be installed on OS since in general we are not interested to have it in eclipse.
on a console, run:
"pip-python install -r tools/pip-require" is used to install pre-requisites.
clone keystone GIT repo
Clone keystone GIT repo site "https://github.com/openstack/keystone.git".
import it into Eclipse workspace
We will put keystone into Eclipse workspace and then start it there.
right click on "working directory" and then choose "import project..." to import keystone into Eclipse workspace as "general project" since there is no PyDev project metadata in GIT:
set keystone project as PyDev project
Switch to PyDev perspective and set keystone project as PyDev project:
Call out project's properties dialogue by right context menu properties to set project's PYTHONPATH:
confiure keystone and setup db
- a) use mysql database
b. setup keystone db
Run shell scripts below to create keystone db:
And Run the shell below to create tables for keystone:
play with keystone
- a) set up a debug configuration for keystone in Eclipse
b. setup debug configuration
c: launch keystone
To run we can click "Debug" button on "Debug Configuration" dialogue or run it from "Debug/Run" pull down tool bar button:
d: initialize keystone with keystone client
Run the following scripts to do the initiazing to popluate the first user "admin" with password "password":
To check, we can run keystone client:
List of pages in this category: