Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/latest-upstream' into release-5.…
Browse files Browse the repository at this point in the history
…0-reverted-222

fix various places where this conflicted with reversion of 222 or caused errors
  • Loading branch information
ahgittin committed Sep 4, 2018
2 parents a0314df + 97515cb commit d616fbf
Show file tree
Hide file tree
Showing 89 changed files with 337 additions and 744 deletions.
542 changes: 24 additions & 518 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion NOTICE
@@ -1,5 +1,5 @@
Apache Brooklyn
Copyright 2014-2016 The Apache Software Foundation
Copyright 2014-2018 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
8 changes: 4 additions & 4 deletions guide/blueprints/advanced-example.md
Expand Up @@ -36,10 +36,10 @@ There are four blueprints that make up this application. Each of them are used t
* [ELK](example_yaml/brooklyn-elk-catalog.bom)

#### Running the example
First, add all four blueprints to the Brooklyn Catalog. This can be done by clicking the 'Catalog' tab, clicking the '+'
symbol and pasting the YAML. Once this is done, click the 'Application' tab, then the '+' button to bring up the add
application wizard. A new Catalog application will be available called 'ELK Stack'. Using the add application wizard,
you should be able to deploy an ELK stack to a location of your choosing. Alternatively use the `br` Brooklyn
First, add all four blueprints to the Brooklyn Catalog. This can be done by going to the "Catalog" module, then clicking the
buttom "Upload to catalog" and selecting the above blueprints (or drag-and-drop them) Once this is done, search for an
entity called "ELK Stack". You will be able to deploy it by clicking on the "Deploy" button from the details page.
Note that you can also perform this operation from the quick launch panel on the homepage. Alternatively use the `br` Brooklyn
command line tool and add the files with `br catalog add`.

#### Exploring the example
Expand Down
4 changes: 3 additions & 1 deletion guide/blueprints/ansible/creating-ansible-blueprints.md
Expand Up @@ -212,4 +212,6 @@ services:
https_port: 8443
admin_username: admin
admin_password: secret
```
```


19 changes: 15 additions & 4 deletions guide/blueprints/catalog/management.md
Expand Up @@ -5,14 +5,25 @@ layout: website-normal

### Catalog Management

The Catalog tab in the web console will show all versions of catalog items,
The Catalog module (from the tile on the homepage, or the module switch on the top right) in the web console will show all versions of catalog items,
and allow you to add new items.


#### Adding to the Catalog

On the UI the "add" button <img src="images/add-to-catalog.png" width="24" alt="add-to-catalog" /> at the top of the menu panel allows the
addition of new Applications to the catalog, via YAML, and of new Locations.
There are three ways of adding items to the catalog from the UI.

1. **From the Catalog Module**: Click on the "Upload to catalog" button located on the top right corner then follow the
instructions. Alternatively, you can directly drag and drop items on the screen. This will accept `*.bom`, `*.jar` and `*.zip` files.

2. **From the Blueprint Composer module**:
If you have composed a blueprint on the fly in the Blueprint Composer, you can save it into the catalog by clicking on the
"Add to catalog button" located on the bottom right on the screen. A modal will then be displayed which will ask you for the
required metadata regarding this new item.

3. **From the Blueprint Importer module**:
If you already have catalog items, you can paste them into the importer editor then click on the "Import button".
This allows you to import any types of items, including locations.

In addition to the GUI, items can be added to the catalog via the REST API
with a `POST` of the YAML file to `/v1/catalog` endpoint.
Expand All @@ -32,7 +43,7 @@ br catalog add /path/to/riak.catalog.bom

#### Deleting from the Catalog

On the UI, if an item is selected, a 'Delete' button in the detail panel can be used to delete it from the catalog.
On the UI, if you are viewing a bundle page, a "Delete" button can be used to delete it from the catalog.

Using the REST API, you can delete a versioned item from the catalog using the corresponding endpoint.
For example, to delete the item with id `datastore` and version `1.0` with `curl`:
Expand Down
Binary file modified guide/blueprints/catalog/mysql-in-catalog-w700.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guide/blueprints/catalog/mysql-in-catalog.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions guide/blueprints/catalog/templates.md
Expand Up @@ -7,8 +7,8 @@ layout: website-normal

