Skip to content

[4.10] CLOUDSTACK-9462: Build packages on Ubuntu 14.04/16.04 and support tomcat6/tomcat7 - #1950

Closed
ustcweizhou wants to merge 1 commit into
apache:masterfrom
ustcweizhou:4.10-ubuntu16-systemd
Closed

ustcweizhou wants to merge 1 commit into
apache:masterfrom
ustcweizhou:4.10-ubuntu16-systemd

Conversation

@ustcweizhou

Copy link
Copy Markdown
Contributor

Changes
(1) add systemd support in debian/control and debian/rules for 16.04
(2) add python-setuptools in Build-Depends in debian/control
(3) seperate cloudstack-management.service and cloudstack-management.default for CentOS7 and Ubuntu 16.04
(4) add server7-ssl.xml and server7-nonssl.xml in management installation
(5) link /usr/share/cloudstack-management/lib and /usr/share/cloudstack-management/bin to correct path (tomcat6 or tomcat7)
(6) link /etc/cloudstack/management/server.xml to correct file path (server-nonssl.xml or server7-nonssl.xml)
(7) remove *.zip from .gitignore to avoid build error caused by missing /vhds/test.vhd.zip

Instruction
(1) build packages on Ubuntu 16.04: dpkg-buildpackage -uc -us
Output on Ubuntu 16.04:
-rw-r--r-- 1 root root 4090 Feb 17 10:12 cloudstack_4.10.0.0-SNAPSHOT_amd64.changes
-rw-r--r-- 1 root root 1235 Feb 17 09:53 cloudstack_4.10.0.0-SNAPSHOT.dsc
-rw-r--r-- 1 root root 8018248 Feb 17 09:53 cloudstack_4.10.0.0-SNAPSHOT.tar.xz
-rw-r--r-- 1 root root 91868746 Feb 17 10:11 cloudstack-agent_4.10.0.0-SNAPSHOT_all.deb
-rw-r--r-- 1 root root 52882 Feb 17 10:12 cloudstack-cli_4.10.0.0-SNAPSHOT_all.deb
-rw-r--r-- 1 root root 98556216 Feb 17 10:08 cloudstack-common_4.10.0.0-SNAPSHOT_all.deb
-rw-r--r-- 1 root root 52864 Feb 17 10:12 cloudstack-docs_4.10.0.0-SNAPSHOT_all.deb
-rw-r--r-- 1 root root 585434 Feb 17 10:12 cloudstack-integration-tests_4.10.0.0-SNAPSHOT_all.deb
-rw-r--r-- 1 root root 323459934 Feb 17 10:10 cloudstack-management_4.10.0.0-SNAPSHOT_all.deb
-rw-r--r-- 1 root root 442656 Feb 17 10:12 cloudstack-marvin_4.10.0.0-SNAPSHOT_all.deb
-rw-r--r-- 1 root root 87037576 Feb 17 10:12 cloudstack-usage_4.10.0.0-SNAPSHOT_all.deb

(2) setup tomcat6/tomcat7 on management server:
tomcat6: cloudstack-setup-management --tomcat6
tomcat7: cloudstack-setup-management --tomcat7

Already tested on Ubuntu 16.04, upgraded from 4.7.1 to 4.10.0.0-SNAPSHOT

@ustcweizhou ustcweizhou changed the title CLOUDSTACK-9462: Build packages on Ubuntu 14.04/16.04 and support tomcat6/tomcat7 [4.10] CLOUDSTACK-9462: Build packages on Ubuntu 14.04/16.04 and support tomcat6/tomcat7 Feb 17, 2017
@yadvr

yadvr commented Feb 17, 2017

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-503

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan test ubuntu kvm-ubuntu

@blueorangutan

Copy link
Copy Markdown

@borisstoyanov a Trillian-Jenkins test job (ubuntu mgmt + kvm-ubuntu) has been kicked to run smoke tests

@yadvr

yadvr commented Feb 21, 2017

Copy link
Copy Markdown
Member

@borisstoyanov can you please identify the failures against Ubuntu environment, thanks.

@borisstoyanov

Copy link
Copy Markdown
Contributor

Hi @rhtyd, Ubuntu installation of ACS fails with the dependency error we discussed last week. Don't know where is the issue since it fails on the Trillian images, but you reported you were able to install it locally on 14.04.

@yadvr

yadvr commented Feb 22, 2017

Copy link
Copy Markdown
Member

LGTM, I'll test it manually as soon as I get some free time.

@yadvr

yadvr commented Feb 22, 2017

Copy link
Copy Markdown
Member

Verified packages built alright with the change.
screenshot from 2017-02-22 16-09-11

Comment thread debian/control Outdated
Package: cloudstack-management
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}, openjdk-8-jre-headless | java8-runtime-headless | java8-runtime, cloudstack-common (= ${source:Version}), tomcat6 | tomcat7, sudo, jsvc, python-mysql.connector, libmysql-java, augeas-tools, mysql-client, adduser, bzip2, ipmitool, lsb-release
Recommends: init-system-helpers

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ustcweizhou is this necessary?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we force it to a specific version, default it builds with init-system-helpers (>= 1.18~); if we can add >= 1.14 to support ubuntu 14.04?

@yadvr

yadvr commented Feb 22, 2017

Copy link
Copy Markdown
Member

Install log on Ubuntu 16.10:
root@antrix:/# apt-get install cloudstack-management -V
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
cloudstack-management (4.10.0.0-SNAPSHOT)
0 upgraded, 1 newly installed, 0 to remove and 36 not upgraded.
Need to get 0 B/345 MB of archives.
After this operation, 377 MB of additional disk space will be used.
Selecting previously unselected package cloudstack-management.
(Reading database ... 311454 files and directories currently installed.)
Preparing to unpack .../cloudstack-management_4.10.0.0-SNAPSHOT_all.deb ...
Unpacking cloudstack-management (4.10.0.0-SNAPSHOT) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up cloudstack-management (4.10.0.0-SNAPSHOT) ...
usermod: no changes
Created symlink /etc/systemd/system/multi-user.target.wants/cloudstack-management.service → /lib/systemd/system/cloudstack-management.service.
Processing triggers for systemd (231-9ubuntu2) ...
Processing triggers for ureadahead (0.100.0-19) ...

Db setup:
root@antrix:/# cloudstack-setup-databases cloud:cloud --deploy-as=root:
Mysql user name:cloud [ OK ]
Mysql user password:****** [ OK ]
Mysql server ip:localhost [ OK ]
Mysql server port:3306 [ OK ]
Mysql root user name:root [ OK ]
Mysql root user password:****** [ OK ]
Checking Cloud database files ... [ OK ]
Checking local machine hostname ... [ OK ]
Checking SELinux setup ... [ OK ]
Detected local IP address as 127.0.1.1, will use as cluster management server node IP[ OK ]
Preparing /etc/cloudstack/management/db.properties [ OK ]
Applying /usr/share/cloudstack-management/setup/create-database.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/create-schema.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/create-database-premium.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/create-schema-premium.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/server-setup.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/templates.sql [ OK ]
Processing encryption ... [ OK ]
Finalizing setup ... [ OK ]
CloudStack has successfully initialized database, you can check your database configuration in /etc/cloudstack/management/db.properties

Setup mgmt server:
cloudstack-setup-management --tomcat7
Starting to configure CloudStack Management Server:
Configure Firewall ... [OK]
Configure CloudStack Management Server ...[Failed]
Failed to configure CloudStack Management Server, please see the /var/log/cloudstack/management/setupManagement.log for detail
Try to restore your system:
Restore Firewall ... [OK]
Restore CloudStack Management Server ...[OK]

To fix this, I updated the JAVA_HOME in /etc/default/cloudstack-management
After this mgmt server successfully started:

root@antrix:/etc/cloudstack/management# cloudstack-setup-management --tomcat7
Starting to configure CloudStack Management Server:
Configure Firewall ... [OK]
Configure CloudStack Management Server ...[OK]
CloudStack Management Server setup is Done!

LGTM.

We might want to add in the install docs after the default JAVA_HOME. Alternatively, we can set the default for the /etc/default/cloudstack-management to: JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64" @ustcweizhou ?

