shinken-solutions / shinken

Flexible and scalable monitoring framework
http://www.shinken-monitoring.org
GNU Affero General Public License v3.0
1.13k stars 337 forks source link

Virtualenv #1727

Closed btwe closed 8 years ago

btwe commented 8 years ago

Please make shinken virtualenv-compatible.

I just got interested in shinken and found that comment from @naparuba : https://github.com/naparuba/shinken/issues/1226#issuecomment-46664743

What? It is not designed for virtualenv? What would be the drawback of beeing virtualenv compliant? Sorry, but that is understood mandatory for python tools from pypi to be able to run within a virtualenv and with an unpriviledged user id.

I really disagree in running any service of a monitoring system as root. Given the case that this is not necessary for shinken, then why is it designed to be necessary to spread config files, modules and plugins throughout the rootfs? Second, hardware virtualisation is not a solution for that issue.

This issue even discourages me to install shinken for a first evaluation.

Thanks,

hvad commented 8 years ago

Hi,

Virtualenv is only for dev or test doesn't it ?

Ty

btwe commented 8 years ago

That is just one of the reasons I love venv for. One major benefit in that for me is, I can 'uninstall' a virtualenv by just removing it's root directory and I am certain, that all files are gone from my system

But there are further important rights to exist. The venv pypi web page says:

https://pypi.python.org/pypi/virtualenv virtualenv is a tool to create isolated Python environments.

The basic problem being addressed is one of dependencies and versions, and indirectly permissions. Imagine you have an application that needs version 1 of LibFoo, but another application requires version

  1. How can you use both these applications? If you install everything into /usr/lib/python2.7/site-packages (or whatever your platform's standard location is), it's easy to end up in a situation where you unintentionally upgrade an application that shouldn't be upgraded.

Or more generally, what if you want to install an application and leave it be? If an application works, any change in its libraries or the versions of those libraries can break the application.

Also, what if you can't install packages into the global site-packages directory? For instance, on a shared host.

In all these cases, virtualenv can help you. It creates an environment that has its own installation directories, that doesn't share libraries with other virtualenv environments (and optionally doesn't access the globally installed libraries either).

And with that it is clear that virtualenv introduces another level of flexibility, which was obviously no concern to you by now.

naparuba commented 8 years ago

Not designed for, and not be.

in fact only the setup part is not design, if you want to run iinside and do the integration your self you can, but I owon't add such a thing in upstream.

For my part, docker if far more obvious way for managing such a tool, and not a dev thing like virtual env.

Won't fix, and To be clear I did decide to close and won't fix as sounds as I read your ticket that sounds like an order ("please make..", "This issue even discourages me...", number of "?"). You are in a open source project here, respect to the authors is the minimum, and your post will make no one want to help you.

btwe commented 8 years ago

Just for clarification, my post was in no way meant to be an order. Just read it again and take it as an advice how you could improve your project. IIUC, open source projects live heavily from feedback from its users. So I thought that might be of interest to you that there are people who use virtualenvs and are curious about shinken. You see, I wasted some time trying to bring that to you, which could at least help you more than me. Your primary slogan is about flexibility, isn't it? Expecting rootfs access for a service which is installed from pyi is quite the opposite. So I asked for reasons why. Still I don't know.

Maybe you have a different opinion about venvs, but just look at venvs again. These are not just a dev-thing and indeed are really helpful. But I understand and respect that you refuse to make any changes to fix that. I am fine with that, so closing it with DIY is ok, but also makes up my mind about it.

Sorry, I have one thing to ask again. Could you please define your understanding of 'respect to the authors'. I think I wasn't mean, was I?

Cheers,

titilambert commented 8 years ago

@btwe just take a look on Alignak (https://github.com/Alignak-monitoring/alignak).