You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by Christofer Dutz <ch...@codecentric.de> on 2015/05/19 11:02:11 UTC

Ways to use Brooklyn during development?

Hi,

Since reviewing some of the ApacheCon submissions for ApacheCon in Austin I am pretty interested in Booklyn. Unfortunately I haven’t had the opportunity to dig deeper. 

Now I have such an opportunity and wanted to ask if it is possible to integrate Brooklyn into my development process. 

I know that in general Brooklyn is constructed as Server-Centric approach, but as with other sever-centric approaches there usually is some serverless mode which I could use to use Brooklyn for setting up local dev environments during development. I would expect to be able to provide a blueprint and have that executed locally, eventually setting up some vagrant vms and provisioning them.

Am I on a completely wrong path? Would something like this make sense, but none has built it yet? If the later is valid … need/want help with this? 

I really like the notation and the general concept and that I can extend it with Java … this is one thing that I like most with Brooklyn :-)

Chris


-- 

Mit freundlichen Grüßen | Best regards
Christofer Dutz | Senior IT Consultant

codecentric AG | Kreuznacher Str. 30 | 60486 Frankfurt am Main | Deutschland 
mobil: +49 (0) 1525.3057806 <> 
www.codecentric.de <http://www.codecentric.de/> | blog.codecentric.de <http://blog.codecentric.de/> | www.meettheexperts.de <http://www.meettheexperts.de/> | www.more4fi.de <http://www.more4fi.de/>    


Sitz der Gesellschaft: Düsseldorf | HRB 63043 | Amtsgericht Düsseldorf
Vorstand: Michael Hochgürtel . Mirko Novakovic . Rainer Vehns
Aufsichtsrat: Patric Fedlmeier (Vorsitzender) . Klaus Jäger . Jürgen Schütz

Diese E-Mail einschließlich evtl. beigefügter Dateien enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und löschen Sie diese E-Mail und evtl. beigefügter Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen evtl. beigefügter Dateien sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.


Re: Ways to use Brooklyn during development?

Posted by Christofer Dutz <ch...@codecentric.de>.
Hi Svetoslav,

Sounds exactly like what I need … would be great if the maven plugin could handle this.
I will definitely have a look at this. Eventually I’ll whip up a pull request for the the maven plugin which allows to use this from the „pre-integration-test“ phase of maven … but in this case some sort of „post-integration-test“ phase that gracefully tares down the previously created instances would be great. I’ll definitely put this on my todo list for this Fridays „research day“ ;-)

Chris


-- 

Mit freundlichen Grüßen | Best regards
Christofer Dutz | Senior IT Consultant

codecentric AG | Kreuznacher Str. 30 | 60486 Frankfurt am Main | Deutschland 
mobil: +49 (0) 1525.3057806 <> 
www.codecentric.de <http://www.codecentric.de/> | blog.codecentric.de <http://blog.codecentric.de/> | www.meettheexperts.de <http://www.meettheexperts.de/> | www.more4fi.de <http://www.more4fi.de/>    


Sitz der Gesellschaft: Düsseldorf | HRB 63043 | Amtsgericht Düsseldorf
Vorstand: Michael Hochgürtel . Mirko Novakovic . Rainer Vehns
Aufsichtsrat: Patric Fedlmeier (Vorsitzender) . Klaus Jäger . Jürgen Schütz

Diese E-Mail einschließlich evtl. beigefügter Dateien enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und löschen Sie diese E-Mail und evtl. beigefügter Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen evtl. beigefügter Dateien sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.

> Am 22.05.2015 um 22:57 schrieb Svetoslav Neykov <sv...@cloudsoftcorp.com>:
> 
> launch


Re: Ways to use Brooklyn during development?

Posted by Svetoslav Neykov <sv...@cloudsoftcorp.com>.
Hi Chris,
To add to Aled's response, there's nothing inherently server-centric in Brooklyn's design. You can run it as a local application which will handle spinning up new machines, installing the software and managing it.
When launching Brooklyn just point it to the blueprint and it will take care of executing it. I've made a small improvement for this case at https://github.com/apache/incubator-brooklyn/pull/656 <https://github.com/apache/incubator-brooklyn/pull/656>. This will instruct the instance to exit once the blueprint application is up and running, leaving any further management to you. When coupled with persisting the state, you can bring up the instance at any time later to let Brooklyn manage the processes again.

To execute a blueprint and the immediately exit, without enabling the web console (i.e. batch mode):

bin/brooklyn launch --app <path to blueprint> --exitAndLeaveAppsRunningAfterStarting --persist auto --noConsole

To start Brooklyn later, loading the application state:

bin/brooklyn launch --persist auto

This will let you monitor and manage the running entities from the web console.

Vagrant support is not currently included in Brooklyn by default, but it's straightforward to add it.
  * mvn clean install on https://github.com/neykov/vagrant-java-bindings <https://github.com/neykov/vagrant-java-bindings>
  * mvn clean install on https://github.com/neykov/jclouds-vagrant/tree/vagrant/vagrant <https://github.com/neykov/jclouds-vagrant/tree/vagrant/vagrant>
  * copy the above jars to the brooklyn's lib/dropins folder
  * download a vagrant box - vagrant box add ubuntu/trusty64
  * configure a brooklyn location:
	brooklyn.location.jclouds.vagrant.imageId=ubuntu/vivid64
	brooklyn.location.jclouds.vagrant.identity=not_used_but_required
	brooklyn.location.jclouds.vagrant.credential=not_used_but_required
  * in blueprints use "location: vagrant" or start Brooklyn with "--location vagrant"

It's always interesting to see the different ways Brooklyn is used, also any improvements or suggestions are welcome!

Svet.




> On 19.05.2015 г., at 16:35, Aled Sage <al...@gmail.com> wrote:
> 
> Hi Chris,
> 
> Great to hear you're trying out Brooklyn!
> 
> For running Brooklyn serverless, you can either just run the Brooklyn process on your laptop telling it to deploy to localhost (or to local VMs), or you can interact with brooklyn programmatically to embed it.
> 
> You'll likely find the separate Brooklyn process easier to setup.
> 
> ---
> For many blueprints, they are written to be able to deploy to localhost (but some require sudo rights, and passwordless ssh).
> 
> In yaml, you just say:
> 
>   location: localhost
> 
> ---
> For deploying to local VMs, note that we're using Apache jclouds under the covers.
> 
> You can therefore deploy to anything that jclouds supports (and a few more things).
> 
> I know that *Svet Neykov* did some work to be able to deploy to Vagrant (so that it launches/terminates the VMs for you).
> 
> You can also use a "byon" location (bring your own nodes), configuring Brooklyn to target existing ssh'able VMs. You just supply the IPs, username and credential (if it's not your default ~/.ssh/id_rsa or ~/.ssh/id_dsa).
> 
> ---
> Lastly, you can deploy to Docker containers using the downstream Clocker project [1].
> 
> ---
> Also of interest is a maven plugin that allows you to hook Brooklyn into your build process.
> 
> You can use Brooklyn to spin up your multi-node app (e.g. several VMs or docker containers), and inject its endpoint into a test suite. Your test suite can then run against that app instance. The app will be torn down once the test suite is complete.
> 
> *Sam Corbett* wrote that, and can provide more information.
> 
> Aled
> 
> [1] http://clocker.io
> 
> 
> On 19/05/2015 10:02, Christofer Dutz wrote:
>> Hi,
>> 
>> Since reviewing some of the ApacheCon submissions for ApacheCon in Austin I am pretty interested in Booklyn. Unfortunately I haven’t had the opportunity to dig deeper.
>> 
>> Now I have such an opportunity and wanted to ask if it is possible to integrate Brooklyn into my development process.
>> 
>> I know that in general Brooklyn is constructed as Server-Centric approach, but as with other sever-centric approaches there usually is some serverless mode which I could use to use Brooklyn for setting up local dev environments during development. I would expect to be able to provide a blueprint and have that executed locally, eventually setting up some vagrant vms and provisioning them.
>> 
>> Am I on a completely wrong path? Would something like this make sense, but none has built it yet? If the later is valid … need/want help with this?
>> 
>> I really like the notation and the general concept and that I can extend it with Java … this is one thing that I like most with Brooklyn :-)
>> 
>> Chris
>> 
>> 
> 


Re: Ways to use Brooklyn during development?

Posted by Aled Sage <al...@gmail.com>.
Hi Chris,

Great to hear you're trying out Brooklyn!

For running Brooklyn serverless, you can either just run the Brooklyn 
process on your laptop telling it to deploy to localhost (or to local 
VMs), or you can interact with brooklyn programmatically to embed it.

You'll likely find the separate Brooklyn process easier to setup.

---
For many blueprints, they are written to be able to deploy to localhost 
(but some require sudo rights, and passwordless ssh).

In yaml, you just say:

    location: localhost

---
For deploying to local VMs, note that we're using Apache jclouds under 
the covers.

You can therefore deploy to anything that jclouds supports (and a few 
more things).

I know that *Svet Neykov* did some work to be able to deploy to Vagrant 
(so that it launches/terminates the VMs for you).

You can also use a "byon" location (bring your own nodes), configuring 
Brooklyn to target existing ssh'able VMs. You just supply the IPs, 
username and credential (if it's not your default ~/.ssh/id_rsa or 
~/.ssh/id_dsa).

---
Lastly, you can deploy to Docker containers using the downstream Clocker 
project [1].

---
Also of interest is a maven plugin that allows you to hook Brooklyn into 
your build process.

You can use Brooklyn to spin up your multi-node app (e.g. several VMs or 
docker containers), and inject its endpoint into a test suite. Your test 
suite can then run against that app instance. The app will be torn down 
once the test suite is complete.

*Sam Corbett* wrote that, and can provide more information.

Aled

[1] http://clocker.io


On 19/05/2015 10:02, Christofer Dutz wrote:
> Hi,
>
> Since reviewing some of the ApacheCon submissions for ApacheCon in Austin I am pretty interested in Booklyn. Unfortunately I haven’t had the opportunity to dig deeper.
>
> Now I have such an opportunity and wanted to ask if it is possible to integrate Brooklyn into my development process.
>
> I know that in general Brooklyn is constructed as Server-Centric approach, but as with other sever-centric approaches there usually is some serverless mode which I could use to use Brooklyn for setting up local dev environments during development. I would expect to be able to provide a blueprint and have that executed locally, eventually setting up some vagrant vms and provisioning them.
>
> Am I on a completely wrong path? Would something like this make sense, but none has built it yet? If the later is valid … need/want help with this?
>
> I really like the notation and the general concept and that I can extend it with Java … this is one thing that I like most with Brooklyn :-)
>
> Chris
>
>