X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=packaging%2Frpm%2FREADME.md;h=d5c8677c08742d5c4e22d3040105d6a07c1b9107;hb=732659be50eedc962e9cf09b09ac15e459523c7a;hp=838b31b6dcecca90e9819783f5034a83addb4eaa;hpb=b7f655031002999ba95a23e0dade91e2398e6c4d;p=integration.git diff --git a/packaging/rpm/README.md b/packaging/rpm/README.md index 838b31b6..d5c8677c 100644 --- a/packaging/rpm/README.md +++ b/packaging/rpm/README.md @@ -1,56 +1,97 @@ -Everything required for building the Karaf OpenDaylight RPM. +Everything required for building OpenDaylight's RPMs. -Note that the currently supported version is Helium SR2. +Note that the currently supported version is Lithium. + +## Overview + +The `opendaylight.spec` RPM spec file contains logic for packaging ODL's +tarball release artifact and a systemd service file into RPMs. The `build.sh` +helper script, when run in the simple Vagrant environment described by our +`Vagrantfile`, standardizes the build process. Additional helper scripts +are included for installing the noarch RPM, connecting to the ODL Karaf +shell and uninstalling ODL. + +## Vagrant build environment + +The included `Vagrantfile` provides a simple, but tested and known-working, +build environment. We recommend using it when building ODL's RPMs. + +``` +[~/integration/packaging/rpm]$ vagrant status +Current machine states: + +default not created (virtualbox) +[~/integration/packaging/rpm]$ vagrant up +[~/integration/packaging/rpm]$ vagrant ssh +[vagrant@localhost vagrant]$ cd /vagrant/ +[vagrant@localhost vagrant]$ ls +build.sh connect.sh install.sh opendaylight.spec README.md Vagrantfile +``` ## Building the RPM -The `build.sh` script is a helper for building the RPM. +The `build.sh` script is a helper for building the RPM. ``` -[fedora@dfarrell-rpm ~]$ ./build.sh - -RPM built! -Should be at: /home/fedora/rpmbuild/RPMS/noarch/opendaylight-0.2.1-5.fc20.noarch.rpm +[~/integration/packaging/rpm]$ vagrant ssh +[vagrant@localhost ~]$ cd /vagrant/ +[vagrant@localhost vagrant]$ ./build.sh ``` ## Working with the ODL RPM The familiar RPM-related commands apply to the OpenDaylight RPM. -### Installing OpenDaylight via the RPM +### Installing OpenDaylight via a local RPM + +The `install.sh` script is a helper for installing OpenDaylight from a +local RPM. It's intended for quick sanity checks after a `build.sh` run. + +``` +# After you've built the RPM via build.sh, still in the Vagrant enviroment +[vagrant@localhost vagrant]$ ./install.sh +``` + +Here's a manual walk-through of the install and the resulting system changes. ``` # Note that there's nothing in /opt before the install -[fedora@dfarrell-rpm ~]$ ls /opt/ -# Note that there are no opendaylight systemd files before install -[fedora@dfarrell-rpm ~]$ ls /usr/lib/systemd/system | grep -i opendaylight +[vagrant@localhost vagrant]$ ls /opt/ +# Note that there are no ODL systemd files before the install +[vagrant@localhost vagrant]$ ls /usr/lib/systemd/system | grep -i opendaylight # Install the ODL RPM -[fedora@dfarrell-rpm ~]$ sudo rpm -i /home/fedora/rpmbuild/RPMS/noarch/opendaylight-0.2.1-5.fc20.noarch.rpm +[vagrant@localhost vagrant]$ sudo rpm -i opendaylight-3.0.0-1.noarch.rpm # Note that ODL is now installed in /opt -[fedora@dfarrell-rpm ~]$ ls /opt/ -opendaylight-0.2.1 +[vagrant@localhost vagrant]$ ls /opt/ +opendaylight # Note that there's now a systemd .service file for ODL -[fedora@dfarrell-rpm ~]$ ls /usr/lib/systemd/system | grep -i opendaylight +[vagrant@localhost vagrant]$ ls /usr/lib/systemd/system | grep -i opendaylight opendaylight.service ``` -The `install.sh` script is a helper for doing the install. Note that the script's path to the RPM may need to be configured. - ### Uninstalling OpenDaylight via the RPM +The `uninstall.sh` script is a helper for uninstalling ODL. + +``` +[vagrant@localhost vagrant]$ ./uninstall.sh +``` + +Here's a manual walk-through of the uninstall and the resulting system changes. + ``` # Note that ODL is installed in /opt/ -[fedora@dfarrell-rpm ~]$ ls /opt/ -opendaylight-0.2.1 +[vagrant@localhost vagrant]$ ls /opt/ +opendaylight # Note that there's a systemd .service file for ODL -[fedora@dfarrell-rpm ~]$ ls /usr/lib/systemd/system | grep -i opendaylight +[vagrant@localhost vagrant]$ ls /usr/lib/systemd/system | grep -i opendaylight opendaylight.service # Uninstall the ODL RPM -[fedora@dfarrell-rpm ~]$ sudo rpm -e opendaylight-0.2.1 +[vagrant@localhost vagrant]$ sudo rpm -e opendaylight-3.0.0 # Note that ODL has been removed from /opt/ -[fedora@dfarrell-rpm ~]$ ls /opt/ +[vagrant@localhost vagrant]$ ls /opt/ # Note that the ODL systemd .service file has been removed -[fedora@dfarrell-rpm ~]$ ls /usr/lib/systemd/system | grep -i opendaylight +[vagrant@localhost vagrant]$ ls /usr/lib/systemd/system | grep -i opendaylight ``` ## Managing OpenDaylight via systemd @@ -60,35 +101,32 @@ The OpenDaylight RPM ships with systemd support. ### Starting OpenDaylight via systemd ``` -[fedora@dfarrell-rpm ~]$ sudo systemctl start opendaylight -[fedora@dfarrell-rpm ~]$ sudo systemctl status opendaylight -opendaylight.service - OpenDaylight SDN Controller +[vagrant@localhost vagrant]$ sudo systemctl start opendaylight +[vagrant@localhost vagrant]$ sudo systemctl status opendaylight +● opendaylight.service - OpenDaylight SDN Controller Loaded: loaded (/usr/lib/systemd/system/opendaylight.service; disabled) - Active: active (running) since Tue 2015-01-13 21:43:05 UTC; 14s ago + Active: active (running) since Tue 2015-07-14 21:09:30 UTC; 4s ago Docs: https://wiki.opendaylight.org/view/Main_Page http://www.opendaylight.org/ - Main PID: 28731 (java) + Process: 18216 ExecStart=/opt/opendaylight/bin/start (code=exited, status=0/SUCCESS) + Main PID: 18223 (java) CGroup: /system.slice/opendaylight.service - └─28731 java -server -Xms128M -Xmx2048m -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:MaxPermSize=512m -Dcom.sun.manage... + └─18223 /usr/bin/java -Djava.security.properties=/opt/opendaylight/etc/odl.jav... -Jan 13 21:43:14 dfarrell-rpm systemd[1]: Started OpenDaylight SDN Controller. +Jul 14 21:09:30 localhost.localdomain systemd[1]: Started OpenDaylight SDN Controller. ``` ### Stopping OpenDaylight via systemd ``` -[fedora@dfarrell-rpm ~]$ sudo systemctl stop opendaylight -[fedora@dfarrell-rpm ~]$ sudo systemctl status opendaylight +[vagrant@localhost vagrant]$ sudo systemctl stop opendaylight +[vagrant@localhost vagrant]$ sudo systemctl status opendaylight opendaylight.service - OpenDaylight SDN Controller Loaded: loaded (/usr/lib/systemd/system/opendaylight.service; disabled) Active: inactive (dead) Docs: https://wiki.opendaylight.org/view/Main_Page http://www.opendaylight.org/ - -Jan 27 19:08:11 dfarrell-rpm.os1.phx2.redhat.com systemd[1]: Starting OpenDaylight SDN Controller... -Jan 27 19:08:12 dfarrell-rpm.os1.phx2.redhat.com systemd[1]: Started OpenDaylight SDN Controller. -Jan 27 19:08:50 dfarrell-rpm.os1.phx2.redhat.com systemd[1]: Stopping OpenDaylight SDN Controller... -Jan 27 19:08:50 dfarrell-rpm.os1.phx2.redhat.com systemd[1]: Stopped OpenDaylight SDN Controller. +# snip ``` ## Connecting to the Karaf shell @@ -97,10 +135,18 @@ A few seconds after OpenDaylight is started, its Karaf shell will be accessible. The `connect.sh` script is provided as an example of how to connect to the Karaf shell. +``` +# Assuming you've started ODL +[vagrant@localhost vagrant]$ ./connect.sh +Installing sshpass. It's used connecting non-interactively +# snip +opendaylight-user@root> +``` + Additionally, here's an example of connecting manually (password: `karaf`): ``` -[fedora@dfarrell-rpm ~]$ ssh -p 8101 -o StrictHostKeyChecking=no karaf@localhost +[vagrant@localhost vagrant]$ ssh -p 8101 -o StrictHostKeyChecking=no karaf@localhost Authenticated with partial success. Password authentication Password: @@ -119,5 +165,5 @@ Hit '' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight. opendaylight-user@root>^D Connection to localhost closed. -[fedora@dfarrell-rpm ~]$ +[vagrant@localhost vagrant]$ ```