ace-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bram de Kruijff <bdekrui...@gmail.com>
Subject Re: Ace binary dist 0.81
Date Thu, 16 May 2013 10:32:32 GMT
On Thu, May 16, 2013 at 12:02 PM, Bruce Jackson <bruce@inqmobile.com> wrote:
> One final question: how do I deploy configs? If I create a config file (e.g. com.foo.bar.cfg)
I can't add it as an artifact in the way I would have expected.
> Presumably I can deploy config files as well as bundles?
>

Again, yes you can :) However, there are some steps involved...

1) Configuration is based on the ConfigurationAdmin (CM). Thus the
target components that should be configured must register as
ManagedService(Factory) services. I believe this agent ships with a CM
implementation embedded so you probably need not provision a separate
CM to the target.

2) Configuration provisioning is based on AutoConf which requires a
ResourceProcessor that can handle these artifacts on the target. ACE
will detect that you are provisioning configuration and automatically
include the resource processor in the deployment package shipped to
the target. However, you must add the resource processor as an
artifacts on the server once. It is located in the server's store
directory. After you have added it, it will not show up in the UI
(known issue).

3) The configuration file (templates) must be valid MetaType for
AutoConf to deal with it. Thus you create a metatype config file,
upload is as an artifact and associate it with the target. Below is a
simple example template that can configure the standard http service
port. note the macro that allows you to specify the actualy value per
target in the UI. For simplicity sake you also just hardcode it there
first.

{code}
<?xml version="1.0" encoding="UTF-8"?>
<MetaData xmlns="http://www.osgi.org/xmlns/metatype/v1.0.0">
  <OCD name="Apache Felix Http Config" id="org.osgi.service.http">
    <AD id="org.osgi.service.http.port" type="STRING" cardinality="0" />
  </OCD>
  <Designate pid="org.apache.felix.http" bundle="*">
    <Object ocdref="org.osgi.service.http">
      <Attribute adref="org.osgi.service.http.port">
        <Value>${context.port}</Value>
      </Attribute>
    </Object>
  </Designate>
</MetaData>
{code}

grz
Bram


ps. CM/AutoConf/MetaType are all part of the OSGi core/cmpn specs if
you want to look them up.



> Thanks
>
> Bruce
>
> On 16 May 2013, at 10:37, Bram de Kruijff <bdekruijff@gmail.com> wrote:
>
>> On Thu, May 16, 2013 at 8:29 AM, Bruce Jackson <bruce@inqmobile.com> wrote:
>>> Thanks Bram, thats very helpful.
>>>
>>> Can I specify the target id for my targets in config files, or are they always
auto-allocated?
>>>
>>
>> Yes you can. By design this is all pluggable and one could employ all
>> kinds of strategies. This agent has property based identification &
>> discovery that can be set on the command line.
>>
>> $ java -jar generated/org.apache.ace.launcher.jar help
>> Apache ACE Launcher
>> Usage:
>>  java -jar ace-launcher.jar [identification=<id>]
>> [discovery=<ace-server>] [options...]
>> All known options are:
>>  agents: configures multiple management agents:
>> agent-id,identification,discovery[;agent-id,identification,discovery]*
>>  auth: point to the properties file containing the authentication
>> credentials for a certain subsystem: <dir/file/url>
>>  discovery: sets the ACE server to connect to
>>  id(?:entification)?: sets the target ID to use
>>  bundle: adds an additional bundle to be started with this management
>> agent: bundle=my.fully.qualified.BundleActivator
>>  fwOption: sets framework options for the OSGi framework to be
>> created. This argument may be repeated
>>  help: prints this help message
>> Example:
>>  java -jar ace-launcher.jar identification=MyTarget
>> discovery=http://provisioning.company.com:8080
>> fwOption=org.osgi.framework.system.packages.extra=sun.misc,com.sun.management
>>
>>
>> Note that I recently proposed a new agent [0], found in projects
>> "org.apache.ace.agent[.launcher]" , that aims to be simpler, more
>> configurable and easier to extend. However, that is still bleeding
>> edge and not included in the default build yet ;)
>>
>> greetz
>> Bram
>>
>> [0] https://issues.apache.org/jira/browse/ACE-347
>>
>>> Best regards
>>>
>>> Bruce
>>>
>>> On 15 May 2013, at 18:09, Bram de Kruijff <bdekruijff@gmail.com> wrote:
>>>
>>>> Hi Bruce,
>>>>
>>>> welcome to ACE! :)
>>>>
>>>> On Wed, May 15, 2013 at 6:18 PM, Bruce Jackson <bruce@inqmobile.com>
wrote:
>>>>> Hi Christian
>>>>>
>>>>> Ok, I've done that now, and built everything using the instructions on
that page. These are also incorrect: the steps:
>>>>>
>>>>> ant -f bin-build.xml package
>>>>> and
>>>>>
>>>>> $ cd generated/ace-devserver
>>>>> $ sh run.sh
>>>>>
>>>>> do not work, as the file bin-build.xml doesn't exist. However, I do get
a binary zip in the generated folder if I build using:
>>>>>
>>>>> ant package-bin
>>>>>
>>>>> However, the binary this builds also does not have any information on
how to start everything up, but using common sense, I can go into the server-allinone and
run:
>>>>>
>>>>> java -jar server-allinone.jar
>>>>>
>>>>
>>>> Correct, good catch. As you have noticed by now the build has
>>>> undergone significant changes and the docs needs some close attention.
>>>>
>>>>> and can then access the web console at localhost:8080/ace
>>>>>
>>>>> I can also go to the client folder and run:
>>>>>
>>>>> java -jar client
>>>>>
>>>>> However, I never see the client appear in the web console. How do I configure
the client to point to the server?
>>>>>
>>>>
>>>> The "client" is an infrastructural component just like the "server".
>>>> When you start the server-allinone.jar" that actually contains the
>>>> "client". This is for convenience as they can also be deployed
>>>> independently. What you are looking for is a "target".
>>>>
>>>> $ cd ../target
>>>> $ java -jar target-jar
>>>>
>>>> Now in the right column of the UI you should see a "defaultTargetId"
>>>> appear which means your target is running and ready to receive
>>>> deployment packages.
>>>>
>>>>
>>>> Regards,
>>>> Bram
>>>>
>>>>
>>>>> Thanks
>>>>>
>>>>> Bruce
>>>>>
>>>>> On 15 May 2013, at 16:52, Christian Vogel <contact@christian-vogel.info>
wrote:
>>>>>
>>>>>> Hi Bruce,
>>>>>>
>>>>>> the version you want to download is pretty old and it is highly recommend
to download the sources and build your dist of the latest version. There were a lot of improvements
and we try to come out with a new release soon, where we also update the website
>>>>>>
>>>>>> A HowTo can be found here: http://ace.apache.org/dev-doc/getting-started.html
>>>>>>
>>>>>> Cheers,
>>>>>> Christian
>>>>>>
>>>>>> On 15.05.2013 17:25, Bruce Jackson wrote:
>>>>>>> Hi All
>>>>>>>
>>>>>>> New to Ace but not OSGi. The instruction for getting started
suggest getting a binary release, however none of the links to the 0.81 full actually work.
If I browse the archives, I can find a release, but this appears to be a source release. I
can try to build this using mvn install, but after much compiling etc, I'm still left in the
dark: I don't know what its done, or where its actually put the binaries.
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> Bruce
>>>>>>>
>>>>>>>
>>>>>>> This e-mail is only intended for the person(s) to whom it is
addressed and may contain CONFIDENTIAL information. Any opinions or views are personal to
the writer and do not represent those of INQ Mobile Limited, Hutchison Whampoa Limited or
its group companies.  If you  are not the intended recipient, you are hereby notified that
any use, retention, disclosure, copying, printing, forwarding or dissemination of this communication
is strictly prohibited. If you have received this  communication in error, please erase all
copies of the message and its  attachments and notify the sender immediately. INQ Mobile Limited
is  a company registered in the British Virgin Islands. www.inqmobile.com.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> This e-mail is only intended for the person(s) to whom it is addressed
and may contain CONFIDENTIAL information. Any opinions or views are personal to the writer
and do not represent those of INQ Mobile Limited, Hutchison Whampoa Limited or its group companies.
 If you  are not the intended recipient, you are hereby notified that any use, retention,
disclosure, copying, printing, forwarding or dissemination of this communication is strictly
prohibited. If you have received this  communication in error, please erase all copies of
the message and its  attachments and notify the sender immediately. INQ Mobile Limited is
 a company registered in the British Virgin Islands. www.inqmobile.com.
>>>>>
>>>>>
>>>
>>>
>>>
>>>
>>> This e-mail is only intended for the person(s) to whom it is addressed and may
contain CONFIDENTIAL information. Any opinions or views are personal to the writer and do
not represent those of INQ Mobile Limited, Hutchison Whampoa Limited or its group companies.
 If you  are not the intended recipient, you are hereby notified that any use, retention,
disclosure, copying, printing, forwarding or dissemination of this communication is strictly
prohibited. If you have received this  communication in error, please erase all copies of
the message and its  attachments and notify the sender immediately. INQ Mobile Limited is
 a company registered in the British Virgin Islands. www.inqmobile.com.
>>>
>>>
>>>
>
>
>
>
> This e-mail is only intended for the person(s) to whom it is addressed and may contain
CONFIDENTIAL information. Any opinions or views are personal to the writer and do not represent
those of INQ Mobile Limited, Hutchison Whampoa Limited or its group companies.  If you  are
not the intended recipient, you are hereby notified that any use, retention, disclosure, copying,
printing, forwarding or dissemination of this communication is strictly prohibited. If you
have received this  communication in error, please erase all copies of the message and its
 attachments and notify the sender immediately. INQ Mobile Limited is  a company registered
in the British Virgin Islands. www.inqmobile.com.
>
>
>

Mime
View raw message