You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by nakomis <gi...@git.apache.org> on 2017/04/07 09:47:22 UTC

[GitHub] brooklyn-docs pull request #164: Adds documentation for bundling catalog res...

GitHub user nakomis opened a pull request:

    https://github.com/apache/brooklyn-docs/pull/164

    Adds documentation for bundling catalog resources in a zip file

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nakomis/brooklyn-docs docs/resource-bundling

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-docs/pull/164.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #164
    
----
commit 3a75c55840230019a887c24badc58bebbff6871a
Author: Martin Harris <gi...@nakomis.com>
Date:   2017-04-07T09:46:43Z

    Adds documentation for bundling catalog resources in a zip file

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs issue #164: Adds documentation for bundling catalog resources ...

Posted by nakomis <gi...@git.apache.org>.
Github user nakomis commented on the issue:

    https://github.com/apache/brooklyn-docs/pull/164
  
    Closing in favour of #180 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #164: Adds documentation for bundling catalog res...

Posted by tbouron <gi...@git.apache.org>.
Github user tbouron commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/164#discussion_r114833401
  
    --- Diff: guide/ops/catalog/index.md ---
    @@ -371,6 +372,155 @@ increment an internal version number for the catalog item.
     When referencing a blueprint, if a version number is not specified 
     the latest non-snapshot version will be loaded when an entity is instantiated.
     
    +### Bundling Catalog Resources
    +
    +When deploying a blueprint, it is possible to deploy it as an OSGI bundle with additional resources scoped
    +to this bundle. This is particularly useful when, for example, deploying a Tomcat server with a `.war` file
    +which is deployed using a classpath path such as `classpath://mywar.war`.
    +
    +In this example, we will create a simple `server` catalog item, bundled with a simple text file.
    +
    +First, create the text file with some sample contents:
    +
    +~~~ bash
    +echo Hello, World! > myfile.txt
    +~~~
    +
    +Now create a file called `catalog.bom` with the following contents:
    +
    +~~~ yaml
    +brooklyn.catalog:
    +  bundle: script-server
    +  version: 1.0.0
    +  items:
    +  - id: script-server
    +    itemType: entity
    +    item:
    +      type: server
    +      brooklyn.config:
    +        files.runtime:
    +          classpath://myfile.txt: files/myfile.txt
    +~~~
    +
    +The `bundle: script-server` line specifies the OSGI bundle name for this blueprint. Any resources included
    +in this bundle will be accessible on the classpath, but will be scoped to this bundle. This prevents an
    +issue where multiple bundles include the same resource.
    +
    +To create the bundle, simply zip the `.bom` and `.txt` files as follows:
    +
    +~~~ bash
    +zip script-server.zip catalog.bom myfile.txt
    +~~~
    +
    +Currently the only supported method for uploading the bundle to the server is via the API, e.g. using
    --- End diff --
    
    Actually, you don't even have to zip the files, you can pass directly the folder to the `br` command


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #164: Adds documentation for bundling catalog res...

Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/164#discussion_r114839724
  
    --- Diff: guide/ops/catalog/index.md ---
    @@ -371,6 +372,155 @@ increment an internal version number for the catalog item.
     When referencing a blueprint, if a version number is not specified 
     the latest non-snapshot version will be loaded when an entity is instantiated.
     
    +### Bundling Catalog Resources
    +
    +When deploying a blueprint, it is possible to deploy it as an OSGI bundle with additional resources scoped
    +to this bundle. This is particularly useful when, for example, deploying a Tomcat server with a `.war` file
    +which is deployed using a classpath path such as `classpath://mywar.war`.
    +
    +In this example, we will create a simple `server` catalog item, bundled with a simple text file.
    +
    +First, create the text file with some sample contents:
    +
    +~~~ bash
    +echo Hello, World! > myfile.txt
    +~~~
    +
    +Now create a file called `catalog.bom` with the following contents:
    +
    +~~~ yaml
    +brooklyn.catalog:
    +  bundle: script-server
    +  version: 1.0.0
    +  items:
    +  - id: script-server
    +    itemType: entity
    +    item:
    +      type: server
    +      brooklyn.config:
    +        files.runtime:
    +          classpath://myfile.txt: files/myfile.txt
    +~~~
    +
    +The `bundle: script-server` line specifies the OSGI bundle name for this blueprint. Any resources included
    +in this bundle will be accessible on the classpath, but will be scoped to this bundle. This prevents an
    +issue where multiple bundles include the same resource.
    +
    +To create the bundle, simply zip the `.bom` and `.txt` files as follows:
    +
    +~~~ bash
    +zip script-server.zip catalog.bom myfile.txt
    +~~~
    +
    +Currently the only supported method for uploading the bundle to the server is via the API, e.g. using
    --- End diff --
    
    @tbouron cool. Can you give an example? I get an error when I try it:
    ```
    $ br catalog add .
    Post http://localhost:8081/v1/catalog: read .: is a directory
    $ cd .. && br catalog add bptest
    Post http://localhost:8081/v1/catalog: read bptest: is a directory
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #164: Adds documentation for bundling catalog res...

Posted by drigodwin <gi...@git.apache.org>.
Github user drigodwin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/164#discussion_r110355247
  
    --- Diff: guide/ops/catalog/index.md ---
    @@ -371,6 +372,121 @@ increment an internal version number for the catalog item.
     When referencing a blueprint, if a version number is not specified 
     the latest non-snapshot version will be loaded when an entity is instantiated.
     
    +### Bundling Catalog Resources
    +
    +When deploying a blueprint, it is possible to deploy as an OSGI bundle with additional resources scoped to
    +this bundle. This is particularly useful when, for example, deploying a Tomcat server with a `.war` file
    +which is deployed using a classpath path such as `classpath://mywar.war`.
    +
    +In this example, we will create a simple `server` catalog item, bundled with a simple text file
    --- End diff --
    
    Missing full stop


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #164: Adds documentation for bundling catalog res...

Posted by nakomis <gi...@git.apache.org>.
Github user nakomis closed the pull request at:

    https://github.com/apache/brooklyn-docs/pull/164


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #164: Adds documentation for bundling catalog res...

Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/164#discussion_r114828307
  
    --- Diff: guide/ops/catalog/index.md ---
    @@ -371,6 +372,155 @@ increment an internal version number for the catalog item.
     When referencing a blueprint, if a version number is not specified 
     the latest non-snapshot version will be loaded when an entity is instantiated.
     
    +### Bundling Catalog Resources
    +
    +When deploying a blueprint, it is possible to deploy it as an OSGI bundle with additional resources scoped
    +to this bundle. This is particularly useful when, for example, deploying a Tomcat server with a `.war` file
    +which is deployed using a classpath path such as `classpath://mywar.war`.
    +
    +In this example, we will create a simple `server` catalog item, bundled with a simple text file.
    +
    +First, create the text file with some sample contents:
    +
    +~~~ bash
    +echo Hello, World! > myfile.txt
    +~~~
    +
    +Now create a file called `catalog.bom` with the following contents:
    +
    +~~~ yaml
    +brooklyn.catalog:
    +  bundle: script-server
    +  version: 1.0.0
    +  items:
    +  - id: script-server
    +    itemType: entity
    +    item:
    +      type: server
    +      brooklyn.config:
    +        files.runtime:
    +          classpath://myfile.txt: files/myfile.txt
    +~~~
    +
    +The `bundle: script-server` line specifies the OSGI bundle name for this blueprint. Any resources included
    +in this bundle will be accessible on the classpath, but will be scoped to this bundle. This prevents an
    +issue where multiple bundles include the same resource.
    +
    +To create the bundle, simply zip the `.bom` and `.txt` files as follows:
    +
    +~~~ bash
    +zip script-server.zip catalog.bom myfile.txt
    +~~~
    +
    +Currently the only supported method for uploading the bundle to the server is via the API, e.g. using
    --- End diff --
    
    This isn't true any more. You can `br catalog add script-server.zip` too.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #164: Adds documentation for bundling catalog res...

Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/164#discussion_r114841357
  
    --- Diff: guide/ops/catalog/index.md ---
    @@ -371,6 +372,155 @@ increment an internal version number for the catalog item.
     When referencing a blueprint, if a version number is not specified 
     the latest non-snapshot version will be loaded when an entity is instantiated.
     
    +### Bundling Catalog Resources
    +
    +When deploying a blueprint, it is possible to deploy it as an OSGI bundle with additional resources scoped
    +to this bundle. This is particularly useful when, for example, deploying a Tomcat server with a `.war` file
    +which is deployed using a classpath path such as `classpath://mywar.war`.
    +
    +In this example, we will create a simple `server` catalog item, bundled with a simple text file.
    +
    +First, create the text file with some sample contents:
    +
    +~~~ bash
    +echo Hello, World! > myfile.txt
    +~~~
    +
    +Now create a file called `catalog.bom` with the following contents:
    +
    +~~~ yaml
    +brooklyn.catalog:
    +  bundle: script-server
    +  version: 1.0.0
    +  items:
    +  - id: script-server
    +    itemType: entity
    +    item:
    +      type: server
    +      brooklyn.config:
    +        files.runtime:
    +          classpath://myfile.txt: files/myfile.txt
    +~~~
    +
    +The `bundle: script-server` line specifies the OSGI bundle name for this blueprint. Any resources included
    +in this bundle will be accessible on the classpath, but will be scoped to this bundle. This prevents an
    +issue where multiple bundles include the same resource.
    +
    +To create the bundle, simply zip the `.bom` and `.txt` files as follows:
    +
    +~~~ bash
    +zip script-server.zip catalog.bom myfile.txt
    +~~~
    +
    +Currently the only supported method for uploading the bundle to the server is via the API, e.g. using
    --- End diff --
    
    My mistake, adding a directory works great.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #164: Adds documentation for bundling catalog res...

Posted by drigodwin <gi...@git.apache.org>.
Github user drigodwin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/164#discussion_r110355931
  
    --- Diff: guide/ops/catalog/index.md ---
    @@ -371,6 +372,121 @@ increment an internal version number for the catalog item.
     When referencing a blueprint, if a version number is not specified 
     the latest non-snapshot version will be loaded when an entity is instantiated.
     
    +### Bundling Catalog Resources
    +
    +When deploying a blueprint, it is possible to deploy as an OSGI bundle with additional resources scoped to
    +this bundle. This is particularly useful when, for example, deploying a Tomcat server with a `.war` file
    +which is deployed using a classpath path such as `classpath://mywar.war`.
    +
    +In this example, we will create a simple `server` catalog item, bundled with a simple text file
    +
    +First, create the text file with some sample contents:
    +
    +~~~ bash
    +echo Hello, World! > myfile.txt
    +~~~
    +
    +Now create a file called `catalog.bom` with the following contents:
    +
    +~~~ yaml
    +brooklyn.catalog:
    +  bundle: script-server
    +  version: 1.0.0
    +  items:
    +  - id: script-server
    +    itemType: entity
    +    item:
    +      type: server
    +      brooklyn.config:
    +        files.runtime:
    +          classpath://myfile.txt: files/myfile.txt
    +~~~
    +
    +The `bundle: script-server` line specifies the OSGI buldle name for this blueprint. Any resources included
    +in this bundle will be accessible on the classpath, but will be scoped to this bundle. This prevents an
    +issue where multiple bundles include the same resource.
    +
    +To create the bundle, simply zip the `.bom` and `.txt` files as follows:
    +
    +~~~ bash
    +zip script-server.zip catalog.bom myfile.txt
    +~~~
    +
    +Currently the only supported method for uploading the bundle to the server is via the API, e.g. using
    +`curl`:
    +
    +~~~ bash
    +curl -X POST -u admin:password -H "Content-Type: application/zip" --data-binary @/tmp/zip/script-server.zip "http://127.0.0.1:8081/v1/catalog"
    +~~~
    +
    +We can now deploy an instance of our script server as follows:
    +
    +~~~ yaml
    +location: localhost
    +services:
    +- type: script-server
    +~~~
    +
    +And we can now inspect the contents of the file copied to the server
    +
    +~~~ bash
    +$ cat /tmp/brooklyn-martin/apps/nl9djqbq2i/entities/EmptySoftwareProcess_g52gahfxnt/files/myfile.txt
    --- End diff --
    
    The preference is now to not include a `$` at the start of the line but, if required, to split the command and response into two blocks


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #164: Adds documentation for bundling catalog res...

Posted by drigodwin <gi...@git.apache.org>.
Github user drigodwin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/164#discussion_r110355127
  
    --- Diff: guide/ops/catalog/index.md ---
    @@ -371,6 +372,121 @@ increment an internal version number for the catalog item.
     When referencing a blueprint, if a version number is not specified 
     the latest non-snapshot version will be loaded when an entity is instantiated.
     
    +### Bundling Catalog Resources
    +
    +When deploying a blueprint, it is possible to deploy as an OSGI bundle with additional resources scoped to
    --- End diff --
    
    possible to deploy it as


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #164: Adds documentation for bundling catalog res...

Posted by tbouron <gi...@git.apache.org>.
Github user tbouron commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/164#discussion_r110357761
  
    --- Diff: guide/ops/catalog/index.md ---
    @@ -371,6 +372,141 @@ increment an internal version number for the catalog item.
     When referencing a blueprint, if a version number is not specified 
     the latest non-snapshot version will be loaded when an entity is instantiated.
     
    +### Bundling Catalog Resources
    +
    +When deploying a blueprint, it is possible to deploy as an OSGI bundle with additional resources scoped to
    +this bundle. This is particularly useful when, for example, deploying a Tomcat server with a `.war` file
    +which is deployed using a classpath path such as `classpath://mywar.war`.
    +
    +In this example, we will create a simple `server` catalog item, bundled with a simple text file
    +
    +First, create the text file with some sample contents:
    +
    +~~~ bash
    +echo Hello, World! > myfile.txt
    +~~~
    +
    +Now create a file called `catalog.bom` with the following contents:
    +
    +~~~ yaml
    +brooklyn.catalog:
    +  bundle: script-server
    +  version: 1.0.0
    +  items:
    +  - id: script-server
    +    itemType: entity
    +    item:
    +      type: server
    +      brooklyn.config:
    +        files.runtime:
    +          classpath://myfile.txt: files/myfile.txt
    +~~~
    +
    +The `bundle: script-server` line specifies the OSGI buldle name for this blueprint. Any resources included
    --- End diff --
    
    s/buldle/bundle/


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs issue #164: Adds documentation for bundling catalog resources ...

Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on the issue:

    https://github.com/apache/brooklyn-docs/pull/164
  
    @nakomis can you rebase this on master? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs issue #164: Adds documentation for bundling catalog resources ...

Posted by nakomis <gi...@git.apache.org>.
Github user nakomis commented on the issue:

    https://github.com/apache/brooklyn-docs/pull/164
  
    DO NOT MERGE. zip uploading is currently WIP feature


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---