Difference between revisions of "Setup keystone in Eclipse"
m (add category contribute) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 14: | Line 14: | ||
OS user to use: root | OS user to use: root | ||
− | = To setup | + | = To setup Eclipse = |
− | 1. | + | 1. Make sure there is one Java available: java -version. |
− | 2. | + | 2. Download Eclipse |
− | + | We preferably download Eclipse IDE for Java EE Developers. Please choose the proper platform version according to the OS used. Unzip it into a dir, for example /root/eclipse. | |
− | 3. | + | 3. Prepare [[PyDev]] |
− | After start the Eclipse, we install pydev with p2 site | + | 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 configure [[PyDev]] preference. call out preference dialogue by menu "window->preferences": | |
− | + | [[file:PydevPreferences.png]] | |
− | 4. | + | 4. Install EGIT |
− | + | Install EGIT plugins into Eclipse with site http://download.eclipse.org/egit/updates. | |
= Play with Keystone = | = 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": | |
− | + | [[file:gitkeystone.png]] | |
− | + | We can see where it is cloned on local directory: | |
[[File:gitclientdir.png]] | [[File:gitclientdir.png]] | ||
Line 45: | Line 45: | ||
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". | ||
− | == | + | == Install Keystoneclient == |
− | + | Keystoneclient will be installed on OS since in general we are not interested to have it in Eclipse. | |
− | + | On a console, run: | |
− | |||
− | |||
− | + | <pre>pip install -r tools/pip-require </pre> is used to install pre-requisites. | |
− | == | + | == Clone keystone GIT repo == |
Clone keystone GIT repo site "https://github.com/openstack/keystone.git". | 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. | 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: | |
[[File:keystone.png]] | [[File:keystone.png]] | ||
− | == | + | == 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: | ||
Line 73: | Line 71: | ||
[[File:keystonepythonpath.png]] | [[File:keystonepythonpath.png]] | ||
− | == | + | == Configure keystone and setup db == |
− | * '''a)''' | + | * '''a)''' Use mysql database |
− | |||
− | |||
− | + | * '''b)''' setup keystone db | |
Run shell scripts below to create keystone db: | Run shell scripts below to create keystone db: | ||
− | + | ||
− | |||
And Run the shell below to create tables for keystone: | And Run the shell below to create tables for keystone: | ||
− | |||
− | |||
− | == | + | == Play with keystone == |
− | * '''a)''' | + | |
+ | * '''a)''' Set up a debug configuration for keystone in Eclipse | ||
[[File:keystonedebugconfigure.png]] | [[File:keystonedebugconfigure.png]] | ||
− | + | ||
+ | * '''b)''' Setup debug configuration | ||
[[File:keystoneworkdir.png]] | [[File:keystoneworkdir.png]] | ||
− | c | + | |
+ | * '''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: | To run we can click "Debug" button on "Debug Configuration" dialogue or run it from "Debug/Run" pull down tool bar button: | ||
Line 103: | Line 99: | ||
[[File:runningkeystone.png]] | [[File:runningkeystone.png]] | ||
− | |||
− | Run the following scripts to do the | + | * '''d)''' Initialize keystone with keystone client |
− | + | ||
− | + | Run the following scripts to do the initializing to populate the first user "admin" with password "password": | |
To check, we can run keystone client: | To check, we can run keystone client: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ---- | + | ----- |
+ | [[Category:Contribute]] |
Latest revision as of 00:42, 23 September 2014
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 preferably download Eclipse IDE for Java EE Developers. Please choose the 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 configure PyDev preference. call out preference dialogue by menu "window->preferences":
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":
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 install -r tools/pip-requireis 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:
Configure 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 initializing to populate the first user "admin" with password "password":
To check, we can run keystone client: