You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Guillaume Nodet <no...@github.com> on 2017/05/10 07:50:43 UTC

[jclouds/jclouds-karaf] Add built time karaf feature verification (#102)

You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-karaf/pull/102

-- Commit Summary --

  * Add built time karaf feature verification

-- File Changes --

    M feature-labs/pom.xml (34)
    M feature/pom.xml (33)
    M feature/src/main/feature/feature.xml (6)

-- Patch Links --

https://github.com/jclouds/jclouds-karaf/pull/102.patch
https://github.com/jclouds/jclouds-karaf/pull/102.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/102

Re: [jclouds/jclouds-karaf] Add built time karaf feature verification (#102)

Posted by Guillaume Nodet <no...@github.com>.
It should be possible to use the 4.0.x karaf plugin, but it has to be done slightly differently, as the verification is done implicitely.
Let me work on a fix.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/102#issuecomment-300691237

Re: [jclouds/jclouds-karaf] Add built time karaf feature verification (#102)

Posted by Guillaume Nodet <no...@github.com>.
@gnodet pushed 1 commit.

15d2f99  Fix karaf commands


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/102/files/18f0d03c4e18a7e4ef102d99fe1d4cb0d3857e16..15d2f9992a98d7712dc420825206bab01b55d20f

Re: [jclouds/jclouds-karaf] Add built time karaf feature verification (#102)

Posted by Ignasi Barrera <no...@github.com>.
Many thanks @gnodet!

I've been able to build this after applying the following changes:

```diff
diff --git a/feature-labs/pom.xml b/feature-labs/pom.xml
index 3d88eac..dd1e8b7 100644
--- a/feature-labs/pom.xml
+++ b/feature-labs/pom.xml
@@ -66,7 +66,7 @@ limitations under the License.
                       <feature>shell-compat</feature>
                   </framework>
                   <features>
-                      jclouds*
+                      <feature>jclouds*</feature>
                   </features>
                   <verifyTransitive>false</verifyTransitive>
                   <enableGeneration>false</enableGeneration>
diff --git a/feature-labs/src/main/feature/feature.xml b/feature-labs/src/main/feature/feature.xml
index 346e00a..e78d927 100644
--- a/feature-labs/src/main/feature/feature.xml
+++ b/feature-labs/src/main/feature/feature.xml
@@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 -->
-<features name="jclouds-labs-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.0.0">
+<features name="jclouds-labs-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.3.0">
     <repository>mvn:org.apache.jclouds.karaf/jclouds-karaf/${jclouds.version}/xml/features</repository>

     <feature name='jclouds-labs-all-blobstore' description='jclouds-labs - all - macro feature to bundle all blobstores' version='${project.version}'>
diff --git a/feature/pom.xml b/feature/pom.xml
index 1163554..a1bfdf4 100644
--- a/feature/pom.xml
+++ b/feature/pom.xml
@@ -92,7 +92,7 @@ limitations under the License.
                 <feature>shell-compat</feature>
             </framework>
             <features>
-                jclouds*
+                <feature>jclouds*</feature>
             </features>
             <enableGeneration>false</enableGeneration>
           </configuration>
diff --git a/feature/src/main/feature/feature.xml b/feature/src/main/feature/feature.xml
index cedefa0..7a6ff5b 100644
--- a/feature/src/main/feature/feature.xml
+++ b/feature/src/main/feature/feature.xml
@@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 -->
-<features name="jclouds-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.0.0">
+<features name="jclouds-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.3.0">

     <feature name='jclouds-all-blobstore' description='jclouds - all - macro feature to bundle all blobstores' version='${project.version}'>
         <feature version='${project.version}'>jclouds-api-s3</feature>
```

I've noticed the plugin requires Java 8 otherwise the build fails (that's why Jenkins complains). One of the reasons we haven't upgraded to 4.1 is because we still support Java 7 and need to be able to build the project with it. Is there any older version of the plugin that allows the same with Java 7?

Also, the feature verification does actually validate and install the features? I'm guessing just because of the time it takes. If that is the case (it would be great), we could remove the `itests` subproject, as it basically does the same thing.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/102#issuecomment-300623190

Re: [jclouds/jclouds-karaf] Add built time karaf feature verification (#102)

Posted by Andrew Phillips <no...@github.com>.
Thanks for helping out here so quickly, Guillaume!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/102#issuecomment-300657166

Re: [jclouds/jclouds-karaf] Add built time karaf feature verification (#102)

Posted by Guillaume Nodet <no...@github.com>.
gnodet commented on this pull request.



>          <feature version='${project.version}'>jclouds</feature>
+        <feature version='${project.version}'>jclouds-services</feature>

The url handler actually requires the `org.jclouds.blobstore.BlobStore` OSGi service which is provided by the `jclouds-services` feature, so it should be required.
However, the build still succeeds if I remove the above line, so I'll investigate.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/102#discussion_r115681378

Re: [jclouds/jclouds-karaf] Add built time karaf feature verification (#102)

Posted by Guillaume Nodet <no...@github.com>.
This last commit should fix the commands deployment.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/102#issuecomment-300757696

Re: [jclouds/jclouds-karaf] Add built time karaf feature verification (#102)

Posted by Andrew Gaul <no...@github.com>.
andrewgaul commented on this pull request.



>          <feature version='${project.version}'>jclouds</feature>
+        <feature version='${project.version}'>jclouds-services</feature>

Did you mix in some unrelated fix here?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/102#pullrequestreview-37235292

Re: [jclouds/jclouds-karaf] Add built time karaf feature verification (#102)

Posted by Guillaume Nodet <no...@github.com>.
The verify goal does not really install the features, however, if uses the same code as Karaf to run a resolution simulation for the feature, so it's guaranteed that the feature will install (but from runtime problems obviously).  I think it's generally safe to remove the integration tests if the only thing they do is to install the feature.  For such things, the verification goal is better.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/102#issuecomment-300696121

Re: [jclouds/jclouds-karaf] Add built time karaf feature verification (#102)

Posted by Andrew Phillips <no...@github.com>.
> Thanks! It works perfect now. About to merge!

Yayayay!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/102#issuecomment-300767291

Re: [jclouds/jclouds-karaf] Add built time karaf feature verification (#102)

Posted by Ignasi Barrera <no...@github.com>.
Thanks! It works perfect now. About to merge!

```bash
karaf@root()> jclouds:compute-service-create --name do --provider digitalocean2 --identity <identity> --credential <credential>
Waiting for compute service with name: do.
karaf@root()> jclouds:compute-service-list
Compute APIs:
-------------
[id]                     [type]       [service]
stub                     compute      [ ]


Compute Providers:
------------------
[id]                     [type]       [service]
digitalocean2            compute      [ do ]

karaf@root()> jclouds:location-list --name do
[id]          [scope]  [description]                   [parent]
digitalocean2 PROVIDER https://api.digitalocean.com/v2 <evalution error - see log>
sgp1          REGION   Singapore 1                     digitalocean2
fra1          REGION   Frankfurt 1                     digitalocean2
blr1          REGION   Bangalore 1                     digitalocean2
sfo2          REGION   San Francisco 2                 digitalocean2
lon1          REGION   London 1                        digitalocean2
nyc1          REGION   New York 1                      digitalocean2
ams3          REGION   Amsterdam 3                     digitalocean2
nyc2          REGION   New York 2                      digitalocean2
sfo1          REGION   San Francisco 1                 digitalocean2
tor1          REGION   Toronto 1                       digitalocean2
ams2          REGION   Amsterdam 2                     digitalocean2
nyc3          REGION   New York 3                      digitalocean2
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/102#issuecomment-300766639

Re: [jclouds/jclouds-karaf] Add built time karaf feature verification (#102)

Posted by Guillaume Nodet <no...@github.com>.
gnodet commented on this pull request.



>          <feature version='${project.version}'>jclouds</feature>
+        <feature version='${project.version}'>jclouds-services</feature>

Ah, I found what happens. 
Given the feature indicates a very old namespace, the karaf plugin disables the verification of runtime service dependencies.  However, if you change the namespace version to `http://karaf.apache.org/xmlns/features/v1.3.0`, then the verification will fail.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/102#discussion_r115681971

Re: [jclouds/jclouds-karaf] Add built time karaf feature verification (#102)

Posted by Guillaume Nodet <no...@github.com>.
@gnodet pushed 1 commit.

1d96d88  Use Karaf 4.0.x plugin to preserve JDK 7 compatibility.


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/102/files/7e7f9cea42068cac519abf6b03c27fdac35e990b..1d96d88b672ed1755251580d0e21f0e00504ee5a

Re: [jclouds/jclouds-karaf] Add built time karaf feature verification (#102)

Posted by Ignasi Barrera <no...@github.com>.
Thanks, @gnodet! Changes LGTM :)

I've built the branch, downloaded Karaf 4.0.9 and installed the jclouds features:

```bash
karaf@root()> feature:repo-add mvn:org.apache.jclouds.karaf/jclouds-karaf/2.1.0-SNAPSHOT/xml/features
Adding feature url mvn:org.apache.jclouds.karaf/jclouds-karaf/2.1.0-SNAPSHOT/xml/features
karaf@root()> feature:repo-add mvn:org.apache.jclouds.karaf/jclouds-karaf-labs/2.1.0-SNAPSHOT/xml/features
Adding feature url mvn:org.apache.jclouds.karaf/jclouds-karaf-labs/2.1.0-SNAPSHOT/xml/features
karaf@root()> feature:install jclouds-compute jclouds-services jclouds-commands jclouds-digitalocean2
karaf@root()> feature:list -i
Name                  | Version        | Required | State    | Repository             | Description
-----------------------------------------------------------------------------------------------------------------------------------------
jclouds-guice         | 2.1.0.SNAPSHOT |          | Started  | jclouds-2.1.0-SNAPSHOT | jclouds - Google Guice
jclouds               | 2.1.0.SNAPSHOT |          | Started  | jclouds-2.1.0-SNAPSHOT | jclouds
jclouds-blobstore     | 2.1.0.SNAPSHOT |          | Started  | jclouds-2.1.0-SNAPSHOT | jclouds - blobstore
jclouds-compute       | 2.1.0.SNAPSHOT | x        | Started  | jclouds-2.1.0-SNAPSHOT | jclouds - compute
jclouds-scriptbuilder | 2.1.0.SNAPSHOT |          | Started  | jclouds-2.1.0-SNAPSHOT | jclouds - scriptbuilder
jclouds-api-oauth     | 2.1.0.SNAPSHOT |          | Started  | jclouds-2.1.0-SNAPSHOT | jclouds - API - OAuth
jclouds-api-sts       | 2.1.0.SNAPSHOT |          | Started  | jclouds-2.1.0-SNAPSHOT | jclouds - API - STS
jclouds-digitalocean2 | 2.1.0.SNAPSHOT | x        | Started  | jclouds-2.1.0-SNAPSHOT | Components to access DigitalOcean v2
jclouds-services      | 2.1.0.SNAPSHOT | x        | Started  | jclouds-2.1.0-SNAPSHOT | OSGi Service Factories for jclouds
jclouds-commands      | 2.1.0.SNAPSHOT | x        | Started  | jclouds-2.1.0-SNAPSHOT | Karaf Commands for jclouds
aries-proxy           | 4.0.9          |          | Started  | standard-4.0.9         | Aries Proxy
aries-blueprint       | 4.0.9          | x        | Started  | standard-4.0.9         | Aries Blueprint
feature               | 4.0.9          | x        | Started  | standard-4.0.9         | Features Support
shell                 | 4.0.9          | x        | Started  | standard-4.0.9         | Karaf Shell
shell-compat          | 4.0.9          | x        | Started  | standard-4.0.9         | Karaf Shell Compatibility
deployer              | 4.0.9          | x        | Started  | standard-4.0.9         | Karaf Deployer
bundle                | 4.0.9          | x        | Started  | standard-4.0.9         | Provide Bundle support
config                | 4.0.9          | x        | Started  | standard-4.0.9         | Provide OSGi ConfigAdmin support
diagnostic            | 4.0.9          | x        | Started  | standard-4.0.9         | Provide Diagnostic support
instance              | 4.0.9          | x        | Started  | standard-4.0.9         | Provide Instance support
jaas                  | 4.0.9          | x        | Started  | standard-4.0.9         | Provide JAAS support
log                   | 4.0.9          | x        | Started  | standard-4.0.9         | Provide Log support
package               | 4.0.9          | x        | Started  | standard-4.0.9         | Package commands and mbeans
service               | 4.0.9          | x        | Started  | standard-4.0.9         | Provide Service support
system                | 4.0.9          | x        | Started  | standard-4.0.9         | Provide System support
kar                   | 4.0.9          | x        | Started  | standard-4.0.9         | Provide KAR (KARaf archive) support
ssh                   | 4.0.9          | x        | Started  | standard-4.0.9         | Provide a SSHd server on Karaf
management            | 4.0.9          | x        | Started  | standard-4.0.9         | Provide a JMX MBeanServer and a set of MBeans in
wrap                  | 0.0.0          | x        | Started  | standard-4.0.9         | Wrap URL handler
```

Everything looks fine but the `jclouds:` commands don't seem to be available. (If you want to try it you should be able to invoke `jclouds:compute-service-list` without needing to register any particular cloud provider). Is this something related to the need to migrate the commands to the new API, or is there any configuration we can apply to make them available again?

Thanks again for your support! 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/102#issuecomment-300747357

Re: [jclouds/jclouds-karaf] Add built time karaf feature verification (#102)

Posted by Guillaume Nodet <no...@github.com>.
@gnodet pushed 1 commit.

18f0d03  Remove the integration tests for feature installation as they are now verified by the karaf plugin


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/102/files/1d96d88b672ed1755251580d0e21f0e00504ee5a..18f0d03c4e18a7e4ef102d99fe1d4cb0d3857e16