[Grok-dev] Can not use buildout to configure BLOB storage

Uli Fouquet uli at gnufix.de
Tue Jul 14 00:17:29 EDT 2009


Hi there,

Steve Schmechel wrote:

> Adding blob-dir = ${buildout:parts-directory}/data/blobs to the [data]
> section of buildout.cfg does not have any effect.
> 
> It does not effect /etc/zope.conf.in or the resulting
> /parts/etc/zope.conf in a way that will allow BLOB support using
> zope.file.
> 
> When attempting to upload a file, the user will receive an error like:
> Unsupported: Storing Blobs in <ZODB.FileStorage.FileStorage.FileStorage object at 0x457cc90> is not supported.
> 
> Maybe some functionality went away when the /etc vs. parts/etc
> work was done in grokproject.

I think that bit was lost when switching to paster-support in
grokproject. As  in stock zopeproject, the [data] section of
buildout.cfg seems not to be used when creating configuration files. We
should really change this.

> The <zodb> section of zope.conf needs to end up looking like:
> 
> <zodb>
>   <blobstorage>
>     # Standard Filestorage
>     <filestorage>
>       path /path/to/data/Data.fs
>     </filestorage>
>   blob-dir /path/to/data/blobs-dir
>   </blobstorage>
> 
> This can be done outside of buildout by changing the zope.conf.in 
> template file and running buildout again.
> 
> If buildout is not going to handle setting up BLOB support, we should
> change the documentation that mentions this.

Right.

> The zope.conf.in file already contains some boilerplate comments for
> supporting ZEO, so maybe it could be modified to look like:
> 
> <zodb>
> # Uncomment the blob-related lines to allow BLOB storage.
> #  <blobstorage>
>     # Standard Filestorage
>     <filestorage>
>       path ${data:path}
>     </filestorage>
> #  blob-dir ${buildout:directory}/parts/data/blobs
> #  </blobstorage>
> 
> 
> # Uncomment this if you want to connect to a ZEO server instead:
> #  <zeoclient>
> #    server localhost:8100
> #    storage 1
> #    # ZEO client cache, in bytes
> #    cache-size 20MB
> #    # Uncomment to have a persistent disk cache
> #    #client zeo1
> #  </zeoclient>
> </zodb>
> 
> 
> Any ideas on if this change is the right approach, or should someone go
> back and try to get grokproject/buildout to handle this configuration
> task?

Well, you could 'reenable' the [data] part of buildout.cfg by replacing
the whole <blobstorage> part of your example with something like::

  ${data:zconfig}

in etc/zope.conf.in (and rerunning buildout).

If you want to use ZEO configuration instead, you of course had to
remove this line (commenting it out would not be enough).

Another solution, which would possibly be more transparent, would be to
replace your <blobstorage> part from above with something like::

  <blobstorage>
    # Standard Filestorage
    <filestorage>
      path ${data:path}
    </filestorage>

    blob-dir ${data:blob-dir}
  </blobstorage>

Here the values from the [data] section are really used (and
OS-dependent filepath separators are set correctly, a nice sideeffect).

In all this cases you also had to set ``blob-dir`` value in
buildout.cfg, except the second case (${data:zconfig}) and the [data]
section has indeed to be named "data" (if you name it for instance
[foo], then you have to change the above examples to read something like
${foo:zconfig}; you get an idea how buildout works).

Steve, maybe you can pick one of this approaches (including your own
one) for now. For grokproject we have to think, what should be the
default-configuration. I think the current 'solution' is the worst one,
so I would appreciate if you could also file a bug report on launchpad.

The documentation, of course, had to be updated afterwards as well.

Thanks for the pointer!

Best regards,

-- 
Uli

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20090714/432c3b55/attachment.bin 


More information about the Grok-dev mailing list