You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by tbouron <gi...@git.apache.org> on 2017/09/08 16:09:15 UTC
[GitHub] brooklyn-dist pull request #104: WIP - Improve RPM/DEB packages
GitHub user tbouron opened a pull request:
https://github.com/apache/brooklyn-dist/pull/104
WIP - Improve RPM/DEB packages
The aim of this PR is to:
1. use Karaf launcher
2. improve the package to to handle properly installations and upgrades
This is spirit, this does change a couple of things:
- Install each version of Brooklyn into its own folder `/opt/brooklyn-<version>`. This means that all data and binaries are kept so a rollback will be easy.
- symlink `/opt/brooklyn` to `/opt/brooklyn-<version>` currently installing/upgrading.
- configuration files are now installed under `/etc/brooklyn`. Upon update, conflicts will be handled differently:
- for RPM, if a file has been edited and the new version is different that the base old version, the user edited version will be kept as-is and the new version will be written at `<filename>.rpmnew`. Otherwise, the new version is applied. This will be reported in the console when doing the `yum update <package.rpm>`.
- for DEB, the `dpkg` tool will ask the user what to do.
- log files are stored in `/opt/brooklyn-<version>/data/log` as this is best-practice (and will allow us to use decanter out of the box \o/). A symlink from `/var/log/brooklyn` to this directory is also created.
- the `brooklyn` service **is not started automatically**.
- home directory of the amp user uses the default given by the OS.
- persistence is on by default and data are written on `/var/lib/brooklyn`.
- admin credential are setup by default to `admin`:`password`. This is ensure a nice experience for first time user, out of the box, rather than going through all the logs to find out the autogenerated password.
This has been tested with the [following tests](https://github.com/apache/brooklyn-dist/tree/master/shared-packaging/src/test/yaml). But, **there is still an issue with the DEB package to fix**
|Package|`systemd`|`upstart`|
|---|:---:|:---:|
|DEB|✅|❌|
|RPM|✅|✅|
They all work **except DEB package with upstart**
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tbouron/brooklyn-dist feature/improve-rpm-deb
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/brooklyn-dist/pull/104.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #104
----
commit 1eb9be8e44f2416df8f45438c780a806d149fb83
Author: Thomas Bouron <th...@cloudsoftcorp.com>
Date: 2017-09-06T10:18:08Z
Extracting catalog item into their own file
commit 34b00f3e74d60255bdc47f8d0e37317fb72ecd65
Author: Thomas Bouron <th...@cloudsoftcorp.com>
Date: 2017-09-06T13:59:22Z
WIP - Improve RPM package (Currently service "launch" ok but brooklyn is not started)
commit 3de6996f4024b7bf7567576c9919734aea3db7df
Author: Thomas Bouron <th...@cloudsoftcorp.com>
Date: 2017-09-07T16:09:02Z
Improve RPM package
commit c406974606817dfbc43f772e7a3a10cc16554a5e
Author: Thomas Bouron <th...@cloudsoftcorp.com>
Date: 2017-09-08T14:47:06Z
Improve DEB package
----
---
[GitHub] brooklyn-dist pull request #104: Improve RPM/DEB packages
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/brooklyn-dist/pull/104
---
[GitHub] brooklyn-dist pull request #104: Improve RPM/DEB packages
Posted by drigodwin <gi...@git.apache.org>.
Github user drigodwin commented on a diff in the pull request:
https://github.com/apache/brooklyn-dist/pull/104#discussion_r138614710
--- Diff: shared-packaging/src/main/resources/service/upstart/deb/brooklyn.conf ---
@@ -33,11 +34,13 @@ pre-start script
end script
script
- BROOKLYN_HOME="/opt/brooklyn/"
- JAVA_OPTS="-Dbrooklyn.location.localhost.address=127.0.0.1 -XX:SoftRefLRUPolicyMSPerMB=1 -Dlogback.configurationFile=/etc/brooklyn/logback.xml -Xms256m -Xmx1g"
- CLASSPATH="/opt/brooklyn/conf:/opt/brooklyn/lib/patch/*:/opt/brooklyn/lib/brooklyn/*:/opt/brooklyn/lib/dropins/*"
- export BROOKLYN_HOME
- exec java ${JAVA_OPTS} -cp "${CLASSPATH}" org.apache.brooklyn.cli.Main launch --noGlobalBrooklynProperties --localBrooklynProperties /etc/brooklyn/brooklyn.conf --persist auto
+ EXTRA_JAVA_OPTS="-Dbrooklyn.location.localhost.address=127.0.0.1 -XX:SoftRefLRUPolicyMSPerMB=1 -Xms256m -Xmx1g"
--- End diff --
Same as above
---
[GitHub] brooklyn-dist pull request #104: Improve RPM/DEB packages
Posted by drigodwin <gi...@git.apache.org>.
Github user drigodwin commented on a diff in the pull request:
https://github.com/apache/brooklyn-dist/pull/104#discussion_r138611933
--- Diff: karaf/apache-brooklyn/src/main/filtered-resources/etc/brooklyn.cfg ---
@@ -0,0 +1,24 @@
+################################################################################
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+# Web login credentials
+
+# Credentials for user 'admin'
+brooklyn.webconsole.security.users=admin
--- End diff --
Do we want to have default credentials, I note the outcome from [[PROPOSAL] Remove unauthenticated localhost login](http://markmail.org/search/?q=[PROPOSAL]%20Remove%20unauthenticated%20localhost%20login#query:[PROPOSAL]%20Remove%20unauthenticated%20localhost%20login+page:1+mid:2f3q5vjf6rtxnpzt+state:results) was that we do not.
---
[GitHub] brooklyn-dist pull request #104: Improve RPM/DEB packages
Posted by drigodwin <gi...@git.apache.org>.
Github user drigodwin commented on a diff in the pull request:
https://github.com/apache/brooklyn-dist/pull/104#discussion_r138614635
--- Diff: shared-packaging/src/main/resources/service/systemd/brooklyn.service ---
@@ -22,12 +22,16 @@ Documentation=https://brooklyn.apache.org/documentation/index.html
[Service]
Type=simple
WorkingDirectory=/opt/brooklyn/
-Environment="JAVA_OPTS=-Dbrooklyn.location.localhost.address=127.0.0.1 -XX:SoftRefLRUPolicyMSPerMB=1 -Dlogback.configurationFile=/etc/brooklyn/logback.xml -Xms256m -Xmx1g"
-Environment="CLASSPATH=/opt/brooklyn/conf:/opt/brooklyn/lib/patch/*:/opt/brooklyn/lib/brooklyn/*:/opt/brooklyn/lib/dropins/*"
-ExecStart=/usr/bin/java $JAVA_OPTS -cp "$CLASSPATH" org.apache.brooklyn.cli.Main launch --noGlobalBrooklynProperties --localBrooklynProperties /etc/brooklyn/brooklyn.conf --persist auto
+Environment="EXTRA_JAVA_OPTS=-Dbrooklyn.location.localhost.address=127.0.0.1 -XX:SoftRefLRUPolicyMSPerMB=1 -Xms256m -Xmx1g"
--- End diff --
I think we set 2G as the Xmx everywhere else - [see here](https://github.com/apache/brooklyn-dist/blob/master/karaf/apache-brooklyn/src/main/resources/bin/setenv#L21)
---
[GitHub] brooklyn-dist pull request #104: Improve RPM/DEB packages
Posted by drigodwin <gi...@git.apache.org>.
Github user drigodwin commented on a diff in the pull request:
https://github.com/apache/brooklyn-dist/pull/104#discussion_r138608902
--- Diff: deb-packaging/deb/control/control ---
@@ -19,6 +19,6 @@ Version: [[version]]
Section: misc
Priority: optional
Architecture: all
-Depends: default-jre-headless (>= 1.7)
--- End diff --
In xenial `default-jre-headless` appears to be `openjdk-8-jre-headless` why does this need to change?
---
[GitHub] brooklyn-dist issue #104: Improve RPM/DEB packages
Posted by tbouron <gi...@git.apache.org>.
Github user tbouron commented on the issue:
https://github.com/apache/brooklyn-dist/pull/104
@drigodwin Comment addressed except for the `Depends` package (see my comment above)
---
[GitHub] brooklyn-dist pull request #104: Improve RPM/DEB packages
Posted by tbouron <gi...@git.apache.org>.
Github user tbouron commented on a diff in the pull request:
https://github.com/apache/brooklyn-dist/pull/104#discussion_r138617661
--- Diff: karaf/apache-brooklyn/src/main/filtered-resources/etc/brooklyn.cfg ---
@@ -0,0 +1,24 @@
+################################################################################
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+# Web login credentials
+
+# Credentials for user 'admin'
+brooklyn.webconsole.security.users=admin
--- End diff --
Forgot this conversation, will change it back to no authentication
---
[GitHub] brooklyn-dist pull request #104: Improve RPM/DEB packages
Posted by drigodwin <gi...@git.apache.org>.
Github user drigodwin commented on a diff in the pull request:
https://github.com/apache/brooklyn-dist/pull/104#discussion_r138614755
--- Diff: shared-packaging/src/main/resources/service/upstart/rpm/brooklyn.conf ---
@@ -30,13 +31,14 @@ pre-start script
end script
script
- BROOKLYN_HOME="/opt/brooklyn/"
- JAVA_OPTS="-Dbrooklyn.location.localhost.address=127.0.0.1 -XX:SoftRefLRUPolicyMSPerMB=1 -Dlogback.configurationFile=/etc/brooklyn/logback.xml -Xms256m -Xmx1g"
- CLASSPATH="/opt/brooklyn/conf:/opt/brooklyn/lib/patch/*:/opt/brooklyn/lib/brooklyn/*:/opt/brooklyn/lib/dropins/*"
- export BROOKLYN_HOME
- # Upstart is too old on CentOS 6, at least v1.4 required to use setuid, setgid.
+ EXTRA_JAVA_OPTS="-Dbrooklyn.location.localhost.address=127.0.0.1 -XX:SoftRefLRUPolicyMSPerMB=1 -Xms256m -Xmx1g"
--- End diff --
Same as above
---
[GitHub] brooklyn-dist pull request #104: Improve RPM/DEB packages
Posted by tbouron <gi...@git.apache.org>.
Github user tbouron commented on a diff in the pull request:
https://github.com/apache/brooklyn-dist/pull/104#discussion_r138617340
--- Diff: deb-packaging/deb/control/control ---
@@ -19,6 +19,6 @@ Version: [[version]]
Section: misc
Priority: optional
Architecture: all
-Depends: default-jre-headless (>= 1.7)
--- End diff --
I'm using `java8-runtime` because Karaf requires java 1.8. Using `default-jre-headless` could potentially install and use java 1.7 in older system which would be problematic when launching the service
---