-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Composum does not work with the FileVault FSPackageRegistry #203
Comments
Right, this would require extending / rewriting the Composum package manager - right now it just works with the PackageManager, not with the newer PackageRegistry. I guess stuff from the PackageRegistry doesn't show up in the PackageManager. |
I have not found a way to determine the set of available PackageRegistries. That would be the entry point to generally use PackageRegistries instead of PackageManager. Trying to implement a custom PackageRegistry collector service fails because the JcrPackageRegistry does not implement a service. |
@DominikSuess @kwin - maybe you have an idea about how this can be achieved? |
Indeed that is not easily possible yet. I created https://issues.apache.org/jira/browse/JCRVLT-502 and https://issues.apache.org/jira/browse/JCRVLT-503 to ease working with it. You could try to act on JcrPackageManager.getRegistry() and then implement such a composite service to merge this with the FS based registry. Alternatively you have to act on both PackageRegistry (for the FS based registry) and the PackageManager (for the JCR based registry). |
I released FileVault 3.4.10 which exposes a Composite Package Registry. Hopefully that eases working with both registries... |
@rombert : how would you configure a Sling Starter 12 so that you get packages installed into a FSPackageRegistry? I enabled the FSPackageRegistry, but have trouble finding an easy way to put packages into it until the Composum Package Manager support is fully done. Neither filesystem install, nor installing the packages as features put's it there. |
@stoerr - I need to remember exactly what I did :-) I think this was centered around using https://github.com/apache/sling-org-apache-sling-feature-extension-content as a feature launcher extension. I'll try to come up with a concrete example next week. |
@rombert Thank you! Ah, OK, just what I did in https://issues.apache.org/jira/browse/JCRVLT-525 . Is that still used in Sling Starter 12? I didn't find the ExecutionPlanRepoInitializer there, but didn't try hard. Well, never mind - I'll just put in something programmatically for testing purposes. If you don't think that'd be educational for me and others, there is no need to spend time on that. |
@kwin / @rombert : I'm wondering: the JcrPackageManager has methods create, update, assemble that are used in the workflow of the Composum package manager. I do not see anything comparable in PackageRegistry. There are some things in JcrPackageRegistry, but even there I don't see something matching JcrPackageManager.assemble. How would you envision a new interface? I'm wondering whether we should actually move from JcrPackageManager to other, newer, interfaces (then I'm probably missing something), or just keep the JcrPackageManager stuff as it is for creating / updating / building JcrPackages , and add some new stuff for handling PackageRegistries , where we just support inspecting the packages, and upload/download/install/remove/extract, but no build=assemble and no modification. |
@rombert / @kwin : we've just merged a first version for this into develop (and the Composum Nodes 4.x branch sling12). It's testable with two registries by enabling the FS Package Registry Service in the felix console. The basic functionality is provided (upload / download / install / uninstall etc., inspect the package), though creating and editing packages can only be done with the old interface, as the package registry doesn't seem to provide that functionality. (The new interface is accessible by switching the tree by it's tabs.) I'm currently working on extending that a little. So, feedback is welcome, though it's not in a release yet. |
@stoerr - I just had the chance to play with the 4.1.3 version a bit and it looks good, thanks! I can see my 'FS Registry' package and download it. I guess coverage and filters would be nice to have in the future. I don't have a strong need to edit/install packages backed by the fs registry, as those are typically installed using the feature model directly. Are you saying that the 'registry' functionality is limited because of the APIs and that the 'manager' view is the one that has all the bells and whistles? If so, @kwin can probably tell you if there is a way around it, I am not that familiar with FileVault. |
Known limitation: https://issues.apache.org/jira/browse/JCRVLT-504 |
@rombert Thank you! I ported the coverage tab to the registry part, though it'll take a bit until that's in a release. What were you missing about the filters? They are displayed at least, though you cannot modify them. Right: with 'limited' I meant the registry stuff currently seems to provide just the functionality to handle packages as a whole (add/upload/download/install/uninstall packages) and to inspect them, but not to modify individual packages: create, modify and build. That seems what the JCRVLT-504 @kwin mentioned will implement. But until that's present for a while in the API I guess you'll have to go the old JCR package manager part of the Composum package manager to tweak the contents of a package. No such luck for packages in the FS Registry, though. |
@stoerr - I don't actually see the filters, see below screenshot I downloaded the file using the link exposed by Composum and I verified that the <workspaceFilter version="1.0">
<filter root="/content/FOO"/>
</workspaceFilter> Regarding packages in the FS Registry, my current thinking is that they are immutable and provisioned when the instance starts. For development work one can always ues the JCR registry together with the package installer. |
@rombert Strange. Do you see any exception in the error log or a Javascript problem in the browser inspector? I tried several packages with the release, and it always shows the filters nicely. I cannot reproduce that problem. |
@stoerr - sorry, for the late turnaround. Yes, I did find something in the logs after switching to the 'filter' tab
I can privately supply the package if needed. |
@rombert Weird. At least for vault 3.2.4 RegisteredPackage.getWorkspaceFilter() is declared as @ Nonnull , so that NPE shouldn't be possible. I'll throw in a null check but that won't give you your filters, either, if getWorkspaceFilter() just doesn't return them. I don't see how that can be the Composum package managers fault. So that rather looks like a bug in vault to me. FSRegisteredPackage gets that from FSInstallState, which might have no filterset if something went wrong before that. If you can't have a look at that you might give me details about your setup and probably that package, but my gut feeling says it's not very likely that I can replicate that. I think that stuff is cached in xml files in the configured filesystem package registry - you might have a look whether that xml file is broken for your package. (I'm assuming this is from a filesystem package registry - I don't see how a JcrRegisteredPackage.getWorkspaceFilter() could return null.) |
Indeed the NPE should not happen here, @rombert can you share a test case for FileVault with which I can reproduce it, then I can look into improving the exception handling here. |
The new release 4.2.1 https://github.com/ist-dresden/composum-nodes/releases/tag/composum-nodes-4.2.1 contains quite a couple of improvements in this area. You are welcome to try that out. I currently don't have further plans on that - please see how it serves in practice and let us know! Especially I'm interested in the cases where that is actually used - when is there a filesystem registry? |
Thanks for the heads-up. I didn't have any time to look into this recently, will post back the results here when I have them. |
@stoerr - I've updated to version 4.2.1 of Composum and 3.6.8 of FileVault, and I still don't see the filters and get the exception in the 'coverage' tab. @kwin - I won't be able to provide a test case for FileVault, but the package registry file looks OK to me. <?xml version="1.0" encoding="UTF-8"?>
<registryMetadata packageid="$GROUPID:$ARTIFACTID:0.1-SNAPSHOT" size="74734" installtime="1680122049777" filepath="/opt/sling/artifacts/PATH/TO/ARTIFACT/0.1-SNAPSHOT/$ARTIFACTID-0.1-SNAPSHOT.zip" external="true" packagestatus="extracted">
<packageproperties allowIndexDefinitions="false" created="2023-03-29T20:27:03.430Z" groupId="$ARTIFACTID" name="$ARTIFACTID" description="XXXX :: Frontend Package" artifactId="$ARTIFACTID" packageType="content" version="0.1-SNAPSHOT" requiresRoot="false" group="$GROUPID"/>
</registryMetadata> The filepath is correct (and also downloading the package works ). I can share a zip file of the launcher directory and launching instructions or a docker image (somewhere) if you think that helps. If not, I'm happy with at least being able to inspect the registry contents so thanks for providing that :-) |
@rombert @kwin Sorry, I know it's ages ago, but I got detracted by something rather urgent. I just tried @rombert 's zip of the launcher directory, and it is as I suspected: there is something missing in the registry metadata xml file. As in the previous message it just contains the packageproperties subnode, but no workspacefilter subnode, which is normally present. Interestingly, this only happens when it's installed via the org.apache.sling.jcr.packageinit.impl.ExecutionPlanRepoInitializer during startup. I don't see any error message during the installation, though. If I delete the package and upload it via the browser, the workspacefilter node is there, and thus the filters are shown in the package browser. That also happens if I take a Composum platform package and add it to the feature-oak_tar.json - the workspacefilter node is missing, too. So it seems that happens generally when you install a package as a sling feature into a FS package registry - at least with the particular versions in that launcher, and it's not a problem with the package or the Composum package manager. I'll see whether that happens with our launchers too when I'm changing something there again. |
Thanks for coming back to this @stoerr - don't worry about the long pauses :-) If the way the FSPackageRegistry is set up seems problematic, perhaps @DominikSuess has an idea. |
FileVault has support for non-JCR package managers, which support storing the content packages in other locations.
In my case, I've configured Sling to work with a
FSPackageRegistry
so that all content packages are stored in the filesystem and the OSGi installer is not active anymore.However, these content packages, although installed, are not visible in the Packages tab. I am not sure what the root cause is, but please ask for more information if needed.
The text was updated successfully, but these errors were encountered: