Skip to content

Commit

Permalink
tweak build/config files so platform access to standalone a4c works
Browse files Browse the repository at this point in the history
  • Loading branch information
ahgittin committed Sep 20, 2015
1 parent 5e0c97e commit 27b7684
Show file tree
Hide file tree
Showing 17 changed files with 278 additions and 94 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ brooklyn*.log.*
*brooklyn-persisted-state/

ignored
runtime
54 changes: 2 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,58 +25,8 @@ Then simply:

## Running

In the unpacked archive, it is recommended to run with:

nohup ./start.sh launch

This will install Alien4Cloud, using `~/.brooklyn/alien4cloud/` as the repository.

You can override the config location by modifying `conf/alien4cloud-config.yml`
(and if you want to use a different alien4cloud config file, simply set
the `alien4cloud-config.file` property in your `brooklyn.properties`.

To override this to use an existing A4C installation,
set `client: false` and `host: <other-alien-es-backend-ip>`
in the `alien4cloud-config.yml` used by this launch.
Note that A4C launches ES with no credentials required,
so the ES instance should be secured at the network level.

Any ElasticSearch data stored by this instance will use default ES file locations.
The recommended way to configure ES data is by launching a separate Alien4Cloud instance
configured as desired, with this instance pointing at that.


## Supported TOSCA Syntax

This currently supports nearly all TOSCA elements at parse time,
and the following at deploy time:

* `tosca.nodes.Compute` nodes for VM's
* Other node types which define `standard` lifecycle `interfaces` as scripts by URL,
optionally declaring their `host` requirement pointing at a compute node template

As Brooklyn expects a YAML, if you want to install a ZIP CSAR,
simply host that somewhere with a URL and supply the URL as the plan,
or as the value in a single-entry map, keyed against `csar_link`.


### Illustration

An example can be found at [ahgittin/tosca-demo](https://github.com/ahgittin/tosca-demo/).
Just cut and paste `script1.tosca.yaml` into the Brooklyn "Add Application" YAML dialog.


### Defining Locations

Locations where Brookln should deploy an application can be specified as follows:

```
groups:
add_brooklyn_location:
members: [ a_server ]
policies:
- brooklyn.location: localhost
```
See the README.md file in the resulting archive (in `target`) for runtime instructions.
You may also find that file [here](src/main/assembly/files/README.md).


## TODO Tasks
Expand Down
26 changes: 26 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
<properties>
<project.entry>org.apache.brooklyn.tosca.a4c.brooklyn.BrooklynToscaMain</project.entry>
<alien.version>1.1.0-SM4-SNAPSHOT</alien.version>
<!-- <jetty-runner.version>8.1.17.v20150415</jetty.version> -->
<jetty-runner.version>8.1.16.v20140903</jetty-runner.version>
</properties>

<repositories>
Expand Down Expand Up @@ -160,6 +162,30 @@
</descriptors>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<goals><goal>copy</goal></goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>alien4cloud</groupId>
<artifactId>alien4cloud-ui</artifactId>
<version>${alien.version}</version>
<type>war</type>
<classifier>standalone</classifier>

<destFileName>alien4cloud-ui-${alien.version}.war</destFileName>
<outputDirectory>${project.build.directory}/overlay/alien4cloud-standalone</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
22 changes: 10 additions & 12 deletions src/main/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,15 @@
scripts are located to src/main/scripts directory as stated by Maven
conventions.
-->
<files>
<file>
<source>src/main/assembly/scripts/start.sh</source>
<outputDirectory></outputDirectory>
<fileMode>0755</fileMode>
<filtered>true</filtered>
</file>
</files>
<fileSets>
<fileSet>
<directory>src/main/assembly/scripts</directory>
<outputDirectory></outputDirectory>
<fileMode>0755</fileMode>
<filtered>true</filtered>
<includes>
<include>*</include>
<include>**</include>
</includes>
<excludes>
<exclude>start.sh</exclude>
</excludes>
</fileSet>
<!-- add additional files (but not marked executable) -->
<fileSet>
Expand All @@ -84,5 +74,13 @@
<exclude>*-tests.jar</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>target/overlay</directory>
<outputDirectory>.</outputDirectory>
<filtered>false</filtered>
<includes>
<include>**</include>
</includes>
</fileSet>
</fileSets>
</assembly>
79 changes: 79 additions & 0 deletions src/main/assembly/files/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
brooklyn-tosca
===

## Overview

This distribution provides support for [Apache Brooklyn](http://brooklyn.io)
to understand [OASIS TOSCA](https://www.oasis-open.org/committees/tosca/) plans,
using [Alien4Cloud](http://alien4cloud.github.io).


## Running

In the unpacked archive, the simplest way to get started is to run with:

nohup ./brooklyn.sh launch &

This will launch the Alien4Cloud runtime, using `~/.brooklyn/alien4cloud/` as the repository.
Brooklyn will be available on port 8081 by default.
The process will be nohupped so you can exit the session (e.g. ssh on a remote machine).

You can override the A4C config by modifying `conf/alien4cloud-config.yml`
(and if you want to use a different alien4cloud config file, simply set
the `alien4cloud-config.file` property in your `brooklyn.properties`.

To launch a standalone A4C instance, edit the config file in
`alien4cloud-standalone/` as desired then run:

nohup alien4cloud-standalone/alien4cloud.sh &

Alien4Cloud will be running on port 8091, as set in that config.

To override the `brooklyn` launch to use an existing A4C installation,
set `client: false` and `hosts: <other-alien-es-backend-ip-port>`
in the `conf/alien4cloud-config.yml` used by this launch
(or specify a different `alien4cloud-config.file` for brooklyn).
For example if you want to run a local Brooklyn against a local but separate A4C,
use:

nohup ./brooklyn.sh launch -Dalien4cloud-config.file=conf/alien4cloud-config.client-to-localhost.yml &

Note that A4C launches ES with no credentials required,
so the ES instance should be secured at the network level.

Any ElasticSearch data stored by this instance will use default ES file locations.
The recommended way to configure ES data is by launching a separate Alien4Cloud instance
configured as desired, with this instance pointing at that.


## Supported TOSCA Syntax

This currently supports nearly all TOSCA elements at parse time,
and the following at deploy time:

* `tosca.nodes.Compute` nodes for VM's
* Other node types which define `standard` lifecycle `interfaces` as scripts by URL,
optionally declaring their `host` requirement pointing at a compute node template

As Brooklyn expects a YAML, if you want to install a ZIP CSAR,
simply host that somewhere with a URL and supply the URL as the plan,
or as the value in a single-entry map, keyed against `csar_link`.


### Illustration

An example can be found at [ahgittin/tosca-demo](https://github.com/ahgittin/tosca-demo/).
Just cut and paste `script1.tosca.yaml` into the Brooklyn "Add Application" YAML dialog.


### Defining Locations

Locations where Brookln should deploy an application can be specified as follows:

```
groups:
add_brooklyn_location:
members: [ a_server ]
policies:
- brooklyn.location: localhost
```
4 changes: 0 additions & 4 deletions src/main/assembly/files/README.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
server:
port: 8091

# Configuration of alien4cloud's CSAR repository, temporary folder and upload settings.
directories:
# alien4cloud main directory (other directories are relative path to this one)
alien: runtime
# directory in which alien4cloud stores Cloud Service Archives
csar_repository: csar
# directory in which alien4cloud stores uploaded artifacts (war etc.).
artifact_repository: artifacts
# temporary directory for alien4cloud
upload_temp: upload
# directory in which alien4cloud unzip loaded plugins.
plugins: plugins

paas_monitor:
# PaaS monitoring is done by a polling mechanism. This property allow to specify the interval between pollings (in milliseconds).
monitor_interval_ms: 1000
# Number of threads to use to monitor Platform as a Service systems.
threadpool_size: 5
# Duration to keep monitoring events stored in Alien4Cloud.
# Event lifetime unit : d (days), m (minutes), h (hours), ms (milliseconds) or w (weeks), milliseconds is used as default unit
events_lifetime: "1d"

# Initial default components upload : from folder /alien4cloud-core/src/main/default-normative-types
archive:
upload_all: false

# configure the boost factors for tosca elements in the search, elements with the highest boost factor appears first in search results
# the total boost factor for a component is the sum of the following boost factors.
components.search.boost:
# boost components that are used in topologies by (number of active topologies that uses the component * usage)
usage: 1
# components that exist in latest version get a boost factor regarding other components. Note that this factor should be very high as every component
# with latest version will be boosted.
version: 1000
# components that are configured as default for at least 1 capability get the following a boost factor.
default: 10

elasticSearch:
clusterName: brooklyn-alien-es-cluster
client: false
local: false
resetData: false
prefix_max_expansions: 10

audit:
ttl: 1d
14 changes: 14 additions & 0 deletions src/main/assembly/files/alien4cloud-standalone/elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

index:
number_of_shards: 1
number_of_replicas: 0

path:
data: runtime/elasticsearch/data
work: runtime/elasticsearch/work
logs: runtime/elasticsearch/logs
conf: .

gateway:
recover_after_nodes: 1
expected_nodes: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Configuration of alien4cloud's CSAR repository, temporary folder and upload settings.
directories:
# alien4cloud main directory (other directories are relative path to this one)
alien: runtime
# directory in which alien4cloud stores Cloud Service Archives
csar_repository: csar
# directory in which alien4cloud stores uploaded artifacts (war etc.).
artifact_repository: artifacts
# temporary directory for alien4cloud
upload_temp: upload
# directory in which alien4cloud unzip loaded plugins.
plugins: plugins

paas_monitor:
# PaaS monitoring is done by a polling mechanism. This property allow to specify the interval between pollings (in milliseconds).
monitor_interval_ms: 1000
# Number of threads to use to monitor Platform as a Service systems.
threadpool_size: 5
# Duration to keep monitoring events stored in Alien4Cloud.
# Event lifetime unit : d (days), m (minutes), h (hours), ms (milliseconds) or w (weeks), milliseconds is used as default unit
events_lifetime: "1d"

# Initial default components upload : from folder /alien4cloud-core/src/main/default-normative-types
archive:
upload_all: false

# configure the boost factors for tosca elements in the search, elements with the highest boost factor appears first in search results
# the total boost factor for a component is the sum of the following boost factors.
components.search.boost:
# boost components that are used in topologies by (number of active topologies that uses the component * usage)
usage: 1
# components that exist in latest version get a boost factor regarding other components. Note that this factor should be very high as every component
# with latest version will be boosted.
version: 1000
# components that are configured as default for at least 1 capability get the following a boost factor.
default: 10

elasticSearch:
client: true
transportClient: true
hosts: localhost:9300
clusterName: brooklyn-alien-es-cluster
local: true
resetData: false
prefix_max_expansions: 10

audit:
ttl: 1d
4 changes: 2 additions & 2 deletions src/main/assembly/files/conf/alien4cloud-config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Configuration of alien4cloud's CSAR repository, temporary folder and upload settings.
directories:
# alien4cloud main directory (other directories are relative path to this one)
alien: ~/.brooklyn/alien
alien: runtime
# directory in which alien4cloud stores Cloud Service Archives
csar_repository: csar
# directory in which alien4cloud stores uploaded artifacts (war etc.).
Expand Down Expand Up @@ -37,8 +37,8 @@ components.search.boost:

elasticSearch:
clusterName: brooklyn-alien-es-cluster
local: true
client: false
local: true
resetData: false
prefix_max_expansions: 10

Expand Down
14 changes: 6 additions & 8 deletions src/main/assembly/files/conf/elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@

IGNORE:

index:
index:
number_of_shards: 1
number_of_replicas: 0

path:
data: ~/.brooklyn/alien/elasticsearch/data
work: ~/.brooklyn/alien/elasticsearch/work
logs: ~/.brooklyn/alien/elasticsearch/logs
path:
data: runtime/elasticsearch/data
work: runtime/elasticsearch/work
logs: runtime/elasticsearch/logs
conf: conf/

gateway:
gateway:
recover_after_nodes: 1
expected_nodes: 1
Loading

0 comments on commit 27b7684

Please sign in to comment.