How to add custom bundles part of the Target? - provisioning

I am working on server-allinone in Eclipse. I would like to make
some custom bundles part of the basic bundles running on the Target.
Is there a way to do so from the configurations?

Conceptually, what is running on the target, consists of three logical parts:
The actual OSGi framework implementation (Apache Felix, Equinox, ...).
The "management agent" that Apache ACE provides.
All the bundles that make up your application.
Anything that is part of #3 can be easily installed, updated and uninstalled by ACE. ACE also has a mechanism that allows the management agent (#2) to update itself (which obviously is a bit of a special case). That is where ACE stops, it has not built-in mechanism to update #1, even though there has been some talk about providing a mechanism for that as well. You have to draw the line at some point though, as beyond that you could also ask yourself who is going to update the JVM, the OS and the bootloader.
Anyway, back to your question. If you want to make those custom bundles part of the basic bundles that are running on the target, conceptually they become part of the framework and you have no way in ACE to ever update them. If that is fine, just create a custom launcher that, besides installing the management agent, also installs these bundles. If that is not fine you need to add those bundles to the actual management agent bundle so they become part of that. That way you can update them as part of that bundle. However, I would like to challenge you and ask you why these bundles cannot be part of the application? Is there a special reason they must be pre-installed (updatable or not)?

Related

how to handle multiple releases in a one go using Maven/hudson

We have more than 250+ applications and most of the applications depends on the generic/common(around 30) components.
If there is any change in a common component then we have to release all/most of them components using Maven. This is very painful task.
Is there any way by which we can avoid this. Do we need to change the design of the application or does maven provides any solution for this or is there any solution in Hudson by which we can schedule a builds to do this.
Any inputs on this will be really helpful.
You could take a look at the Cascade Release Plugin which might work with Jenkins as well.
However, you should thing about your workflow:
Does every application need to have the newest common components right now? Perhaps it is sufficient to include them in the next regular release?
That way, you turn the responsibilities around. So say your component DOES in indeed do a release. Next time when you applications build (in the regular Nightly build, using SNAPSHOTs), the build process notifies the responsible developer/releasemanager for the application that there is a new version of common.
The release manager can now decide whether the features/updates are necessary for his application. You could even let the nightly build automatically update the dependency to common (using versions-maven-plugin.
The point is: I would stronlgy advise against automatically updating and releasing the application because of common updates. This would create a strong coupling between both projects. Do the update automatically, if you want, but let the application developers/release managers decide when to release.
Of course, if the change in common is critical, they MIGHT need to release immediately.

Using Sling Launchpad for production

I was trying to understand deployment scenarios for Sling/JCR when I started wondering if I could simply use the Sling Launchpad and simply start the server using the jar. My project needs simplicity more than performance, but is there something seriously wrong with this approach? Alternatively, is there a good place where Sling/JCR deployment is discussed in detail?
I don't think we have a detailed description on how to deploy Sling applications, the best might be to ask on the users mailing list ( http://sling.apache.org/site/project-information.html#ProjectInformation-lists ) so that others can share their experiences.
As for starting with the launchpad I don't see a problem with that, that's pretty much how we are using Sling in Adobe CQ5. We have our own customized launcher that adds a few features, mostly related to upgrades management, but the basics are the same.
Although the few details of your project, I can say that Sling-Launchpad is a very useful tool to start an OSGi environment with selectable bundles. You just make a list of bundles to be included in the environment. It is very actively used in Apache Stanbol project. For the details you can investigate the various launchers of Stanbol e.g full, full-war, etc. Those launchers produce a single jar file including the necessary files to start the server.
Cryo-answer, maybe better late than never.
As long as you're not after a clustered config, the sling trunk build now has a debian contrib module that packages the launchpad jar in a debian package. It's a simplistic packaging mechanism that doesn't fully exploit all possible use cases, but it does setup logging and provide an etc/defaults for for config setup.

There is a GUI to manage OSGi services? (in Eclipse or another project)

I'm working with an application that uses and manages a large amount of OSGi services and implementations for each service, with properties, dynamism and so. Using the command line of the Equinox console is useful, with commands like services or list -c . However, it is difficult to see specific implementations of services, and obtain a current snapshot of bounded or available services to consume. For example, you can see if the bundle references are satisfied, but you can't see which are the implementations of those satisfied references (although there are another mechanisms, of course).
So, the idea is to find a GUI with organized information (for example, using graphs) to increase the performance when you are developing in OSGi. Maybe there is one GUI in Eclipse plug-in perspective, but I can't find it.
If you don't know anything like this, I've in mind to create my own for my thesis :)
Eclipse has its Plug-in Registry view:
Window > Show View > Other... > Plug-in Development -> Plug-in Registry
This view comes with the Plug-in Development Environment (PDE), so you'll need to either use Eclipse Classic or Eclipse for Plug-in Developers or install it additionally through the standard Eclipse update mechanism.
The view can show the plugins, running in the current Eclipse instance and group them by plugin, extension points or services. I believe the last option is what you are searching for.
Although there was some work to make this view show remote content as well, it appears that this functionality hasn't made it to the normal Eclipse release.
Another tool, which can assist you in OSGi development is mToolkit. It is open source project, specifically aimed at helping developing in OSGi environments.
It provides similar view to the Plug-in Registry, but it only shows information about the OSGi bundles and services. It doesn't support nothing outside OSGi specification, so no plug-in registry inspection.
The Apache Felix console provides a web interface to manage OSGi services (and many other things) - I haven't tested it with Equinox but it has minimal dependencies so it should work in most OSGi environments. See http://felix.apache.org/site/apache-felix-web-console.html
I would checkout Peter Krien's Xray http://softwaresimplexity.blogspot.com/2012/07/xray-again.html
Have you looked at Knopflerfish and Apache Felix UIs? I think, they could be installed on top of Equinox as well.

How to work on a Cocoa app and plugins in parallel?

I have a relatively simple goal: I want to create a Cocoa application which doesn't have much functionality itself, but is extendable through plugins. In addition I want to work on a few plugins to supply users with real functionality (and working examples).
As I am planning to make the application and each plugin separate open-source projects (and Git repositories), I'm now searching for the best way to organize my files and the Xcode projects. I'm not very experienced with Xcode and right now I don't see a simple way to get it working without copying files after building.
This is the simple monolithic setup I used for development up until now:
There's only one Xcode project with multiple products:
The main application
A framework for plugin development
Several plugin bundles
What I'm searching for is a comfortable way to split these into several Xcode projects (one for the application and framework) and one for each plugin. As my application is still in an early stage of development, I'm still changing lots of things in both the application and the plugins. So what I mean by "comfortable" is, that I don't want to copy files manually or similar inconvenience.
What I need is that the plugin projects know where they can find the current development framework and the application needs to know where it can find the development plugins. The best would be something like a inter-project dependency, but I couldn't find a way to setup something like that in Xcode.
One possible solution I have in mind is to copy both (the plugins and the framework) in a "Copy Files Build Phase" to a known location, e.g. /tmp/development, so production and development files aren't mixed up.
I think that my solution would be enough, but I'm curious if there's a better way to achieve what I want. So any suggestions are welcome.
First, don't use a static "known location" like you mention. I've worked in this kind of project; it's a royal pain. As soon as you get to the point of needing a couple of different copies of the project around (for fixing bugs in parallel, for testing a "clean" build versus your latest changes, for working on multiple branches), the builds start trashing each other and you find yourself having to do completely clean/builds much more often than you'd want.
You can create inter-project dependencies by adding the dependent project (Add File), right click the Target and choose "Get Info," and then add a Direct Dependency on the General pane.
In terms of structure, you can either put the main app and framework together, or put them in separate projects. In either case, I recommend a directory tree like:
/MyProject
/Framework
/Application
/Plugins
/Plugin1
/Plugin2
Projects should then refer to each other by relative paths. This means you can easily work on multiple copies of the project in parallel.
You can also look at a top-level build script that changes into each directory and runs "xcodebuild". I dislike complex build scripts (we have one; it's called Xcode), but if all it does is call "xcodebuild" with parameters if needed, then a simple build script is useful.

What should the repository contain?

I am trying to set up a Continuous Integration process. For my various build tasks(compiling, testing, documentation etc.)I need to have tools that perform these tasks(csc, NUnit, NDoc etc.). My question is should these tools too go into my source control repository?
Why I think that they should is because I read in some online article that the developer environment should be as much similar to the build server environment. To fulfill this requirement, the article suggested that you put everything that is required for your build in the repository and when you check out the code(or the build server checks out the code) you are ready to build the project right away without first installing any other tools. But on the other hand if I put these tools with my source code in the repository then the build server will have to install them whenever a build is run.
Is it OK to install these tools? Won't it increase the time for each build unnecessarily?
It's often more trouble than it's worth to try to check in tools to source control. Rather, write a list of software requirements that must be installed before the source can be checked out and built (one thing that would need to be on this list in any case is the source control system itself). If you rely on software being in source control, some tools might need to be installed in certain paths or be otherwise configured (registry entries come to mind).
I would certainly not check in the compiler itself to source control, and I probably wouldn't check in NUnit or NDoc either. Just install these beforehand, as they are not likely to change too much over the lifetime of your project. Your build script might want to check that the expected version(s) of the required software packages are installed before the build may proceed.
Unless you're customizing the tools there's probably no reason to put their source code in your repository. However there are excellent reasons for putting your config files in the repository.
Re-installing the tools for every single build is overkill and will slow you down.
However it's by far better to have a server dedicated to the continuous integration so that you know its state ; you sure nobody installed anything that may have an impact on the outcome of the build.
If you want to be able to re-generate today's build next year, you need to be able to re-create your environment first. Make sure you'll be able to re-install your tools (exact same version), either by keeping them on your server (installing the newer versions in different directories), or storing the whole package in your configuration management tool.
Think about how you would create another continuous integration server, either to have two of them, or for a second site, or to recover after a disaster. Document how the continuous integration server was set up.
What really needs to be version controlled, is the build scripts, that access the right versions of the tools, especially if you opt for installing several versions of the tools.

Resources