Installing AAA in Karaf...


Nguyen, Liem Manh <liem_m_nguyen@...>
 

Hi guys,

 

Here are the steps I go through to get AAA installed on Karaf (the install stuff should go into the installation guide later, but at least just the contents for now):

 

1.       Build the AAA code

2.       Grab the controller code (git clone https://git.opendaylight.org/gerrit/p/controller.git)

3.       Build it!

4.       cd opendaylight/distribution/opendaylight-karaf/target/assembly

5.       bin/karaf (you may need to chmod u+x it)

6.       Add AAA repo (within karaf shell):  repo-add mvn:org.opendaylight.aaa/features-aaa/0.1.0-SNAPSHOT/xml/features

7.       List ODL features:  feature:list | grep odl  (you should see aaa in there as well).  There are 4 aaa features:

a.       odl-aaa-authn (Authentication feature)

b.      odl-aaa-authn-sssd (Authentication with SSSD)

c.       odl-aaa-authz (Authorization feature)

d.      odl-aaa-all (AAA features—includes all the above)

8.       You can then install any listed feature.  Example:  feature:install odl-aaa-authn

9.       Sanity check to see if AAA is up:  issue a token request:  curl -si -d 'grant_type=password&username=admin&password=odl&scope=pepsi' http://localhost:8181/oauth2/token

10.   If that above returns an error, something is wrong:  check the log under opendaylight/distribution/opendaylight-karaf/target/assembly/data/log.  You can also issue log:display in the Karaf shell and grep for stuff as well.

 

If you make your changes to your code, after rebuilding, you can refresh the repo in the Karaf shell by:

 

1.       Feature:uninstall <your feature>

2.       Repo-refresh

3.       Feature:install <your feature>

 

There may be a better way to hot deploy your code, but I don’t know how to do it yet…  If you do, please speak up J.

 

Other useful things I find in Karaf shell:

 

1.       Web:list (show you all the web endpoints you have)

2.       Feature:install webconsole (this installs the web console at http://localhost:8181/system/console/ username:karaf/password:karaf)  This provides a great tool to see how things are wired, what services/bundles/features are available, configuration, etc… tons of stuff.

 

 

For checking in your code, this Wiki page is a good start:  https://wiki.opendaylight.org/view/GettingStarted:Pulling,_Hacking,_and_Pushing_All_the_Code_from_the_CLI

 

After the setup as shown by the above wiki page, check-in process should be as simple as:

 

1.       Git checkout –b <your topic branch name>

2.       Git commit –a –s –m “comments for your checkin”

3.       Git review

4.       Go to Gerrit and invite at least 1 reviewer to review your code

 

Cheers,

Liem

 

 


Nguyen, Liem Manh <liem_m_nguyen@...>
 

FYI…

 

>> There may be a better way to hot deploy your code, but I don’t know how to do it yet… 

 

Bundle:watch <bundle id>  will allow you to hot deploy your bundle when you build it.

 

Liem

 

From: Nguyen, Liem Manh
Sent: Thursday, August 21, 2014 11:14 AM
To: 'aaa-dev@...'
Cc: 'Sujatha Joseph'
Subject: Installing AAA in Karaf...

 

Hi guys,

 

Here are the steps I go through to get AAA installed on Karaf (the install stuff should go into the installation guide later, but at least just the contents for now):

 

1.       Build the AAA code

2.       Grab the controller code (git clone https://git.opendaylight.org/gerrit/p/controller.git)

3.       Build it!

4.       cd opendaylight/distribution/opendaylight-karaf/target/assembly

5.       bin/karaf (you may need to chmod u+x it)

6.       Add AAA repo (within karaf shell):  repo-add mvn:org.opendaylight.aaa/features-aaa/0.1.0-SNAPSHOT/xml/features

7.       List ODL features:  feature:list | grep odl  (you should see aaa in there as well).  There are 4 aaa features:

a.       odl-aaa-authn (Authentication feature)

b.      odl-aaa-authn-sssd (Authentication with SSSD)

c.       odl-aaa-authz (Authorization feature)

d.      odl-aaa-all (AAA features—includes all the above)

8.       You can then install any listed feature.  Example:  feature:install odl-aaa-authn

9.       Sanity check to see if AAA is up:  issue a token request:  curl -si -d 'grant_type=password&username=admin&password=odl&scope=pepsi' http://localhost:8181/oauth2/token

10.   If that above returns an error, something is wrong:  check the log under opendaylight/distribution/opendaylight-karaf/target/assembly/data/log.  You can also issue log:display in the Karaf shell and grep for stuff as well.

 

If you make your changes to your code, after rebuilding, you can refresh the repo in the Karaf shell by:

 

1.       Feature:uninstall <your feature>

2.       Repo-refresh

3.       Feature:install <your feature>

 

There may be a better way to hot deploy your code, but I don’t know how to do it yet…  If you do, please speak up J.

 

Other useful things I find in Karaf shell:

 

1.       Web:list (show you all the web endpoints you have)

2.       Feature:install webconsole (this installs the web console at http://localhost:8181/system/console/ username:karaf/password:karaf)  This provides a great tool to see how things are wired, what services/bundles/features are available, configuration, etc… tons of stuff.

 

 

For checking in your code, this Wiki page is a good start:  https://wiki.opendaylight.org/view/GettingStarted:Pulling,_Hacking,_and_Pushing_All_the_Code_from_the_CLI

 

After the setup as shown by the above wiki page, check-in process should be as simple as:

 

1.       Git checkout –b <your topic branch name>

2.       Git commit –a –s –m “comments for your checkin”

3.       Git review

4.       Go to Gerrit and invite at least 1 reviewer to review your code

 

Cheers,

Liem