brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drigod...@apache.org
Subject [1/2] brooklyn-dist git commit: Update vagrant configuration (centos 7.x) and use the new RPM package to install Brooklyn
Date Tue, 21 Nov 2017 16:28:50 GMT
Repository: brooklyn-dist
Updated Branches:
  refs/heads/master bfd6f5546 -> d1b0f928b


Update vagrant configuration (centos 7.x) and use the new RPM package to install Brooklyn


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/commit/b0042a22
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/tree/b0042a22
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/diff/b0042a22

Branch: refs/heads/master
Commit: b0042a22e57363ac67644eee7ddb659e3d46f9bb
Parents: bfd6f55
Author: Thomas Bouron <thomas.bouron@cloudsoftcorp.com>
Authored: Tue Sep 12 14:54:19 2017 +0100
Committer: Thomas Bouron <thomas.bouron@cloudsoftcorp.com>
Committed: Tue Nov 21 12:54:12 2017 +0000

----------------------------------------------------------------------
 vagrant/src/main/vagrant/README.md              |  6 +-
 .../src/main/vagrant/files/brooklyn.properties  | 23 --------
 vagrant/src/main/vagrant/files/brooklyn.service | 38 -------------
 .../src/main/vagrant/files/install_brooklyn.sh  | 60 +++++++++++---------
 vagrant/src/main/vagrant/files/logback.xml      | 32 -----------
 vagrant/src/main/vagrant/servers.yaml           |  4 +-
 6 files changed, 38 insertions(+), 125 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/b0042a22/vagrant/src/main/vagrant/README.md
----------------------------------------------------------------------
diff --git a/vagrant/src/main/vagrant/README.md b/vagrant/src/main/vagrant/README.md
index de5c9ed..6f77f38 100644
--- a/vagrant/src/main/vagrant/README.md
+++ b/vagrant/src/main/vagrant/README.md
@@ -13,7 +13,7 @@
 
 2. You may proceed to use the `Vagrantfile` as normal; `vagrant up`, `vagrant destroy` etc.
 
-##### Install a locally built `-dist.tar.gz`
+##### Install a locally built RPM package
 
 1. Set the `BROOKLYN_VERSION:` environment variable in `servers.yaml` to your current `-SNAPSHOT`
version. For example:
 
@@ -30,12 +30,12 @@
    ```
 
 
-3. Copy your locally built `apache-brooklyn-<version>.tar.gz` archive to the same directory
as the Vagrantfile (this directory is mounted in the Vagrant VM at `/vagrant/`).
+3. Copy your locally built `apache-brooklyn-<version>.noarch.rpm` archive to the same
directory as the Vagrantfile (this directory is mounted in the Vagrant VM at `/vagrant/`).
 
    For example to copy a locally built `0.12.0-SNAPSHOT` dist:
 
    ```
