Everything required for building the Karaf OpenDaylight RPM.
-Note that the currently supported version is Helium SR2.
+Note that the currently supported version is Helium SR3.
+
+## Vagrant build environment
+
+The included `Vagrantfile` provides a simple, but tested and known-working, build environment. We recommend using it when building an ODL RPM.
+
+```
+[~/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.
```
-[fedora@dfarrell-rpm ~]$ ./build.sh
-<snip output of RPM building process>
+SRPM built!
+Location: /home/vagrant/rpmbuild/SRPMS/opendaylight-0.2.3-1.fc20.src.rpm
+Assuming you want to move RPM off Vagrant box
+Also renaming RPM, not actually tagged as for FC20 target OS
+cp /home/vagrant/rpmbuild/SRPMS/opendaylight-0.2.3-1.fc20.src.rpm /vagrant/opendaylight-0.2.3-1.src.rpm
RPM built!
-Should be at: /home/fedora/rpmbuild/RPMS/noarch/opendaylight-0.2.1-5.fc20.noarch.rpm
+Location: /home/vagrant/rpmbuild/RPMS/noarch/opendaylight-0.2.3-1.fc20.noarch.rpm
+Assuming you want to move RPM off Vagrant box
+Also renaming RPM, not actually tagged as for FC20 target OS
+cp /home/vagrant/rpmbuild/RPMS/noarch/opendaylight-0.2.3-1.fc20.noarch.rpm /vagrant/opendaylight-0.2.3-1.noarch.rpm
```
## Working with the ODL RPM
### Installing OpenDaylight via the RPM
+The `install.sh` script is a helper for doing the install.
+
+```
+[vagrant@localhost vagrant]$ ./install.sh
+Installing ODL from ./opendaylight-0.2.3-1.noarch.rpm
+```
+
+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/
+[vagrant@localhost vagrant]$ 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 /usr/lib/systemd/system | grep -i opendaylight
+# If you want to test the install in the provided build env, install Java
+[vagrant@localhost vagrant]$ sudo yum install -y java
# 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-0.2.3-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
+Uninstalling opendaylight-0.2.3
+```
+
+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-0.2.3
# 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
### Starting OpenDaylight via systemd
```
-[fedora@dfarrell-rpm ~]$ sudo systemctl start opendaylight
-[fedora@dfarrell-rpm ~]$ sudo systemctl status opendaylight
+[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 Mon 2015-03-23 21:45:40 UTC; 34s ago
Docs: https://wiki.opendaylight.org/view/Main_Page
http://www.opendaylight.org/
- Main PID: 28731 (java)
+ Process: 13839 ExecStart=/opt/opendaylight/bin/start (code=exited, status=0/SUCCESS)
+ Main PID: 13846 (java)
CGroup: /system.slice/opendaylight.service
- └─28731 java -server -Xms128M -Xmx2048m -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:MaxPermSize=512m -Dcom.sun.manage...
+ └─13846 java -server -Xms128M -Xmx2048m -XX:+UnlockDiagnosticVMOptions -X...
-Jan 13 21:43:14 dfarrell-rpm systemd[1]: Started OpenDaylight SDN Controller.
+Mar 23 21:45:40 localhost.localdomain systemd[1]: Starting OpenDaylight SDN Control....
+Mar 23 21:45:40 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
The `connect.sh` script is provided as an example of how to connect to the Karaf shell.
+```
+[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:
opendaylight-user@root>^D
Connection to localhost closed.
-[fedora@dfarrell-rpm ~]$
+[vagrant@localhost vagrant]$
```
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: opendaylight
-Version: 0.2.2
-Release: 4%{?dist}
+Version: 0.2.3
+Release: 1%{?dist}
Summary: OpenDaylight SDN Controller
Group: Applications/Communications
License: EPL-1.0
URL: http://www.opendaylight.org
BuildArch: noarch
-Source0: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz
+Source0: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.3-Helium-SR3/distribution-karaf-0.2.3-Helium-SR3.tar.gz
Source1: https://github.com/dfarrell07/opendaylight-systemd/archive/%{shortcommit}/opendaylight-systemd-%{shortcommit}.tar.gz
Buildroot: /tmp
getent group odl > /dev/null || groupadd odl
%description
-OpenDaylight Helium SR2 (0.2.2)
+OpenDaylight Helium SR3 (0.2.3)
%prep
# Extract Source0 (ODL archive)
-%autosetup -n distribution-karaf-0.2.2-Helium-SR2
+%autosetup -n distribution-karaf-0.2.3-Helium-SR3
# Extract Source1 (systemd config)
%autosetup -T -D -b 1 -n opendaylight-systemd-%{commit}
# Create directory in build root for ODL
mkdir -p $RPM_BUILD_ROOT/opt/%name
# Move ODL from archive to its dir in build root
-cp -r ../distribution-karaf-0.2.2-Helium-SR2/* $RPM_BUILD_ROOT/opt/%name
+cp -r ../distribution-karaf-0.2.3-Helium-SR3/* $RPM_BUILD_ROOT/opt/%name
# Create directory in build root for systemd .service file
mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
# Move ODL's systemd .service file to correct dir in build root
%changelog
+* Mon Mar 23 2015 Daniel Farrell <dfarrell@redhat.com> - 0.2.3-1
+- Upgrade from Helium SR2 to Helium SR3
* Sun Mar 15 2015 Daniel Farrell <dfarrell@redhat.com> - 0.2.2-4
- Don't override ODL dir mode, explicitly set unitfile owner:group
* Fri Mar 13 2015 Daniel Farrell <dfarrell@redhat.com> - 0.2.2-3