Uh oh!
There was an error while loading. Please reload this page.
Systemd packaging for Ubuntu 16.04 - #1541
Conversation
wido
commented
May 12, 2016
Asking @rhtyd for a review |
yadvr
commented
May 13, 2016
@wido thanks, much needed. I had a quick look, I could not find a cloudstack-management.sysconfig. |
yadvr
commented
May 13, 2016
I was able to build the packages on Ubuntu 16.04: I was able to deploy-database using cloudstack-setup-databases but I was unable to setup management server. It failed with following: (I tried fixing the tomcat user and configs in the initd script but that did not help either) -- Unit cloudstack-management.service has begun starting up. -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel-- Unit cloudstack-management.service has failed.-- The result is failed. |
wido
commented
May 13, 2016
@rhtyd Forgot to mention, I didn't fix the MGMT server yet. Tomcat is a bit scary to me. I only worked on the Agent mainly. I think that is the highest prio for most users right now. |
yadvr
commented
May 13, 2016
@wido alright, but while we're at it let's see if we can fix the mgmt server as well. I tested agent and was able to perform setup: |
yadvr
commented
May 13, 2016
Tested installation and started cloudstack-usage that seems to be working as well: |
| /etc/profile.d/cloudstack-agent-profile.sh | ||
| /etc/logrotate.d/cloudstack-agent | ||
| /etc/init.d/cloudstack-agent | ||
| /usr/bin/cloudstack-setup-agent |
There was a problem hiding this comment.
The built deb package still included and install cloudstack-agent initd script at /etc/init.d/cloudstack-agent and same thing happened with cloudstack-usage script. For running them with systemd, are they required? Removing them from *.install file still included them in the package.
dpkg -c
...
drwxr-xr-x root/root 0 2016-05-13 10:00 ./etc/cloudstack/
drwxr-xr-x root/root 0 2016-05-13 10:00 ./etc/cloudstack/agent/
-rwxr-xr-x root/root 6529 2016-05-13 10:00 ./etc/cloudstack/agent/agent.properties
-rwxr-xr-x root/root 906 2016-05-13 10:00 ./etc/cloudstack/agent/environment.properties
-rwxr-xr-x root/root 3543 2016-05-13 10:00 ./etc/cloudstack/agent/log4j-cloud.xml
drwxr-xr-x root/root 0 2016-05-13 10:00 ./etc/init.d/
-rwxr-xr-x root/root 4993 2016-05-13 10:00 ./etc/init.d/cloudstack-agent
There was a problem hiding this comment.
Yes, that is true. I 'stole' this from other packages which still do the same.
In debian/rules I would have to make the decision to install these or not, but I wasn't really sure how to do so.
There was a problem hiding this comment.
You can keep the init.d file for everybody. If the the system is running systemd, a service with the same basename will override the init.d file.
There was a problem hiding this comment.
@wido can we also move the debian directory to packaging folder? The deb files are build at .. which is the parent folder of the cloudstack repo/source code, and causes issues when doing concurrent builds using Jenkins.
There was a problem hiding this comment.
Maybe, never tried that before. Might be possible. But shall we do that in a different PR? Merge this one and then fix that.
wido
commented
May 13, 2016
ok @rhtyd ! Let's look at the Agent and Usage first. When they work as they should I'll look at the MGMT server. The packages work fine on my Ubuntu 14.04 and 16.04 systems. One thing, the systemd service is not enabled by default. Should we do that? |
yadvr
commented
May 13, 2016
@wido I'm LGTM on agent and usage package, it's a good first steps. Though, I also want to see mgmt server as well. For enabling the services, we can have some sort of systemctl enable in the post installation scripts; or in cloudstack-setup-{agent,management} etc. |
wido
commented
Jun 1, 2016
I just added a README.md to the packaging directory which adds some documentation on how to package CloudStack for DEB and RPM. I would like to get this done rather soon so that for 4.9 or 4.10 we have Ubuntu 16.04 packages with systemd. |
bvbharatk
commented
Jun 20, 2016
ACS CI BVT RunSumarry: Link to logs Folder (search by build_no):https://www.dropbox.com/sh/yj3wnzbceo9uef2/AAB6u-Iap-xztdm6jHX9SjPja?dl=0 Failed tests:
Skipped tests: Passed test suits: |
blueorangutan
commented
Aug 5, 2016
Packaging result: ✔centos6 ✔centos7 ✖debian repo: http://packages.shapeblue.com/cloudstack/pr/1541 |
| Maintainer: Wido den Hollander <wido@widodh.nl> | ||
| Build-Depends: debhelper (>= 9), openjdk-8-jdk | openjdk-7-jdk, genisoimage, | ||
| python-mysql.connector, maven (>= 3) | maven3, python (>= 2.7) | ||
| python-mysql.connector, maven (>= 3) | maven3, python (>= 2.7), lsb-release |
There was a problem hiding this comment.
For systemd integration, you need to Build-Depends on dh-systemd. Unfortunately, this will make the package unbuildable on Precise. See below.
There was a problem hiding this comment.
@vincentbernat that should be okay, we can use Xenial to build pkgs for both Xenial and Precise. At some point we'll need to stop building packages for Precise.
yadvr
commented
Aug 8, 2016
@blueorangutan package |
blueorangutan
commented
Aug 8, 2016
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Aug 8, 2016
Packaging result: ✔centos6 ✔centos7 ✔debian repo: http://packages.shapeblue.com/cloudstack/pr/1541 |
wido
commented
Aug 8, 2016
Thank you @vincentbernat, I applied your fixes. Can you take a look? |
The only change I have noticed is the change in postinst. This could bypass the local administrator policy. It would not restart the agent on upgrade either. I would suggest to :
If you don't want to add a dependency to dh-systemd, the override in debian/rules is useless and the postinst snippet should be more complex. Check for example |
wido
commented
Aug 8, 2016
@vincentbernat Thanks! Good pointers. I will look into those. |
This allows users to easily override variables passed to Java when starting up. It also creates a foundation for sharing the systemd service profile between CentOS and Ubuntu since it only requires the environment file to be changed.
The libvirt and Qemu versions (1.2.2 and 2.0) in Ubuntu 12.04 are to old to support for CloudStack going forward. Ubuntu 14.04 and 16.04 provide the support required to provide new features and more stability.
wido
commented
Aug 10, 2016
I pushed a new version of the commits, could @rhtyd and @vincentbernat take a look? Yes, Ubuntu 12.04 is dropped, but I did that earlier. See my commits. It will go EOL in April next year, but libvirt and Qemu are already far to old to use any way. |
| dh_installinit -pcloudstack-management -pcloudstack-agent -pcloudstack-usage --onlyscripts --no-start | ||
| override_dh_systemd_enable: | ||
| dh_systemd_enable -pcloudstack-agent -pcloudstack-usage --with systemd |
There was a problem hiding this comment.
I didn't mean the --with systemd to be here, just on the dh invocation in the % target (like it now is).
There was a problem hiding this comment.
Ah, understood! Fixed and pushed
vincentbernat
commented
Aug 10, 2016
Except the extra |
yadvr
commented
Aug 10, 2016
yadvr
commented
Aug 10, 2016
@blueorangutan package |
blueorangutan
commented
Aug 10, 2016
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Aug 10, 2016
Packaging result: ✔centos6 ✔centos7 ✖debian repo: http://packages.shapeblue.com/cloudstack/pr/1541 |
yadvr
commented
Aug 10, 2016
Build system did not have dh-systemd pkg installed, rekicked build job. |
yadvr
commented
Aug 10, 2016
@wido can you apply the PR on 4.9/master and fix build? I got following failures. It would be great if this PR can opened for 4.9. Thanks. Error from Jenkins build: |
Ubuntu 16.04 differs from Ubuntu 14.04 in a few ways: - systemd instead of sysvinit / upstart - Java 8 support The packaging now detects on which distribution it is being build and based on that it installs different files in the packages, but it also changes the Dependencies. Packages for Ubuntu 16.04 will require Java 8 as a JRE
wido
commented
Aug 10, 2016
Done @rhtyd , it should build now |
yadvr
commented
Aug 10, 2016
@blueorangutan package |
blueorangutan
commented
Aug 10, 2016
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Aug 10, 2016
Packaging result: ✔centos6 ✔centos7 ✔debian repo: http://packages.shapeblue.com/cloudstack/pr/1541 |
yadvr
commented
Aug 18, 2016
@wido can you reopen or edit the PR for base branch 4.9? Let's get this merged, as we'll need to support Ubuntu 16.04 for our LTS release. |
wido
commented
Aug 18, 2016
@rhtyd That's a total merge hell with all the version number conflicts in the pom.xml files. This PR has been open since May this year, far before 4.9 was even cut. Can't we merge it into master and cherry-pick back to 4.9? |
yadvr
commented
Aug 19, 2016
@wido if this helps you I can port your PR to 4.9 and push on asf remote so we can work on it together? Cherry-picking to 4.9 would against cause conflicts, and nice we've a fwd-merging based workflow, it would mess up the git-history/graph the next time someone fwd-merged 4.9 to master after this is cherry-picked to 4.9. |
yadvr
commented
Aug 19, 2016
[lts] CLOUDSTACK-9462: Systemd support for Ubuntu 16.04Created this based on @wido 's origin PR #1541 . Requesting for review and testing -- @jburwell@karuturi@wido@vincentbernat@wido I think this change only brings systemd support to agent and usage packages, or does cloudstack-management pkg has systemd support too? @blueorangutan package - systemd: Add a /etc/sysconfig/cloudstack-* file This allows users to easily override variables passed to Java when starting up. It also creates a foundation for sharing the systemd service profile between CentOS and Ubuntu since it only requires the environment file to be changed. - deb: Add Ubuntu 16.04 support Ubuntu 16.04 differs from Ubuntu 14.04 in a few ways: - systemd instead of sysvinit / upstart - Java 8 support The packaging now detects on which distribution it is being build and based on that it installs different files in the packages, but it also changes the Dependencies. * pr/1647: CLOUDSTACK-9462: Refactor systemd scripts CLOUDSTACK-9462: Systemd support for Ubuntu 16.04 Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This PR is for introducing packaging for Ubuntu 16.04
Ubuntu 14.04 still uses sysvinit and Java 7. 16.04 uses systemd and Java 8.
The 'build-deb.sh' script can be used to generate packages. The comments in the file show how to use Docker to build for the different versions of Ubuntu.
I've just build: