Update Bundles over network

21 views
Skip to first unread message

damjan gjurovski

unread,
Apr 26, 2018, 7:34:33 AM4/26/18
to ipopo-users
Hello, can you please tell me if it is possible to update/install/uninstall/start/stop bundles through the network?
This means that I would like the project running on one computer and have the bundles updated from another computer through by sending some kind of command.
Basically I need to simulate the behavior of the KURA Admin Page that provides exactly this behavior.
Thank you in advance.


Thomas Calmant

unread,
Apr 26, 2018, 10:47:44 AM4/26/18
to ipopo...@googlegroups.com
Hi Damjan,

Currently, you can control a framework remotely using the Remote Shell (and soon, its TLS version).
This means you can use bundle management shell commands (start, stop, install, uninstall, update) remotely.

BUT, all those commands require the bundle to be already accessible locally: currently, there are no implementations of a provisioner.

This is a feature that has been requested but I haven't yet figured out how to implement this correctly.
Reinventing the wheel with a brand new module server would be too much work (IMHO).
Finding the good module provider is complicated, as most of them are Java-oriented and lack some required features (signatures, ciphering, ...)

Current workarounds I've seen so far are:
- use a custom pip server, use a bundle that will call "pip install --update" then update the bundles
- use a shared folder in the Python path and use the "update" command
- use an Ansible/Puppet-like tool to publish the modules and use the "update" command

I hope I answered you question correctly.

Best regards,
Thomas

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "ipopo-users".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse ipopo-users+unsubscribe@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

damjan gjurovski

unread,
May 8, 2018, 10:14:44 AM5/8/18
to ipopo-users
Thank you for your response. I have one more question. How can I set up the remote shell directly from python main method? I was not able to find an explanation of this use case. 
So, my idea is that I use a python script to load the framework and install bundles, but afterwards I would like to be able to access these bundles remotely through ssh so I need to access the pelix shell console where they are loaded.
Thank you in advance for your response.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse ipopo-users...@googlegroups.com.

Thomas Calmant

unread,
May 9, 2018, 5:58:03 AM5/9/18
to ipopo...@googlegroups.com
Hi Damjan,

To start the remote shell from a main() method, you have to:

1. install and start the " pelix.shell.core" and "pelix.shell.remote" bundles.
    This can be done using the bundle context of the framework:

    ctx = framework.get_bundle_context()
    ctx.install_bundle("pelix.shell.core").start()
    ctx.install_bundle("pelix.shell.remote").start()

2. If you haven't done it yet, you also have to install iPOPO ("pelix.ipopo.core")

3. Start the remote shell component:

   import pelix.shell
   from pelix.ipopo.constants import use_ipopo

   with use_ipopo(framework.get_bundle_context()) as ipopo:
       ipopo.instantiate(pelix.shell.FACTORY_REMOTE_SHELL, "remote-shell",
           {"pelix.shell.address": "0.0.0.0", "pelix.shell.port": 9000})

Here, "pelix.shell.address" indicates the binding address, and " pelix.shell.port " the TCP port to listen.

This snippet will therefore start a remote shell accepting connections from everywhere on port 9000.

A TLS version of the remote shell is available for testing on the tls-shell branch, with more setup properties.
See https://github.com/tcalmant/ipopo/blob/tls-shell/pelix/shell/remote.py#L628 for more details (documentation isn't written yet).

Hoping I answered all your questions.

Best regards,
Thomas

Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse ipopo-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages