Skip to content

Commit

Permalink
Merge pull request #134 from cloudsoft/fix-brooklyn-compatibility
Browse files Browse the repository at this point in the history
Further updates for latest brooklyn and docs
  • Loading branch information
ahgittin authored Apr 7, 2019
2 parents cf186e7 + bdd3300 commit 2f59e55
Show file tree
Hide file tree
Showing 17 changed files with 149 additions and 265 deletions.
201 changes: 0 additions & 201 deletions LICENSE

This file was deleted.

19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ This package 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).

It can be run as a standalone file, launching Brooklyn, or the JAR dropped in to your own Brooklyn.
This builds a plugin JAR that installs in to Apache Brooklyn.
This also builds a graphical TOSCA client that connects to Apache Brooklyn.


## Build Notes
Expand All @@ -22,18 +23,24 @@ compare with the version at [ahgittin/alien4cloud misc branch](https://github.co

Then simply:

mvn clean install assembly:single
mvn clean install


## Running

See the README.md file in the resulting archive (in `target`) for runtime instructions.
You may also find that file [here](brooklyn-tosca-dist/src/main/assembly/files/README.md).
Once the project is built:

* To install TOSCA backend support into Apache Brooklyn, see the instructions in the [`karaf/init`](karaf/init/README.md) project
that builds a plugin to Apache Brooklyn.

## TODO Tasks
* To build and run a graphical TOSCA client, unpack the `brooklyn-tosca-dist` archive (in the `tar.gz` in that project's `target/`),
and consult the `README.md` there. You can also find that file [here](brooklyn-tosca-dist/src/main/assembly/files/README.md).
Note this requires a different configuration for the plugin installed to Apache Brooklyn.

### Very Soon

## Roadmap

### Backlog

* add catalog items from TOSCA specs, one by one or by import

Expand Down
64 changes: 29 additions & 35 deletions brooklyn-tosca-dist/src/main/assembly/files/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
brooklyn-tosca
brooklyn-tosca - graphical client dist
===

## Overview
Expand All @@ -7,56 +7,50 @@ 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).

This project builds the TOSCA (Alien4Cloud) graphical client configured for use with Apache Brooklyn.

## Running
To support TOSCA in Apache Brooklyn this client is not necessary; see the instructions at
[the root of this project](https://github.com/cloudsoft/brooklyn-tosca/blob/master/README.md).

### Quickstart: No Alien4Cloud UI

In the unpacked archive, the simplest way to get started is to run with:
## Launching the Alien4Cloud UI

nohup ./brooklyn.sh launch &
To launch a standalone A4C instance, edit the config file in `alien4cloud-standalone/` as desired.

This will launch the Alien4Cloud core platform embedded, 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`.

### Quickstart: With Alien4Cloud UI

To launch a standalone A4C instance, edit the config file in
`alien4cloud-standalone/` as desired then run:
Next ensure Apache Brooklyn is stopped, and run:

nohup alien4cloud-standalone/alien4cloud.sh &

Alien4Cloud will be running on port 8091, as set in that config.
Alien4Cloud will be running on port 8091 (UI), 9200 and 9300, 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:
To configure the Apache Brooklyn with the TOSCA plugin to use this instance of the Alien4Cloud server,
the `alien4cloud-config.yml` it uses must be changed: where the line `client: false` appears,
replace it with the following lines:

```
client: true
transportClient: true
hosts: localhost:9300
```

nohup ./brooklyn.sh launch -Dalien4cloud-config.file=conf/alien4cloud-config.client-to-localhost.yml &
The `hosts` value should point to at least one server and port where the alien4cloud ElasticSearch
backend has been launched (in this configuration it is launched as part of the A4C UI, so with both
on the same server, the value above is correct.)

Note that A4C launches ES with no credentials required,
so the ES instance should be secured at the network level
(which they are in this configuration as it is only bound to localhost).
Restart Apache Brooklyn, and when both are fully initialized, connect to the UIs at:

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.
* Apache Brooklyn: http://localhost:8081/
* TOSCA Graphical Alien4Cloud Client (admin/admin): http://localhost:8091/

### Quickstart: TOSCA disabled

If you wish to start Brooklyn with TOSCA modules disabled then run:
## Operations

nohup ./brooklyn.sh launch -Dbrooklyn.experimental.feature.tosca=false
Note that A4C launches with the default UI credentials and _no_ credentials at the ES layer,
so everything should be secured at the network level
(which they are in this configuration as things are only bound to localhost).

You may also set `brooklyn.experimental.feature.tosca` in your `brooklyn.properties` file.
Other ES configurations are supported for production usage, with multiple Apache Brooklyn
and TOSCA Graphical A4C servers pointed at the A4C ES backend.


## Supported TOSCA Syntax
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import javax.inject.Inject;

import org.apache.brooklyn.api.mgmt.classloading.BrooklynClassLoadingContext;
import org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.BrooklynDslCommon;
import org.apache.brooklyn.config.ConfigKey;
import org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess;
Expand Down Expand Up @@ -557,8 +558,8 @@ public Alien4CloudApplication newToscaApplication(String id) {
}

@Override
public Alien4CloudApplication parsePlan(String plan, Uploader uploader) {
ParsingResult<Csar> tp = new ToscaParser(uploader).parse(plan);
public Alien4CloudApplication parsePlan(String plan, Uploader uploader, BrooklynClassLoadingContext context) {
ParsingResult<Csar> tp = new ToscaParser(uploader).parse(plan, context);
Csar csar = tp.getResult();
return newToscaApplication(csar);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import java.nio.file.Path;
import java.util.Map;

import org.apache.brooklyn.api.mgmt.classloading.BrooklynClassLoadingContext;
import org.apache.brooklyn.api.typereg.RegisteredTypeLoadingContext;
import org.apache.brooklyn.camp.brooklyn.spi.dsl.BrooklynDslDeferredSupplier;
import org.apache.brooklyn.config.ConfigKey;

Expand Down Expand Up @@ -102,14 +104,16 @@ public interface ToscaFacade<A extends ToscaApplication> {
/**
* @param plan the Tosca plan to parse
* @param uploader the Uploader object to use
* @param context
* @return a new ToscaApplication
*/
A parsePlan(String plan, Uploader uploader);
A parsePlan(String plan, Uploader uploader, BrooklynClassLoadingContext context);

/**
*
* @param path the path to a CSAR archive
* @param uploader the Uploader object to use
* @param context
* @return a new ToscaApplication
*/
A parsePlan(Path path, Uploader uploader);
Expand Down
Loading

0 comments on commit 2f59e55

Please sign in to comment.