@yadvr

yadvr commented Feb 22, 2017 •

Copy link
Copy Markdown
Member

/cc @karuturi LGTM, manual tests confirm that mgmt server can be installed and setup on Ubuntu 16.x with systemd support.

@yadvr

yadvr commented Feb 22, 2017

Copy link
Copy Markdown
Member

Additional notes, I still found issues with mgmt server not working afterwards likely due to permission/sudoers issue:

017-02-22 18:37:25,076 INFO [c.c.s.ConfigurationServerImpl] (localhost-startStop-1:null) (logid:) Trying to inject public and private keys into systemvm iso
2017-02-22 18:37:25,076 DEBUG [c.c.u.s.Script] (localhost-startStop-1:null) (logid:) Looking for scripts/vm/systemvm/injectkeys.sh in the classpath
2017-02-22 18:37:25,076 DEBUG [c.c.u.s.Script] (localhost-startStop-1:null) (logid:) System resource: file:/usr/share/cloudstack-common/scripts/vm/systemvm/injectkeys.sh
2017-02-22 18:37:25,076 DEBUG [c.c.u.s.Script] (localhost-startStop-1:null) (logid:) Absolute path = /usr/share/cloudstack-common/scripts/vm/systemvm/injectkeys.sh
2017-02-22 18:37:25,076 DEBUG [c.c.u.s.Script] (localhost-startStop-1:null) (logid:) Looking for vms/systemvm.iso in the classpath
2017-02-22 18:37:25,076 DEBUG [c.c.u.s.Script] (localhost-startStop-1:null) (logid:) System resource: file:/usr/share/cloudstack-common/vms/systemvm.iso
2017-02-22 18:37:25,076 DEBUG [c.c.u.s.Script] (localhost-startStop-1:null) (logid:) Absolute path = /usr/share/cloudstack-common/vms/systemvm.iso
2017-02-22 18:37:25,076 DEBUG [c.c.s.ConfigurationServerImpl] (localhost-startStop-1:null) (logid:) Executing: /bin/bash /usr/share/cloudstack-common/scripts/vm/systemvm/injectkeys.sh /var/lib/cloudstack/management/.ssh/id_rsa.pub /var/lib/cloudstack/management/.ssh/id_rsa /usr/share/cloudstack-common/vms/systemvm.iso
2017-02-22 18:37:25,231 DEBUG [c.c.s.ConfigurationServerImpl] (localhost-startStop-1:null) (logid:) Exit value is 1
2017-02-22 18:37:25,232 DEBUG [c.c.s.ConfigurationServerImpl] (localhost-startStop-1:null) (logid:) mount: /dev/loop0 is write-protected, mounting read-onlymkdir: cannot create directory ‘/tmp/cloud/systemvm’: Permission denied
2017-02-22 18:37:25,232 INFO [c.c.s.ConfigurationServerImpl] (localhost-startStop-1:null) (logid:) Injected public and private keys into systemvm iso with result : mount: /dev/loop0 is write-protected, mounting read-onlymkdir: cannot create directory ‘/tmp/cloud/systemvm’: Permission denied
2017-02-22 18:37:25,232 WARN [c.c.s.ConfigurationServerImpl] (localhost-startStop-1:null) (logid:) Failed to inject generated public key into systemvm iso mount: /dev/loop0 is write-protected, mounting read-onlymkdir: cannot create directory ‘/tmp/cloud/systemvm’: Permission denied
2017-02-22 18:37:25,234 WARN [o.a.c.s.m.c.ResourceApplicationContext] (localhost-startStop-1:null) (logid:) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'cloudStackLifeCycle'; nested exception is com.cloud.utils.exception.CloudRuntimeException: Failed to inject generated public key into systemvm iso mount: /dev/loop0 is write-protected, mounting read-onlymkdir: cannot create directory ‘/tmp/cloud/systemvm’: Permission denied

@yadvr

yadvr commented Feb 22, 2017

Copy link
Copy Markdown
Member

@wido can you comment on this PR, thanks.

Comment thread .gitignore
*.jar
*.war
*.mar
*.zip

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Are we adding ZIP files to the repo?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wido ,yes, ./core/test/resources/vhds/test.vhd.zip for testing.

@yadvr

yadvr commented Feb 27, 2017

Copy link
Copy Markdown
Member

@ustcweizhou can you check the permissions issue I hit in my test, as share in my comment above?

@ustcweizhou

Copy link
Copy Markdown
Contributor Author

@rhtyd The permission issue seems to be caused by ./scripts/vm/systemvm/injectkeys.sh

@ustcweizhou
ustcweizhou force-pushed the 4.10-ubuntu16-systemd branch from fb3d78a to 73ad282 Compare February 27, 2017 07:28
@ustcweizhou

Copy link
Copy Markdown
Contributor Author

updated.
changes
(1) add init-system-helpers version
(2) add ExecStartPre to avoid the issue caused by JAVA_HOME

@yadvr

yadvr commented Feb 27, 2017

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-538

@yadvr

yadvr commented Feb 27, 2017

Copy link
Copy Markdown
Member

LGTM. Tested manually on local Ubuntu installation. Fixed the permission issue by fixing sudoers manually and JAVA_HOME issue by fixing the variable in /etc/default/cloudstack.

@blueorangutan test ubuntu kvm-centos7

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (ubuntu mgmt + kvm-centos7) has been kicked to run smoke tests

Comment thread debian/control Outdated
Package: cloudstack-management
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}, openjdk-8-jre-headless | java8-runtime-headless | java8-runtime, cloudstack-common (= ${source:Version}), tomcat6 | tomcat7, sudo, jsvc, python-mysql.connector, libmysql-java, augeas-tools, mysql-client, adduser, bzip2, ipmitool, lsb-release
Recommends: init-system-helpers (>= 1.14)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ustcweizhou can you move init-system-helpers (>= 1.14) to Depends, or remove it if it's not necessary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhtyd Sorry I just noticed your comment. I will remove all 3 lines
Recommends: init-system-helpers (>= 1.14)

I am not sure if it will cause any issue. Please test it.

@ustcweizhou
ustcweizhou force-pushed the 4.10-ubuntu16-systemd branch from 73ad282 to 1a294a9 Compare March 1, 2017 08:20
@ustcweizhou
ustcweizhou force-pushed the 4.10-ubuntu16-systemd branch from 1a294a9 to 9d5aee0 Compare April 4, 2017 11:09
@ustcweizhou

Copy link
Copy Markdown
Contributor Author

it would be nice if this can be merged into 4.10.0.0

@wido

wido commented Apr 5, 2017

Copy link
Copy Markdown
Contributor

LGTM for me

@yadvr

yadvr commented Apr 5, 2017

Copy link
Copy Markdown
Member

Thanks @ustcweizhou
@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-618

@yadvr

yadvr commented Apr 5, 2017

Copy link
Copy Markdown
Member

@blueorangutan test ubuntu kvm-ubuntu

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (ubuntu mgmt + kvm-ubuntu) has been kicked to run smoke tests

@yadvr

yadvr commented Apr 7, 2017 •

Copy link
Copy Markdown
Member

Failed due to cloudstack-management : Depends: init-system-helpers (>= 1.18~) but 1.14 is to be installed. @ustcweizhou can you explicitly set the dependency init-system-helpers (>= 1.14~) for the packages (at least cloudstack-management)?

…cat6/tomcat7

Changes
(1) add systemd support in debian/control and debian/rules for 16.04
(2) add python-setuptools in Build-Depends in debian/control
(3) seperate cloudstack-management.service and cloudstack-management.default for CentOS7 and Ubuntu 16.04
(4) add server7-ssl.xml and server7-nonssl.xml in management installation
(5) link /usr/share/cloudstack-management/lib and /usr/share/cloudstack-management/bin to correct path (tomcat6 or tomcat7)
(6) link /etc/cloudstack/management/server.xml to correct file path (server-nonssl.xml or server7-nonssl.xml)
(7) remove *.zip from .gitignore to avoid build error caused by missing /vhds/test.vhd.zip

Instruction
(1) build packages on Ubuntu 16.04: dpkg-buildpackage -uc -us
    Output on Ubuntu 16.04:
-rw-r--r-- 1 root root      4090 Feb 17 10:12 cloudstack_4.10.0.0-SNAPSHOT_amd64.changes
-rw-r--r-- 1 root root      1235 Feb 17 09:53 cloudstack_4.10.0.0-SNAPSHOT.dsc
-rw-r--r-- 1 root root   8018248 Feb 17 09:53 cloudstack_4.10.0.0-SNAPSHOT.tar.xz
-rw-r--r-- 1 root root  91868746 Feb 17 10:11 cloudstack-agent_4.10.0.0-SNAPSHOT_all.deb
-rw-r--r-- 1 root root     52882 Feb 17 10:12 cloudstack-cli_4.10.0.0-SNAPSHOT_all.deb
-rw-r--r-- 1 root root  98556216 Feb 17 10:08 cloudstack-common_4.10.0.0-SNAPSHOT_all.deb
-rw-r--r-- 1 root root     52864 Feb 17 10:12 cloudstack-docs_4.10.0.0-SNAPSHOT_all.deb
-rw-r--r-- 1 root root    585434 Feb 17 10:12 cloudstack-integration-tests_4.10.0.0-SNAPSHOT_all.deb
-rw-r--r-- 1 root root 323459934 Feb 17 10:10 cloudstack-management_4.10.0.0-SNAPSHOT_all.deb
-rw-r--r-- 1 root root    442656 Feb 17 10:12 cloudstack-marvin_4.10.0.0-SNAPSHOT_all.deb
-rw-r--r-- 1 root root  87037576 Feb 17 10:12 cloudstack-usage_4.10.0.0-SNAPSHOT_all.deb

(2) setup tomcat6/tomcat7 on management server:
    tomcat6: cloudstack-setup-management --tomcat6
    tomcat7: cloudstack-setup-management --tomcat7

Already tested on Ubuntu 16.04, upgraded from 4.7.1 to 4.10.0-SNAPSHOT
@yadvr

yadvr commented Apr 7, 2017

Copy link
Copy Markdown
Member

@ustcweizhou can you apply this change:

diff --git a/debian/control b/debian/control
index a019043..460ce7a 100644
--- a/debian/control
+++ b/debian/control
@@ -15,7 +15,7 @@ Description: A common package which contains files which are shared by several C

Package: cloudstack-management
Architecture: all
-Depends: ${misc:Depends}, ${python:Depends}, openjdk-8-jre-headless | java8-runtime-headless | java8-runtime, cloudstack-common (= ${source:Version}), tomcat6 | tomcat7, sudo, jsvc, python-mysql.connector, libmysql-java, augeas-tools, mysql-client, adduser, bzip2, ipmitool, lsb-release, init-system-helpers (>= 1.14~)
+Depends: ${python:Depends}, openjdk-8-jre-headless | java8-runtime-headless | java8-runtime, cloudstack-common (= ${source:Version}), tomcat6 | tomcat7, sudo, jsvc, python-mysql.connector, libmysql-java, augeas-tools, mysql-client, adduser, bzip2, ipmitool, lsb-release, init-system-helpers (>= 1.14~)
Conflicts: cloud-server, cloud-client, cloud-client-ui

@yadvr

yadvr commented Apr 7, 2017

Copy link
Copy Markdown
Member

@ustcweizhou I've fixed and ported the patch for 4.9 here: #2033
Let's work on that PR?

@asfgit asfgit closed this in #2033 Apr 14, 2017
asfgit pushed a commit that referenced this pull request Apr 14, 2017
[master/4.10+] CLOUDSTACK-9462: Support for Ubuntu 14.04/16.04 with tomcat6/tomcat7This extends work from @ustcweizhou from #1950 by fixing some build issues to make this work with Ubuntu 14.04 and 16.04.

This closes #1950

* pr/2033:
  CLOUDSTACK-9462: Build packages on Ubuntu 14.04/16.04 and support tomcat6/tomcat7

Signed-off-by: Rajani Karuturi <rajani.karuturi@accelerite.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants