[osgi-dev] Best way to move an OSGi application to Docker plus K8 ?
Hello all, I have a challenged POC to do in order to dockerize an existent OSGi based application and then deploy it to a Kubernetes based cloud. I'm not totally aware of k8 features yet, so I have some doubts that I would like discuss here. The main doubt is related to our existent upgrading process which currently we upload a R5 repository to a webserver and then a node management agent bundle access it and upgrades the necessary app bundles. Many examples I saw in the web creates a docker image in their building process and delivery an image at each dev cycle. I don't like much of this idea, so initially I thought to mimic our existent process in a docker container just setting up a Volume in order to upload the newer repositories. So I have created two docker images for testing this locally. One image contains the OSGI container and framework bundle (that do not change much) and other image that extends the other for only the apps bundles. it have worked well running locally. Would this also work in K8 ? What would happen if I need to scale and then create multiple PODS for this application? thanks for any help. best regards, Cristiano ___ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev
Re: [osgi-dev] what is way to use a Resolver and Repository together ?
On 01/12/2018 19:32, Raymond Auge wrote: The basic idea is that you want to represent the capabilities of the existing system as already being provided, used to support the requirements you're searching for, but ultimately excluded from the result, such that only missing capabilities are included in the result. You might want to look at https://github.com/bndtools/bnd/blob/master/biz.aQute.resolve/src/biz/aQute/resolve/BndrunResolveContext.java and note how when using a "distro" (a predefined set of provided capabilities) it performs exactly this logic. Hth, - Ray Hi Raymond, Thanks again for your support. ;) I was thinking that I had understood the concept you exposed, but looking at the example wow, it is more complex than I was expecting. My understanding until now was that I would somehow mount a "snapshot" of the node using a ResolveContext object and then call the Resolver.resolve(). After that, to call the repository's findProvider() using somehow the built snapshot... but BndrunResolveContext receives a Repository instance on it constructor. Why would I need a repository inside the context? best regards, Cristiano ___ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev
[osgi-dev] what is way to use a Resolver and Repository together ?
Hello all, I'm playing with a kind of management agent where I need to search and download bundles (and some other resources) to install them in an OSGi node. With a Repository service instance I'm able to create multiple requirements (using newRequirementBuilder() method) and return the resources that fulfill those requirements. nice. But my problem now is that sometimes I already have some of those bundles previously installed and sometimes they are already resolved, so I wouldn't need to download them again nor any of its dependencies. What I understood reading the specs is that I need to use the resolve() method from the Resource service in order to calculate what is necessary to download from a external repository. Well, but how should I build its required *ResolveContext* parameter and how to use its returned */Map>/* in order to build the requirements to Repository's findProviders() method? I would appreciate any tip. best regards, Cristiano ___ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev
Re: [osgi-dev] equinox env started notification
Hi, Well, I think there are many possible solutions for that. In my opinion, the complicated thing is how the OSGi framework would know what is necessary to it consider your application ready. Which bundles? which services? A combination of the new OSGi Configurator + DeclarativeServices + ConfigAdmin are a great option to achieve that. One of the possible approaches using these specs is to create a Bootstrap DS component with configurationPolicy = ConfigurationPolicy.REQUIRE and configurationPid="boot.pid", meaning that an instance of it will be created and activated ONLY when a configuration were registered for "boot.pid". Then when you start the container you can instruct the Configurator to activate your bootstrap component using the system property "configurator.initial" pointing to a json configuration file containing all information needed for this bootstrap component to recognize that your application is ready (which bundles/services are required to be started). You can also embed a configurator json inside bootstrap bundle instead. In the bootstrap component implementation you will need to setup a BundleListener and/or ServiceListener to listen for installed bundles and registered services and then at each occurrence to compare with those provided in the json config. Once all required bundles/services were identified and their status matched then your application can be considered ready. best regards, Cristiano On 19/11/2018 18:16, Nhut Thai Le via osgi-dev wrote: Hello, We are using equinox as an osgi container to host our application which comprise a large number of osgi bundles. Our concern at this point is that when we start equinox, we don't know when all the bundles have been loaded and the startup has finished. Does anyone have a suggestion? Thank you in advance Thai ___ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev ___ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev
Re: [osgi-dev] OSGi and Java 11 ?
Hello Thomas, I returned from vacation this week and forgot to answer this... :-[ We was afraid about jigsaw/modules, but we have installed the latest Eclipse IDE and also JDK 11 on our dev machines and docker nodes where we run integration tests. The only problem was for one system that uses Jaxb. JDK doesn't provides such package anymore, so we needed to find a bundle that provides them. thanks, Cristiano On 29/10/2018 15:41, Thomas Watson wrote: Eclipse itself supports running on Java 11 with its latest release which includes running on top of Equinox. OSGi Frameworks should be able to continue to work on Java 11 and future versions of Java. Tom - Original message - From: Cristiano via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.org To: OSGi Developer Mail List Cc: Subject: [osgi-dev] OSGi and Java 11 ? Date: Mon, Oct 29, 2018 1:04 PM Hello all, I'm reading about the recently release of the long-term Java11 and saw that it have many differences from the java8, mainly its modules system. So, anyone have already tried java11 in an OSGi based development env ? and/or have tried a migration of an existent OSGi based application (felix or equinox) from java8 to java11 ? thanks, Cristiano ___ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev ___ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev
[osgi-dev] OSGi and Java 11 ?
Hello all, I'm reading about the recently release of the long-term Java11 and saw that it have many differences from the java8, mainly its modules system. So, anyone have already tried java11 in an OSGi based development env ? and/or have tried a migration of an existent OSGi based application (felix or equinox) from java8 to java11 ? thanks, Cristiano ___ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev
Re: [osgi-dev] Enabling debug of SCR with Equinox
Hi Raymond, Well, I use old and good PDE (plus maven) and I can confirm and reconfirm that empirically the difference of number of lines displayed between the 2 cases is huge. In case one, I just start the framework setting the felix.logback to auto-start. so, have no change in the default start level (4); In case two, I set it to auto-start and and set the start level to 1. Then, after bootstrap have occurred I copied the console text to a text editor in order to count the lines. In case one I had 119 lines while in the case two I had 850 lines ! Investigating, when you create a run configuration normally the SCR is automatically set to have start-level 2. If we don't set the felix.logback to start before SCR then all the itens logged by SCR will be missed. And was what happened. best regards, Cristiano On 07/08/2018 10:24, Raymond Auge wrote: You don't need to use start levels at all if you place felix.logback onto the classpath of the framework. For equinox see [3] and for felix (you need the org.apache.felix.log.extension bundle installed) see [2]. ___ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev
Re: [osgi-dev] Enabling debug of SCR with Equinox
hi, if you are using the latest equinox, one good alternative is to use the recently released org.apache.felix.logback. you just need to set a proper logback configuration file defining the appenders and log level and then use the vm argument as below (I used to debug inside eclipse ide): -Dlogback.configurationFile=${workspace_loc:your_project}/logback-test.xml Also, it is better to set org.apache.felix.logback's start level to one, so you won't miss any log entry. See an example: 21:23:29,959 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [Events.Service.org.eclipse.osgi] to DEBUG 21:36:13||DEBUG|bundle org.apache.felix.scr:2.1.2 (20)bundle org.eclipse.equinox.console:1.3.0.v20180119-0630 (22) : Starting extension synchronously|L.org.apache.felix.scr||L.o.a.f.scr@?[main] 21:36:13||INFO|BundleEvent STARTED|E.B.o.e.equinox.console||E.B.o.e.e.console@?[Framework Event Dispatcher: Equinox Container: f558dbee-500a-4400-ae8a-0e68b1b46f2e] 21:36:18||DEBUG|ServiceEvent MODIFIED {org.osgi.service.component.runtime.ServiceComponentRuntime}={service.changecount=19, service.id=39, service.bundleid=20, service.scope=singleton}|E.S.org.apache.felix.scr||E.S.o.a.f.scr@?[Timer-1] regards, Cristiano On 06/08/2018 12:28, Alain Picard via osgi-dev wrote: I want to enable debug logging / tracing of SCR when running with Equinox. I tried to use config admin to configure "org.apache.felix.scr.ScrService" but to no avail. Not sure if even if Eclipse now uses felix scr if that is the way to go. Or it is the whole log redirection thing (https://io7m.com/documents/brutal-felix-logging/). Just looking for console debug. Thanks Alain ___ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev ___ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev