Quick Experiment: Plone 5.2 on Google Cloudrun

I started playing with Cloudrun yesterday (for another project)
So I decided it would be interesting to see if Plone could be deployed "serverlessly"

It works :tada:
Just a proof of concept but here it is:

feel free to improve on this.

[update: I've made this use RelStorage for persistence (suggested by @jensens in a note below) ]

3 Likes

Idea: Use Google Cloud-SQL with PostgreSQL as storage backend (with RelStorage 3 no additional blobstorage is needed).

Thanks @jensens .... RelStorage is still a thing? I haven't touched it since 2014!

My biggest concern is whether everything works with Plone 5.2/Python 3/Zope 4.

For example, can I use the rel-storage entry in plone.recipe.zope2instance

Will have to check and report back here.

That was quick... according to pypi the 6.8.0 release of plone.recipe.zope2instance targets "Plone 5.2, ZODB 5, Zope 4, and Python 2.7, 3.6 or 3.7".

So as long as the Relstorage thing works we're good.

Well, I use nothing else. since years. And with RelStorage 3 I have no idea why one ever want to use ZEO (or worse, ZRS), but that's my experience and opinion.

Okay... I was able to get this working with Google Cloud Run and a free database from ElephantSQL. I expect it to work the same with CloudSQL.
I've updated the info at https://github.com/collective/plone-on-cloudrun

My only issue is that it can take 45 seconds to respond to the first hit. After that it's fine.

Here's a link to my first Cloud run deployed Plone (backed by RelStorage):

(the instance includes the name volto because my medium term vision is to get this to work as an API server to a volto client deployed on firebase)

Just tried to upload an image and got this error:

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 168, in transaction_pubevents
  Module transaction._manager, line 257, in commit
  Module transaction._manager, line 135, in commit
  Module transaction._transaction, line 282, in commit
  Module transaction._compat, line 45, in reraise
  Module transaction._transaction, line 273, in commit
  Module transaction._transaction, line 465, in _commitResources
  Module transaction._compat, line 45, in reraise
  Module transaction._transaction, line 439, in _commitResources
  Module ZODB.Connection, line 497, in commit
  Module ZODB.Connection, line 546, in _commit
  Module ZODB.Connection, line 584, in _store_objects
ZODB.POSException.Unsupported: Storing Blobs in <RelStorage at 0x3ee8c745c490 keep_history=True phase=<HistoryPreserving at 0x3ee8bc75f580 stored_count=0 transaction=<transaction._transaction.Transaction object at 0x3ee8be53c0d0> resources=[<Products.CMFCore.indexing.QueueTM object at 0x3ee8bc75f2e0>, <Products.CMFCore.indexing.QueueTM object at 0x3ee8be4b3220>, <Connection at 3ee8c745c0d0>]> blobhelper=<NoBlobHelper> cache=<StorageCache at 0x3ee8c7485c10 hvt=277929106317082641 bytes=969229 len=2149 state=<relstorage.cache.mvcc.MVCCDatabaseCoordinator object at 0x3ee8c744d6a0>>> is not supported.

Well, wild guess, maybe the free plan does not allow blobs?

@agitator - IIRC you use Google CloudSQL and it works fine with blobs? Do you see any difference to your setup?

I'm running Googles own Postgres with blobs. No issue so far, besides the import of existing DBs where I ended up working with zexp.

I agree, it is very possible that the free account on ElephantSQL has no blob support.
@agitator that's encouraging. Will definitely want to roll this out on a more robust SQL implementation. CloudSQL for example.

Plone Foundation Code of Conduct