plone / plonecli

Plone Command Line Client - for creating and working with custom add-ons and themes
https://pypi.org/project/plonecli/
Other
19 stars 10 forks source link

Include instance, zeoserver and zeopack commands #10

Open datakurre opened 6 years ago

datakurre commented 6 years ago

This is nothing to hurry, but I leave this here for discussion.

But at some timeframe, how about including instance, zeoserver and zeopack commands from plone.recipe.zope2instance and plone.recipe.zeoserver (when plonecli is installed with the rest of Plone).

https://github.com/plone/plonecli/commit/c6dd010e2a5c6268842e7d81f743451c3c7dd57b

I've been experimenting about installing and running Plone without buildout and the missing part was getting the familiar scripts out of buildout recipes. I saw that cli already had "serve" command, so why not the rest.

Obviously, also generating zope.conf and instance skel might be good fit for plonecli (only dir with ./etc/site.zcml and zope/zeo.conf seems to be really needed in minimal setup), but maybe later.

MrTango commented 6 years ago

I think it probably makes more sence, if we have these commands on the python package which installes plone. plonecli is more for the local developing part, not for deployment. The plonecli also uses buildout with the build command which requires buildout for now. How do you install Plone without buildout?

I'm not agains putting this also in plonecli just thinking. Is the right way?

What should I do with command like create in a production env? So far the plonecli finds the root of the package and uses the self contained buildout structure. For a poduction env we have to add a marker or config file into the root of the installation, so that plonecli is able to find everything.

What about naming it plonectl instead of plonecli?

datakurre commented 6 years ago

@MrTango I don't know if having these in plonecli is the right way. More than to merge, I really wanted to start "post buildout" discussion.

You asked "how do you install Plone without buildout", I could ask "what do you mean by installing Plone"? :)

pip install -r requirements.txt with all the required packages and versions should be enough to create Python environment with Plone. For me it seems, that after that, Plone really only needs zope.conf, directory with ./etc/site.zcml and then ./var with ./var/filestorage for ZODB, log and lock files. And, of course, a script to start the instance. I did get Plone running with using just zopectl from Zope2 package, but I'd prefer to have the instance, zeoserver and zeopack scripts from our recipe packages.

The need for fixed ./etc/site.zcml path could probably be fixed into Zope2 so that the full path for site.zcml could be configured. But even then, some tool would be needed to generate site.zcml and zope.conf. For that zopecli is probably the right tool.

For now, I've only build Plone without buildout on NixOS. I'll try OSX next with pip and report the results into community, because someone else was also interested.

svx commented 6 years ago

@datakurre, @ju55i and I played with that during the Midsummer Sprint.

As you already mentioned besides site.zcml we had it fully working using pip install (wheels) on Debian (Docker).

We even started to slim it down by removing stuff which is not needed (in production) to reduce the amount of eggs.

datakurre commented 6 years ago

@svx Yes, I started by looking into your work at https://github.com/ju55i/plone.docker/blob/midsumer_docs/5.1/5.1-buildoutless/

I decided to simply use buildout with buildout.requirements extension to generate requirements.txt, because I don't want to maintain release versions myself.

Obviously "pip" branch of z3c.autoinclude is required and Z3C_AUTOINCLUDE_DEPENDENCIES_DISABLED must be set. As in your docker version.

The greatest improvement of mine was to create Nix-generator for zope.conf and adapt instance, zeoserver and zeoserver scripts out buildout recipe into plonecli (even if that may not be the final location for them). Yet, I would still need to keep plone.recipe.zope2instance, because I have package registering custom commands for its entrypoint.

FWIW, just confirmed that I'm able to install Plone with pip also on OSX (10.11.6) and run it with my branch of plonecli.

datakurre commented 6 years ago

FWIW, here is the hardcoded path for site.zcml https://github.com/zopefoundation/Zope/blob/2.13/src/Zope2/App/zcml.py#L37

datakurre commented 6 years ago

Here's a pip based example of what I was talking about https://github.com/datakurre/plone-pip

MrTango commented 6 years ago

The more I think about your idea the more i like it. Let's keep working on it and when it's solid and we have a solution for all task we have in a normal buildout based environment we can start using and promoting it. Only then I would start to adapt this into the bobtemplates.plone templates. Because there is not need to make the noise, if we are not finshed.

MrTango commented 6 years ago

Do we need some kind of command line tool, to start/stop/backup or bootstrap a new style Plone environment? Or is it enouth to create some commands from the plone-pip package.

For example we could create a plonectl command wich has some usefull commands. It could be build in the same way plonecli is. The plonectl could even depend on supervisor and control it if that makes sense.

plonecli >> developer tool plonectl >> deployment tool

datakurre commented 6 years ago

That makes sense.

So, instance scripts etc would go to plonectl.

zope.conf and site.zcml would be created with plonecli (I only created nix-based tools for those, so they are still missing)

On 28 Mar 2018, 16.52 +0300, Maik Derstappen notifications@github.com, wrote:

Do we need some kind of command line tool, to start/stop/backup or bootstrap a new style Plone environment? Or is it enouth to create some commands from the plone-pip package. For example we could create a plonectl command wich has some usefull commands. It could be build in the same way plonecli is. The plonectl could even depend on supervisor and control it if that makes sense. plonecli >> developer tool plonectl >> deployment tool — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

datakurre commented 5 years ago

I've forged my branch into https://github.com/datakurre/plonectl

Probably we need to keep my branch here until I have a release.