Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-151

Implement an assembly 'extract' deployment option, with automatic detection of feature repositories

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.0
    • Component/s: None
    • Labels:
      None

      Description

      We should be able to drop a .tar.gz or .zip assembly into the deploy directory, containing a full assembly of features and bundles, and Karaf should thenextract it to system/ and automatically detect feature repositories and add them to the feature repository list.

      1. KARAF-151.patch
        33 kB
        Adrian Trenaman
      2. goodKarFile.kar
        1 kB
        Adrian Trenaman
      3. karFileAsZip.zip
        1 kB
        Adrian Trenaman
      4. karFileAsZipNoManifest.zip
        0.8 kB
        Adrian Trenaman
      5. KARAF-151-ArtifactInstaller.patch
        33 kB
        Adrian Trenaman

        Activity

        Hide
        jgoodyear Jamie goodyear added a comment -

        Hi Adrian, any update on this issue? We're discussing cutting a Karaf 2.1.0 release soon and I'd like to know if this issue may be worked on / resolved soon, otherwise we may push this one out to 2.2.0. Thanks

        Show
        jgoodyear Jamie goodyear added a comment - Hi Adrian, any update on this issue? We're discussing cutting a Karaf 2.1.0 release soon and I'd like to know if this issue may be worked on / resolved soon, otherwise we may push this one out to 2.2.0. Thanks
        Hide
        adrian.trenaman Adrian Trenaman added a comment -

        Hi Jaime,

        I'll have a release available tomorrow.

        Sound OK?


        Sent from my mobile device

        Show
        adrian.trenaman Adrian Trenaman added a comment - Hi Jaime, I'll have a release available tomorrow. Sound OK? – Sent from my mobile device
        Hide
        ccustine Chris Custine added a comment -

        I would hate to rush this if we are trying to start a release today or tomorrow. Since this is a feature addition and not a bug fix, I think we could go ahead with the release and add this in the next minor release after we have time to test it out a bit. Just my 2 cents.

        Show
        ccustine Chris Custine added a comment - I would hate to rush this if we are trying to start a release today or tomorrow. Since this is a feature addition and not a bug fix, I think we could go ahead with the release and add this in the next minor release after we have time to test it out a bit. Just my 2 cents.
        Hide
        jgoodyear Jamie goodyear added a comment -

        I would tend to agree with Chris on this. I really like this feature addition and think it should go into Karaf, however considering its many edge cases and platforms it needs to be verified on I think that we could postpone its inclusion until the next minor release.

        Show
        jgoodyear Jamie goodyear added a comment - I would tend to agree with Chris on this. I really like this feature addition and think it should go into Karaf, however considering its many edge cases and platforms it needs to be verified on I think that we could postpone its inclusion until the next minor release.
        Hide
        adrian.trenaman Adrian Trenaman added a comment -

        I agree with Chris. I do think this will be a really useful addition
        to Karaf, but there's no rush. And, even if I do get the deployer in,
        it will be a few days before I have the maven plugin in place to make
        the Karaf archives.

        So, please proceed with 2.1.0 for now.


        Sent from my mobile device

        Show
        adrian.trenaman Adrian Trenaman added a comment - I agree with Chris. I do think this will be a really useful addition to Karaf, but there's no rush. And, even if I do get the deployer in, it will be a few days before I have the maven plugin in place to make the Karaf archives. So, please proceed with 2.1.0 for now. – Sent from my mobile device
        Hide
        adrian.trenaman Adrian Trenaman added a comment -

        Have added a patch for this issue. Note also that some binary files (goodKarFile.kar, karFileAsZip.zip, karFileAsZipNoManifest.zip) need to be added which are not in the KARAF-151.patch file; these are required for running the JUnit tests and should be placed by hand in the deployer/kar/src/test/resources directory.

        While the extraction works fine, I have noted an issue with an IllegalStateException on shutting down the Karaf instance. I have noted this on the developer forum at

        http://karaf.922171.n3.nabble.com/Shutting-down-Karaf-I-get-an-IllegalStateException-Can-only-register-services-while-bundle-is-active-td1523512.html#a1523512

        Show
        adrian.trenaman Adrian Trenaman added a comment - Have added a patch for this issue. Note also that some binary files (goodKarFile.kar, karFileAsZip.zip, karFileAsZipNoManifest.zip) need to be added which are not in the KARAF-151 .patch file; these are required for running the JUnit tests and should be placed by hand in the deployer/kar/src/test/resources directory. While the extraction works fine, I have noted an issue with an IllegalStateException on shutting down the Karaf instance. I have noted this on the developer forum at http://karaf.922171.n3.nabble.com/Shutting-down-Karaf-I-get-an-IllegalStateException-Can-only-register-services-while-bundle-is-active-td1523512.html#a1523512
        Hide
        gnt Guillaume Nodet added a comment -

        I'm not sure I understand the use of the KarURLHandler.
        I think it would make more sense for KarDeploymentListener to implement ArtifactInstaller and do the archive extraction in the install method.
        Thoughts ?

        Show
        gnt Guillaume Nodet added a comment - I'm not sure I understand the use of the KarURLHandler. I think it would make more sense for KarDeploymentListener to implement ArtifactInstaller and do the archive extraction in the install method. Thoughts ?
        Hide
        adrian.trenaman Adrian Trenaman added a comment -

        Was using the other deployers as a starting template, hence the use of
        the Url handler. Artifact Installer soundss much more appropriate.

        Question: will the ArtifactInstaller allow me to do something like
        osgi:install kar:file:///opt/blah.kar?


        Sent from my mobile device

        Show
        adrian.trenaman Adrian Trenaman added a comment - Was using the other deployers as a starting template, hence the use of the Url handler. Artifact Installer soundss much more appropriate. Question: will the ArtifactInstaller allow me to do something like osgi:install kar: file:///opt/blah.kar? – Sent from my mobile device
        Hide
        gnt Guillaume Nodet added a comment -

        No, you're right you would not be able to use the osgi:install command.
        That said, another solution would be to use a dedicated command:
        features:archive xxxx
        or something like thtat.

        The downside I see to using a URL handler and a bundle installation is that you actually end up with a bundle installed in the framework which isn't really a bundle and you can't do anything with it but uninstalling (which has no effect).

        If you use for example the url handler for the features, which allows you to install a features descriptor using osgi:install, it actually install a bundle, but there is a lifecycle tied to this bundle: if you uninstall the bundle, the feature will be uninstalled.

        So why would you use the kar: url handler for exactly? Do you think a specific command would be more appropriate?

        Show
        gnt Guillaume Nodet added a comment - No, you're right you would not be able to use the osgi:install command. That said, another solution would be to use a dedicated command: features:archive xxxx or something like thtat. The downside I see to using a URL handler and a bundle installation is that you actually end up with a bundle installed in the framework which isn't really a bundle and you can't do anything with it but uninstalling (which has no effect). If you use for example the url handler for the features, which allows you to install a features descriptor using osgi:install, it actually install a bundle, but there is a lifecycle tied to this bundle: if you uninstall the bundle, the feature will be uninstalled. So why would you use the kar: url handler for exactly? Do you think a specific command would be more appropriate?
        Hide
        adrian.trenaman Adrian Trenaman added a comment -

        I hear ya!

        You are completely right: I don't wish to implement any 'uninstall'
        semantics, or create any pseudo bundles, so I'm going to move my code
        to an Artifact Installer for now, and maybe do a special command as
        you suggest at a later stage.

        Will get back to you with a new patch, hopefully by tomorrow.


        Sent from my mobile device

        Show
        adrian.trenaman Adrian Trenaman added a comment - I hear ya! You are completely right: I don't wish to implement any 'uninstall' semantics, or create any pseudo bundles, so I'm going to move my code to an Artifact Installer for now, and maybe do a special command as you suggest at a later stage. Will get back to you with a new patch, hopefully by tomorrow. – Sent from my mobile device
        Hide
        adrian.trenaman Adrian Trenaman added a comment -

        New patch now attached as 'KARAF-151-ArtifactInstaller.patch' - please ignore previous file 'KARAF-151.patch'.

        The code has been refactored to use the ArtifactInstaller class, and contains appropriate tests to 95% coverage.

        Show
        adrian.trenaman Adrian Trenaman added a comment - New patch now attached as ' KARAF-151 -ArtifactInstaller.patch' - please ignore previous file ' KARAF-151 .patch'. The code has been refactored to use the ArtifactInstaller class, and contains appropriate tests to 95% coverage.
        Hide
        gnt Guillaume Nodet added a comment -

        Great, the patch looks good. I'll commit it asap. Thx!

        Show
        gnt Guillaume Nodet added a comment - Great, the patch looks good. I'll commit it asap. Thx!

          People

          • Assignee:
            adrian.trenaman Adrian Trenaman
            Reporter:
            adrian.trenaman Adrian Trenaman
          • Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development