A `template` is a full application. It consists of one or more entities inside an application
(though this is also composable: it can be used as part of another application).
When a `template` is added to the catalog, the blueprint will appear in the 'Create Application' dialog
as shown here:
When a `template` is added to the catalog, the blueprint will appear in quick launch on the homepage. A click on these
items will let you quickly deploy them as shown here:

[![MySQL in Brooklyn Catalog](mysql-in-catalog-w700.png "MySQL in Brooklyn Catalog")](mysql-in-catalog.png)

7 changes: 4 additions & 3 deletions guide/blueprints/creating-yaml.md
Expand Up @@ -32,9 +32,10 @@ Here's a very simple YAML blueprint plan, to explain the structure:
This is the meat of the blueprint plan, as you'll see below.

Finally, the clipboard in the top-right corner of the example plan box above (hover your cursor over the box) lets you easily copy-and-paste into the web-console:
simply [download and launch]({{ site.path.guide }}/start/running.html) Brooklyn,
then in the "Create Application" dialog at the web console
(usually [http://127.0.0.1:8081/](http://127.0.0.1:8081/), paste the copied YAML into the "Yaml" tab of the dialog and press "Finish".
simply [download and launch]({{book.path.docs}}/start/running.md) Brooklyn,
open a new browser window (usually) at [http://127.0.0.1:8081/](http://127.0.0.1:8081/).
Click on the tile "Blueprint Composer", then on the double-arrow located on the top right of the screen (to switch to the YAML mode),
paste the copied YAML into the editor and press "Deploy".
There are several other ways to deploy, including `curl` and via the command-line,
and you can configure users, https, persistence, and more,
as described [in the ops guide]({{ site.path.guide }}/ops/).
Expand Down
83 changes: 7 additions & 76 deletions guide/blueprints/entity-configuration.md
Expand Up @@ -44,39 +44,16 @@ blueprint (i.e. inside the `brooklyn.config` block).
It can also explicitly declare config keys, using the `brooklyn.parameters` block. The example
below illustrates the principle:

{% highlight yaml %}
brooklyn.catalog:
items:
- id: entity-config-example
itemType: entity
name: Entity Config Example
item:
type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
brooklyn.parameters:
- name: custom.message
type: string
description: Message to be displayed
default: Hello
brooklyn.config:
shell.env:
MESSAGE: $brooklyn:config("custom.message")
launch.command: |
echo "My example launch command: $MESSAGE"
checkRunning.command: |
echo "My example checkRunning command: $MESSAGE"
{% endhighlight %}
!CODEFILE "example_yaml/entity-config-catalog.yaml"

Once added to the catalog, it can be used with the simple blueprint below (substituting the location
of your choice). Because no configuration has been overridden, this will use the default value
for `custom.message`, and will use the given values for `launch.command` and `checkRunning.command`:

{% highlight yaml %}
location: aws-ec2:us-east-1
services:
- type: entity-config-example
{% endhighlight %}
!CODEFILE "example_yaml/entity-config-app.yaml"

For details of how to write and add catalog items, see [Catalog]({{ site.path.guide }}/blueprints/catalog/).
For details of how to write and add catalog items, see [Catalog]({{book.path.docs}}/blueprints/catalog/index.md),
and for a complete reference on the syntax of `brooklyn.parameters` see that section of the [YAML Reference]({{book.path.docs}}/blueprints/yaml-reference.md).


#### Config Key Constraints
Expand All @@ -91,48 +68,11 @@ can be any of:

This is illustrated in the example below:

{% highlight yaml %}
brooklyn.catalog:
items:
- id: entity-constraint-example
itemType: entity
name: Entity Config Example
item:
type: org.apache.brooklyn.entity.stock.BasicEntity
brooklyn.parameters:
- name: compulsoryExample
type: string
constraints:
- required
- name: addressExample
type: string
constraints:
- regex: ^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$
- name: numberExample
type: double
constraints:
- $brooklyn:object:
type: org.apache.brooklyn.util.math.MathPredicates
factoryMethod.name: greaterThan
factoryMethod.args:
- 0.0
- $brooklyn:object:
type: org.apache.brooklyn.util.math.MathPredicates
factoryMethod.name: lessThan
factoryMethod.args:
- 256.0
{% endhighlight %}
!CODEFILE "example_yaml/entity-constraint-catalog.yaml"

An example usage of this toy example, once added to the catalog, is shown below:

{% highlight yaml %}
services:
- type: entity-constraint-example
brooklyn.config:
compulsoryExample: foo
addressExample: 1.1.1.1
numberExample: 2.0
{% endhighlight %}
!CODEFILE "example_yaml/entity-constraint-app.yaml"


### Inheriting Configuration
Expand Down Expand Up @@ -167,16 +107,7 @@ consider the `entity-config-example` added to the catalog in the section
[Configuration in a Catalog Item](#configuration-in-a-catalog-item).
We can override these values. If not overridden, then the existing values from the super-type will be used:

{% highlight yaml %}
location: aws-ec2:us-east-1
services:
- type: entity-config-example
brooklyn.config:
custom.message: Goodbye
launch.command: |
echo "Sub-type launch command: $MESSAGE"
{% endhighlight %}

!CODEFILE "example_yaml/entity-config-override-app.yaml"


In this example, the `custom.message` overrides the default defined on the config key.
Expand Down
Expand Up @@ -12,4 +12,4 @@ services:
name: DB HelloWorld Visitors
brooklyn.config:
creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
datastore.creation.script.url: https://github.com/apache/brooklyn-library/blob/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
datastore.creation.script.template.url: https://github.com/apache/brooklyn-library/blob/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
4 changes: 2 additions & 2 deletions guide/blueprints/example_yaml/appserver-clustered-w-db.yaml
Expand Up @@ -12,7 +12,7 @@ services:
java.sysprops:
brooklyn.example.db.url:
$brooklyn:formatString:
- jdbc:%s%s?user=%s\\&password=%s
- "jdbc:%s%s?user=%s&password=%s"
- $brooklyn:component("db").attributeWhenReady("datastore.url")
- visitors
- brooklyn
Expand All @@ -22,5 +22,5 @@ services:
name: DB HelloWorld Visitors
brooklyn.config:
creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
datastore.creation.script.url: https://github.com/apache/brooklyn-library/blob/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
datastore.creation.script.template.url: https://github.com/apache/brooklyn-library/blob/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql

Expand Up @@ -8,7 +8,7 @@ services:
java.sysprops:
brooklyn.example.db.url:
$brooklyn:formatString:
- jdbc:%s%s?user=%s\\&password=%s
- "jdbc:%s%s?user=%s&password=%s"
- $brooklyn:component("db").attributeWhenReady("datastore.url")
- visitors
- brooklyn
Expand All @@ -18,6 +18,6 @@ services:
name: DB HelloWorld Visitors
brooklyn.config:
creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
datastore.creation.script.url: https://github.com/apache/brooklyn-library/raw/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
datastore.creation.script.template.url: https://github.com/apache/brooklyn-library/raw/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
provisioning.properties:
minRam: 8192
4 changes: 2 additions & 2 deletions guide/blueprints/example_yaml/appserver-w-db.yaml
Expand Up @@ -8,7 +8,7 @@ services:
java.sysprops:
brooklyn.example.db.url:
$brooklyn:formatString:
- jdbc:%s%s?user=%s\\&password=%s
- "jdbc:%s%s?user=%s&password=%s"
- $brooklyn:component("db").attributeWhenReady("datastore.url")
- visitors
- brooklyn
Expand All @@ -18,4 +18,4 @@ services:
name: DB HelloWorld Visitors
brooklyn.config:
creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
datastore.creation.script.url: https://github.com/apache/brooklyn-library/raw/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
datastore.creation.script.template.url: https://github.com/apache/brooklyn-library/raw/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
4 changes: 2 additions & 2 deletions guide/blueprints/example_yaml/appserver-w-policy.yaml
Expand Up @@ -12,7 +12,7 @@ services:
java.sysprops:
brooklyn.example.db.url:
$brooklyn:formatString:
- jdbc:%s%s?user=%s\\&password=%s
- "jdbc:%s%s?user=%s&password=%s"
- $brooklyn:component("db").attributeWhenReady("datastore.url")
- visitors
- brooklyn
Expand All @@ -30,4 +30,4 @@ services:
name: DB HelloWorld Visitors
brooklyn.config:
creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
datastore.creation.script.url: https://github.com/apache/brooklyn-library/raw/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
datastore.creation.script.template.url: https://github.com/apache/brooklyn-library/raw/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
4 changes: 4 additions & 0 deletions guide/blueprints/example_yaml/entity-config-app.yaml
@@ -0,0 +1,4 @@
location: aws-ec2:us-east-1
name: entity-config-example
services:
- type: entity-config-example
19 changes: 19 additions & 0 deletions guide/blueprints/example_yaml/entity-config-catalog.yaml
@@ -0,0 +1,19 @@
brooklyn.catalog:
items:
- id: entity-config-example
itemType: entity
name: Entity Config Example
item:
type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
brooklyn.parameters:
- name: custom.message
type: string
description: Message to be displayed
default: Hello
brooklyn.config:
shell.env:
MESSAGE: $brooklyn:config("custom.message")
launch.command: |
echo "My example launch command: $MESSAGE"
checkRunning.command: |
echo "My example checkRunning command: $MESSAGE"
8 changes: 8 additions & 0 deletions guide/blueprints/example_yaml/entity-config-override-app.yaml
@@ -0,0 +1,8 @@
location: aws-ec2:us-east-1
name: entity-config-override-example
services:
- type: entity-config-example
brooklyn.config:
custom.message: Goodbye
launch.command: |
echo "Sub-type launch command: $MESSAGE"
7 changes: 7 additions & 0 deletions guide/blueprints/example_yaml/entity-constraint-app.yaml
@@ -0,0 +1,7 @@
name: entity-constraint-example
services:
- type: entity-constraint-example
brooklyn.config:
compulsoryExample: foo
addressExample: 1.1.1.1
numberExample: 2.0
29 changes: 29 additions & 0 deletions guide/blueprints/example_yaml/entity-constraint-catalog.yaml
@@ -0,0 +1,29 @@
brooklyn.catalog:
items:
- id: entity-constraint-example
itemType: entity
name: Entity Config Example
item:
type: org.apache.brooklyn.entity.stock.BasicEntity
brooklyn.parameters:
- name: compulsoryExample
type: string
constraints:
- required
- name: addressExample
type: string
constraints:
- regex: ^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$
- name: numberExample
type: double
constraints:
- $brooklyn:object:
type: org.apache.brooklyn.util.math.MathPredicates
factoryMethod.name: greaterThan
factoryMethod.args:
- 0.0
- $brooklyn:object:
type: org.apache.brooklyn.util.math.MathPredicates
factoryMethod.name: lessThan
factoryMethod.args:
- 256.0
Expand Up @@ -5,7 +5,7 @@ locations:
services:
- type: org.apache.brooklyn.entity.group.DynamicFabric
brooklyn.config:
dynamiccfabric.memberspec:
dynamicfabric.memberspec:
$brooklyn:entitySpec:
type: org.apache.brooklyn.entity.group.DynamicCluster
brooklyn.config:
Expand Down
Expand Up @@ -6,5 +6,6 @@ services:
brooklyn.config:
download.url: file:///tmp/netcat-server.tgz
launch.command: |
chmod +x start.sh
./start.sh &
echo $! > $PID_FILE
Expand Up @@ -66,7 +66,11 @@ services:
name: sayHiNetcat
description: Echo a small hello string to the netcat entity
command: |
echo $message | nc $TARGET_HOSTNAME 4321
# Uncomment the appropriate command for your operating system
# for Linux:
# echo $message | nc -N $TARGET_HOSTNAME 4321
# for MacOS:
# echo $message | nc $TARGET_HOSTNAME 4321
parameters:
message:
description: The string to pass to netcat
Expand Down
Expand Up @@ -21,7 +21,7 @@ services:
name: My DB
brooklyn.config:
creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
datastore.creation.script.url: https://bit.ly/brooklyn-visitors-creation-script
datastore.creation.script.template.url: https://bit.ly/brooklyn-visitors-creation-script
- type: org.apache.brooklyn.test.framework.TestHttpCall
name: Check HTTP Response Status Code
brooklyn.config:
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guide/blueprints/test/images/getting-started-blueprint-test.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guide/blueprints/web-console-yaml-700.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guide/blueprints/web-console-yaml.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d616fbf

Please sign in to comment.