-   cp ~/.m2/repository/org/apache/brooklyn/apache-brooklyn/0.12.0-SNAPSHOT/apache-brooklyn-0.12.0-SNAPSHOT.tar.gz
.
+   cp ~/.m2/repository/org/apache/brooklyn/rpm-packaging/0.12.0-SNAPSHOT/rpm-packaging-0.12.0-SNAPSHOT-noarch.rpm
./apache-brooklyn-0.12.0-SNAPSHOT.noarch.rpm
    ```
 
 4. You may proceed to use the `Vagrantfile` as normal; `vagrant up`, `vagrant destroy` etc.

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/b0042a22/vagrant/src/main/vagrant/files/brooklyn.properties
----------------------------------------------------------------------
diff --git a/vagrant/src/main/vagrant/files/brooklyn.properties b/vagrant/src/main/vagrant/files/brooklyn.properties
deleted file mode 100644
index 0784ff3..0000000
--- a/vagrant/src/main/vagrant/files/brooklyn.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# 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.
-#
-
-# Disabling security on the Vagrant Brooklyn instance for training purposes
-brooklyn.webconsole.security.provider = org.apache.brooklyn.rest.security.provider.AnyoneSecurityProvider
-
-# Note: BYON locations are loaded from the files/vagrant-catalog.bom on startup
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/b0042a22/vagrant/src/main/vagrant/files/brooklyn.service
----------------------------------------------------------------------
diff --git a/vagrant/src/main/vagrant/files/brooklyn.service b/vagrant/src/main/vagrant/files/brooklyn.service
deleted file mode 100644
index 8a844e6..0000000
--- a/vagrant/src/main/vagrant/files/brooklyn.service
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# 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.
-#
-[Unit]
-Description=Apache Brooklyn Service
-Documentation=https://brooklyn.apache.org/documentation/index.html
-
-[Service]
-Type=simple
-WorkingDirectory=/home/vagrant/apache-brooklyn/
-Environment="EXTRA_JAVA_OPTS=-Dbrooklyn.location.localhost.address=127.0.0.1 -XX:SoftRefLRUPolicyMSPerMB=1
-Xms256m -Xmx2g"
-Environment="KARAF_HOME=/home/vagrant/apache-brooklyn/"
-Environment="KARAF_ETC=/home/vagrant/apache-brooklyn/etc/"
-Environment="KARAF_REDIRECT=/dev/null"
-Environment="BROOKLYN_PERSISTENCE_DIR=/vagrant/brooklyn-persisted-state"
-ExecStart=/home/vagrant/apache-brooklyn/bin/karaf server  >> "$KARAF_REDIRECT" 2>&1
-Restart=always
-User=vagrant
-Group=vagrant
-UMask=0066
-
-[Install]
-WantedBy=multi-user.target
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/b0042a22/vagrant/src/main/vagrant/files/install_brooklyn.sh
----------------------------------------------------------------------
diff --git a/vagrant/src/main/vagrant/files/install_brooklyn.sh b/vagrant/src/main/vagrant/files/install_brooklyn.sh
index 300c000..eb88d66 100755
--- a/vagrant/src/main/vagrant/files/install_brooklyn.sh
+++ b/vagrant/src/main/vagrant/files/install_brooklyn.sh
@@ -21,7 +21,7 @@
 
 BROOKLYN_VERSION=""
 INSTALL_FROM_LOCAL_DIST="false"
-TMP_ARCHIVE_NAME=apache-brooklyn.tar.gz
+TMP_ARCHIVE_NAME=apache-brooklyn.rpm
 
 do_help() {
   echo "./install.sh -v <Brooklyn Version> [-l <install from local file: true|false>]"
@@ -48,45 +48,53 @@ fi
 if [ ! "${INSTALL_FROM_LOCAL_DIST}" == "true" ]; then
   if [ ! -z "${BROOKLYN_VERSION##*-SNAPSHOT}" ] ; then
     # url for official release versions
-    BROOKLYN_URL="https://www.apache.org/dyn/closer.lua?action=download&filename=brooklyn/apache-brooklyn-${BROOKLYN_VERSION}/apache-brooklyn-${BROOKLYN_VERSION}-bin.tar.gz"
-    BROOKLYN_DIR="apache-brooklyn-${BROOKLYN_VERSION}-bin"
+    BROOKLYN_URL="https://www.apache.org/dyn/closer.lua?action=download&filename=brooklyn/apache-brooklyn-${BROOKLYN_VERSION}/apache-brooklyn-${BROOKLYN_VERSION}.noarch.rpm"
   else
     # url for community-managed snapshots
-    BROOKLYN_URL="https://repository.apache.org/service/local/artifact/maven/redirect?r=snapshots&g=org.apache.brooklyn&a=apache-brooklyn&v=${BROOKLYN_VERSION}&e=tar.gz"
-    BROOKLYN_DIR="apache-brooklyn-${BROOKLYN_VERSION}"
+    BROOKLYN_URL="https://repository.apache.org/service/local/artifact/maven/redirect?r=snapshots&g=org.apache.brooklyn&a=rpm-packaging&v=${BROOKLYN_VERSION}&c=noarch&e=rpm"
   fi
 else
-  echo "Installing from a local -dist archive [ /vagrant/apache-brooklyn-${BROOKLYN_VERSION}.tar.gz]"
+  echo "Installing from a local -dist archive [ /vagrant/apache-brooklyn-${BROOKLYN_VERSION}.noarch.rpm]"
   # url to install from mounted /vagrant dir
-  BROOKLYN_URL="file:///vagrant/apache-brooklyn-${BROOKLYN_VERSION}.tar.gz"
-  BROOKLYN_DIR="apache-brooklyn-${BROOKLYN_VERSION}"
+  BROOKLYN_URL="file:///vagrant/apache-brooklyn-${BROOKLYN_VERSION}.noarch.rpm"
 
   # ensure local file exists
-  if [ ! -f /vagrant/apache-brooklyn-${BROOKLYN_VERSION}.tar.gz ]; then
-    echo "Error: file not found /vagrant/apache-brooklyn-${BROOKLYN_VERSION}.tar.gz"
+  if [ ! -f /vagrant/apache-brooklyn-${BROOKLYN_VERSION}.noarch.rpm ]; then
+    echo "Error: file not found /vagrant/apache-brooklyn-${BROOKLYN_VERSION}.noarch.rpm"
     exit 1
   fi
 fi
 
-echo "Installing Apache Brooklyn version ${BROOKLYN_VERSION} from [${BROOKLYN_URL}]"
-
 echo "Downloading Brooklyn release archive"
 curl --fail --silent --show-error --location --output ${TMP_ARCHIVE_NAME} "${BROOKLYN_URL}"
-echo "Extracting Brooklyn release archive"
-tar zxf ${TMP_ARCHIVE_NAME}
 
-echo "Creating Brooklyn dirs and symlinks"
-ln -s ${BROOKLYN_DIR} apache-brooklyn
-sudo mkdir -p /var/log/brooklyn
-sudo chown -R vagrant:vagrant /var/log/brooklyn
-mkdir -p /home/vagrant/.brooklyn
+echo "Restarting Syslog"
+sudo systemctl restart rsyslog
+
+echo "Updating Yum"
+sudo yum -y update
+
+echo "Install Java"
+sudo yum install -y java-1.8.0-openjdk-headless
+
+echo "Install Apache Brooklyn version ${BROOKLYN_VERSION} from [${BROOKLYN_URL}]"
+sudo yum -y install ${TMP_ARCHIVE_NAME}
 
-echo "Copying default vagrant Brooklyn properties file"
-cp /vagrant/files/brooklyn.properties /home/vagrant/.brooklyn/
-chmod 600 /home/vagrant/.brooklyn/brooklyn.properties
+echo "Configure catalog"
+sudo cp /vagrant/files/vagrant-catalog.bom /opt/brooklyn/catalog/vagrant-catalog.bom
+sudo chown brooklyn:brooklyn /opt/brooklyn/catalog/vagrant-catalog.bom
+sudo chmod 740 /opt/brooklyn/catalog/vagrant-catalog.bom
+echo '  - file:catalog/vagrant-catalog.bom' | sudo tee -a /etc/brooklyn/default.catalog.bom
 
-echo "Installing JRE"
-sudo sh -c 'yum -y install java-1.8.0-openjdk-headless'
+echo "Starting Apache Brooklyn..."
+sudo systemctl start brooklyn
+
+echo "Waiting for Apache Brooklyn to start..."
+sleep 10
+
+while ! (sudo grep "BundleEvent STARTED - org.apache.brooklyn.karaf-init" /var/log/brooklyn/brooklyn.debug.log)
> /dev/null ; do
+  sleep 10
+  echo ".... waiting for Apache Brooklyn to start at `date`"
+done
 
-echo "Copying Brooklyn systemd service unit file"
-sudo cp /vagrant/files/brooklyn.service /etc/systemd/system/brooklyn.service
+echo "Apache Brooklyn started!"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/b0042a22/vagrant/src/main/vagrant/files/logback.xml
----------------------------------------------------------------------
diff --git a/vagrant/src/main/vagrant/files/logback.xml b/vagrant/src/main/vagrant/files/logback.xml
deleted file mode 100644
index 1560d8b..0000000
--- a/vagrant/src/main/vagrant/files/logback.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    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.
--->
-
-<configuration scan="true">
-
-    <!-- to supply custom logging, either change this file, supply your own logback-main.xml
-         (overriding the default provided on the classpath) or any of the files it references;
-         see the Logging section of the Brooklyn web site for more information -->
-
-    <property name="logging.basename" scope="context" value="brooklyn" />
-    <property name="logging.dir" scope="context" value="/var/log/brooklyn/" />
-
-    <include resource="logback-main.xml"/>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/b0042a22/vagrant/src/main/vagrant/servers.yaml
----------------------------------------------------------------------
diff --git a/vagrant/src/main/vagrant/servers.yaml b/vagrant/src/main/vagrant/servers.yaml
index 0773e30..68cfa59 100644
--- a/vagrant/src/main/vagrant/servers.yaml
+++ b/vagrant/src/main/vagrant/servers.yaml
@@ -47,14 +47,12 @@ servers:
        autocorrect: true
     shell:
       env:
-        BROOKLYN_VERSION: "1.0.0-SNAPSHOT"
+        BROOKLYN_VERSION: "1.0.0-SNAPSHOT"  # BROOKLYN_VERSION
         INSTALL_FROM_LOCAL_DIST: false
       cmd:
         - ssh-keygen -t rsa -N "" -f $HOME/.ssh/id_rsa
         - chmod a+x /vagrant/files/install_brooklyn.sh      
         - /vagrant/files/install_brooklyn.sh -v ${BROOKLYN_VERSION} -l ${INSTALL_FROM_LOCAL_DIST}
-        - sudo systemctl start brooklyn
-        - sudo systemctl enable brooklyn
   - name: byon1
     box: bento/centos-7.3
     ram: 512


Mime
View raw message