Uh oh!
There was an error while loading. Please reload this page.
CLOUDSTACK-10012: Towards CloudStack fat jar - #2226
Conversation
yadvr
commented
Aug 7, 2017
Travis green, so at least the mvn side of the world works: https://travis-ci.org/apache/cloudstack/builds/261836210 :) |
yadvr
commented
Aug 7, 2017
@blueorangutan package |
blueorangutan
commented
Aug 7, 2017
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
marcaurele
commented
Aug 7, 2017
For postmortem, there are comments on this change in the linked PR #2207 |
blueorangutan
commented
Aug 7, 2017
Packaging result: ✖centos6 ✖centos7 ✔debian. JID-928 |
yadvr
commented
Aug 7, 2017
@blueorangutan package |
blueorangutan
commented
Aug 7, 2017
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Aug 7, 2017
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-930 |
I came across another change that is required for the fatjar to work. We have to change the DbUpgrade process to not load |
marcaurele
commented
Aug 18, 2017
@rhtyd The DB files are kept out of the jar. Any opinion on that one if we should keep them outside (due to some possible customization for providers/plugins) or should we include them in the |
@marcaurele I think we need to consider and discuss three things;
What do you think? |
marcaurele
commented
Aug 21, 2017
@rhtyd
I'll push some of the changes today. |
| setJavaHome | ||
| JARS=$(ls /usr/share/cloudstack-management/lib/*.jar | tr '\n' ':' | sed s'/.$//') | ||
| CLASSPATH="/etc/cloudstack/management:/usr/share/cloudstack-common:/usr/share/cloudstack-management/setup:/usr/share/cloudstack-management:/usr/share/cloudstack-management/cloud-management-server.jar:$JARS" |
There was a problem hiding this comment.
:$JARS should be put in front here to first load extra JARs
marcaurele
commented
Aug 21, 2017
@rhtyd I cannot push to this branch |
yadvr
commented
Aug 21, 2017
@marcaurele perhaps you don't have commit rights yet, can you send a PR to the asf branch |
marcaurele
commented
Sep 26, 2017
Related to 42d9297, I forgot to remove the |
yadvr
commented
Sep 26, 2017
Thanks @marcaurele, sure will do that. These days I'm down with some £dayjob project work but I've planned to resume working on this PR after next ~2 weeks. |
yadvr
commented
Oct 16, 2017
@blueorangutan package |
blueorangutan
commented
Oct 16, 2017
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
@marcaurele I've resumed working on this now. I've squashed changes by authors, after painfully going through 27+ commits while rebasing against the latest master, hope you don't mind. I did not see any classes being overwritten for bountycastle and hence removed it from the exclusion list, do you think that could cause any issues? I'm exploring some ways to further improve the |
blueorangutan
commented
Oct 16, 2017
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Oct 16, 2017
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1164 |
yadvr
commented
Nov 1, 2017
@blueorangutan test |
blueorangutan
commented
Nov 1, 2017
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
wido
commented
Nov 1, 2017
I just checked, building DEB files worked flawlessly. cloudstack.jar is 73M in size. Good! |
yadvr
commented
Nov 2, 2017
Thanks @wido, is that a LGTM on this PR? |
blueorangutan
commented
Nov 2, 2017
Trillian test result (tid-1606)
|
- Changes packaging to shaded jar - Introduced embedded jetty - Updates jetty dependencies version 9.2 (java 7+) - Initial changes to debian config files - Initial removal of tomcat dependency - Introduce ServerDaemon class with customizations
borisstoyanov
commented
Nov 3, 2017
@rhtyd after upgrading from 4.5 I wasn't able to start management server, got the following: |
yadvr
commented
Nov 3, 2017
Rebased to latest master. This is ready for merge now. |
blueorangutan
commented
Nov 3, 2017
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
yadvr
commented
Nov 3, 2017
@borisstoyanov okay I'll look into it |
blueorangutan
commented
Nov 3, 2017
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1201 |
wido
commented
Nov 3, 2017
Yes, LGTM from me. I tested a clean install on Ubuntu 16.04 with MySQL 5.7 ( https://blog.widodh.nl/2017/04/apache-cloudstack-and-mysql-5-7/ ) May I however ask that in server.properties this is set: # The binding interface used by the management server bind.interface=:: This will make sure that the server also listens on IPv6 |
| # under the License. | ||
| # The binding interface used by the management server | ||
| bind.interface=0.0.0.0 |
There was a problem hiding this comment.
Can we change 0.0.0.0 to :: so that it listens on IPv6 by default?
I tested this on Ubuntu 16.04 and works fine:
root@cloudstack-man-test:~# curl -I http://127.0.0.1:8080/client/ HTTP/1.1 200 OK Content-Type: text/html ETag: W/"114557-1499056602000 Content-Length: 114557 Server: Jetty(9.2.z-SNAPSHOT) root@cloudstack-man-test:~# curl -I http://[::1]:8080/client/ HTTP/1.1 200 OK Content-Type: text/html ETag: W/"114557-1499056602000 Content-Length: 114557 Server: Jetty(9.2.z-SNAPSHOT) root@cloudstack-man-test:~#
There was a problem hiding this comment.
Hi @wido I think the standard I've seen in mysql and elsewhere is to use this. It's a matter of config issue, and ipv6 may not be enabled on all systems.
For me it fails when JAVA_OPT has -Djava.net.preferIPv4Stack=true set, and bind.interface has :: set. Exception seen is:
WARN [o.e.j.u.c.AbstractLifeCycle] (main:null) (logid:) FAILED ServerConnector@4e9ba398{HTTP/1.1}{:::8080}: java.net.SocketException: Protocol family unavailable
java.net.SocketException: Protocol family unavailable
at sun.nio.ch.Net.bind0(Native Method)
Command ran to test this case (build cloudstack and cd to client/target, fix conf/server.properties): java -Dlog4j.configuration=conf/log4j-cloud.xml -cp cloud-client-ui-4.11.0.0-SNAPSHOT.jar:lib/bcpkix-jdk15on-1.58.jar:lib/bcprov-jdk15on-1.58.jar:.:/usr/share/java/mysql-connector-java.jar:conf:common:utilities/scripts/db/ -Djava.net.preferIPv4Stack=true org.apache.cloudstack.ServerDaemon
There was a problem hiding this comment.
Yes, that's true. However, all modern Linux systems have IPv6 enabled. It's a manual action to disable IPv6 on a system.
You don't need a public IPv6 address though to listen on ::, you already have your localhost ::1 to listen on.
Don't forget that the current Tomcat6/7 already listen on IPv6 by default. So it would be a change from 4.10 to 4.11 if we wouldn't listen on IPv6 anymore.
There was a problem hiding this comment.
@wido I agree with you, however, for the default I needed to put some configuration that would work out of the box on most/all systems. I know several installations where they have put -Djava.net.preferIPv4Stack=true in their global JAVA opts (or in cloudstack specific env/init/systemd files). That said, we can have a compromise where I can remove the default value set to empty, i.e. bind.interface=, that way the system picks up the default interface that could work automatically.
With this approach, on systems without ipv6, this listens on:
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN
And with ipv6 enabled, it listens on:
tcp6 0 0 127.0.0.1:8080 :::* LISTEN
yadvr
commented
Nov 3, 2017
Thanks for testing and reviewing @wido. |
blueorangutan
commented
Nov 3, 2017
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1203 |
I've confirmed manual upgrade (in-place) testing, from ACS 4.9.3.0 -> 4.11.0.0-SNAPSHOT on CentOS6, CentOS7 and Ubuntu 14.04. Worked as expected, other than seeding systemvmtemplates, the upgrade worked without issues, the old tomcat files are not removed. I'll update upgrade/release notes on the same after this PR gets merged. |
- Migrate to embedded Jetty server. - Improve ServerDaemon implementation. - Introduce a new server.properties file for easier configuration. - Have a single /etc/default/cloudstack-management to configure env. - Reduce shaded jar file, removing unnecessary dependencies. - Upgrade to Spring 5.x, upgrade several jar dependencies. - Does not shade and include mysql-connector, used from classpath instead. - Upgrade and use bountcastle as a separate un-shaded jar dependency. - Remove tomcat related configuration and files. - Have both embedded UI assets in uber jar and separate webapp directory. - Refactor systemd and init scripts, cleanup packaging. - Made cloudstack-setup-databases faster, using `urandom`. - Remove unmaintained distro packagings. - Moves creation and usage of server keystore in CA manager, this deprecates the need to create/store cloud.jks in conf folder and the db.cloud.keyStorePassphrase in db.properties file. This also remove the need of the --keystore-passphrase in the cloudstack-setup-encryption script. - GZip contents dynamically in embedded Jetty Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
borisstoyanov
left a comment
There was a problem hiding this comment.
Upgrade was successful on:
CentOS7 4.9 -> master
CentOS6 4.5 -> master
LGTM
LGTM, merging based on reviews, tests and upgrade-tests. Thank you everyone for helping with reviews and feedback. |
borisstoyanov
left a comment
There was a problem hiding this comment.
I've setup and configured rabbitmq broker and it worked out of the box, following the official documentation.
From #2207
I've moved the branch to ASF remote to allow cross-collaboration between ACS committers. Feel free to discuss and push your changes in this branch.
ServerDaemonwebappoverride, a separate UI/assets folder@blueorangutan package