tiagocoutinho/multivisor

Separate components

Fantomas42 opened this issue · 4 comments

Hello,

first of all, great project great work.

I'm here for a simple suggestion. What do you think of splitting the web-server, the cli and the RPC interface into different packages ?

I suspect it will be less easy for you for the maintenance and the development, but Multivisor has a lot of dependencies, and your the architecture is made to be decentralized.

Example: I install the RPC interface in my Supervisor servers, but do I need the have the code of the web-server ? No, because the web-server will be hosted somewhere else. The same principle with the cli, I usually install the cli locally, for managing the remote instances of Supervisor.

This will reduce the number of Python dependencies to install, also System dependencies required for compiling Python libraries, and by consequent simplify the installation, reduce disk usage and speed up the installation.

If you agree on this suggestion, I can help you, by porting the RPC component into a specific package for beginning.

Regards

@Fantomas42, thanks for the suggestion.

I did put some thought into splitting the installation by taking advantage of setuptools extras.
You would be able to install just the RPC with pip install multivisor[RPC] for example.

The advantage is that we wouldn't have to split the project.
Would this meet your requirements? Would you be willing to help in this direction?

@tiagocoutinho

after reading the documentation, it's seems to be the better solution.

How can I help you in this direction ?

How do you want to install the project ? Or by default what should be installed if I do ?

pip install multivisor

We could break the project into:

  • pip install multivisor[rpc]
  • pip install multivisor[web]
  • pip install multivisor[cli]

I am tempted to say pip install multivisor should install everything as before. There is no backward installation compatibility we have to stick to so, if you think it doesn't make sense, feel free to propose some other default.

FYI, using this approach I was able to make a test project (available here).
Accomplishes:

  1. accepts pip install demoapp[..] feature
  2. only installs necessary dependencies

Fails to accomplish:

  1. avoid installation of unnecessary package_data (ex: [cli] would still installs web html, js and css garbage)
  2. avoid installation unwanted console_scripts

This was just a starting point for me into the setuptools extras world.

Okay, I will give a try.