Commit Graph
355 Commits
Author SHA1 Message Date
Guewen Baconnier c7240e1fe1 Allow to use a Redis Sentinel 2017-05-16 09:07:59 +02:00
Guewen Baconnier 2b81b7a6fb Do not require to run statds metrics 2017-04-29 09:20:55 +02:00
Guewen Baconnier f0519cf2f6 Add more details in asserts 2017-01-17 11:11:47 +01:00
Guewen BaconnierandGitHub 540269f59e Merge pull request #5 from guewen/10.0-attachment-fast-web-access
Store files that need fast access in the database
2017-01-16 17:27:39 +01:00
Guewen Baconnier 795692ad78 Store files that need fast access in the database
An Object Storage read is slower than a disk of database access.
It might take ~200 to 300ms to retrieve a file content.

This is not an issue for attachments such as the pdf files or any
attachment that we want to read on demand. But that's too slow for
files needed to render a web page.

We'll store in the database:

* Assets (js, css, ...). As a side effect, the databases will be more
  portable, as assets are rebuilt frequently, storing them in the Object
  Storage led the integration server to try to read assets deleted since
  long ago
* Attachments linked to Binary fields named 'image_small',
  'image_medium', 'web_icon_data'. Those fields are often used on kanban
  views that display a lot a images and retrieving them all was then
  very slow (Odoo does not do async requests).

The migration to S3 is no longer called during initialization of the
registry: it would be too slow as we would have to define if the
attachments must be kept in database or sent to S3 on each new start. It
means we have to call `env['ir.attachment'].force_storage()` to run the
migration.
2017-01-16 14:04:24 +01:00
Guewen Baconnier 4eecb899f3 Fix IrHttp._dispatch is now a class method 2016-12-21 23:21:57 +01:00
Guewen Baconnier 8e4b461c75 Migrate addons to 10.0 2016-12-21 21:29:09 +01:00
Guewen Baconnier 022f9003e8 Add debug logs in session_redis 2016-12-14 11:25:12 +01:00
Guewen Baconnier 997f92aaab Rename builtin id variable 2016-12-13 12:21:37 +01:00
Guewen Baconnier d138a1fd3d Be more defensive against concurrent workers
When migrating attachments to S3, several workers may try to migrate
the same attachments. Do not fail when both update the same attachment.
2016-12-13 12:01:50 +01:00
Guewen Baconnier 5f61ed8985 registry is useless in the second branch 2016-12-13 09:06:50 +01:00
Guewen Baconnier 53d7cdf3e7 Fix attachment_s3: do not open a new cursor
Because it provokes serialization errors during the installation or
update of addons. Do not commit as we might commit unwanted things...
Later, we might want to add a specific, more elaborate, migration
process.
2016-12-13 08:58:08 +01:00
Guewen BaconnierandGitHub 8b15070c7f Merge pull request #4 from guewen/add-load-readme
Document --load option for some addons
2016-11-14 08:29:51 +01:00
Guewen Baconnier 607268bd4f Delete S3 file only when bucket is the current one 2016-11-14 08:29:13 +01:00
Guewen Baconnier 779aa03c57 Explicit attachment_s3 must be started in --load 2016-11-10 16:14:19 +01:00
Guewen Baconnier 92880deeab Explicit session_redis must be started in --load 2016-11-10 16:14:19 +01:00
Guewen Baconnier 78ac4d306e Document --load option 2016-11-10 16:14:19 +01:00
Guewen Baconnier 110ec2399d Add logging when deleting file on the object storage 2016-11-07 10:11:23 +01:00
Guewen Baconnier 7f262799cf Do not care if an attachment could not be deleted 2016-11-07 09:50:26 +01:00
Guewen Baconnier 8400c0f34e Set statsd customer 2016-11-04 13:39:50 +01:00
Guewen Baconnier f643c19fba Do not fail when an attachment cannot be read
It would be blocking and a missing attachment might be a minor issue.
Only warn when such a file is missing.
2016-11-04 13:38:31 +01:00
Guewen BaconnierandGitHub 80ac235c28 Merge pull request #3 from guewen/grafana-statsd
Add statsd addon
2016-11-04 10:35:25 +01:00
Guewen Baconnier 65e9bad4e5 Add monitoring_statsd in cloud_platform 2016-11-04 10:30:10 +01:00
Guewen Baconnier d53ef3de37 Add statsd metrics addon 2016-11-04 10:30:10 +01:00
Guewen BaconnierandGitHub 23634feb46 Merge pull request #2 from guewen/logging-json
Add logging_json
2016-11-04 10:20:20 +01:00
Guewen Baconnier bed41d6719 Add requirements.txt 2016-11-03 17:37:00 +01:00
Guewen Baconnier e5c1afb09e Fix server_environment_files error 2016-11-03 17:07:47 +01:00
Guewen Baconnier 3c8b74369b Make pylint happy 2016-11-03 16:58:36 +01:00
Guewen Baconnier 3fd26cb894 Fix travis configuration 2016-11-03 16:46:42 +01:00
Guewen Baconnier 7eafdd75f4 Add oca-dependencies 2016-11-03 16:24:47 +01:00
Guewen Baconnier b5f00c26dc Fix pep8 2016-11-02 10:29:02 +01:00
Guewen Baconnier ec1f3fc61a Add logging_json
Output odoo logs as json
2016-11-02 10:10:05 +01:00
Guewen Baconnier 46231b3365 Fix pep8 2016-11-02 09:55:36 +01:00
Guewen Baconnier 1d4f76de2b Migrate attachments s3 to new pattern
So remove the compatibility code altogether
2016-11-01 08:55:00 +01:00
Guewen Baconnier 963b65e99d Storage should be 's3' 2016-10-31 17:23:20 +01:00
Guewen Baconnier ab0fa598ca Adapt cloud_platform setup for 73aaff6
Following the changes in attachment_s3
2016-10-31 14:05:58 +01:00
Guewen Baconnier 73aaff62fc Rework attachment_s3:
* store the S3 uri in the 'store_fname' (s3://bucket/key)
* the read-only mode is now built-in, as we store the bucket name, if a
  instance is started with a different bucket or another filestore
  method, it will continue to read the previous attachments on their
  stored bucket, but new attachments will be stored on the new one
* remove config in ir.config_parameter, it makes all the stuff more
  complex and we don't use them (config file would be more interesting)
* automatically migrate the attachments on loading of the server, so
  if an ir.attachment has been created during the module
  upgrade/initialization before attachment_s3 is loaded, it will be sent
  to S3 as soon as it's loaded
2016-10-31 13:57:20 +01:00
Guewen Baconnier fde2688b27 Do not require REDIS on dev environment 2016-10-28 12:06:51 +02:00
Guewen Baconnier 202d37f08b Relax rules for the redis prefix
If we run 2 instances with the 'integration' server_env, we want 2
the ability to use different prefixes.
2016-10-25 13:26:26 +02:00
Guewen Baconnier 6eb25377fb Remove extra parameter 2016-10-25 12:09:27 +02:00
Guewen Baconnier e286a0da1a Allow different bucket name than *-odoo-prod
Only force it if the server-env is 'prod'. When we have no production
yet, the integration will have its own bucket.
2016-10-25 10:16:26 +02:00
Guewen Baconnier fedfbb199e Allow s3 on non-prod environment
But force it to be readonly
2016-10-25 09:55:29 +02:00
Guewen Baconnier fb7c07a47c Install session_redis and monitoring_status 2016-10-25 09:39:28 +02:00
Guewen Baconnier 952a35854e Add monitoring_status, new route for health checks 2016-10-25 09:39:03 +02:00
Guewen Baconnier 982285b298 Add a cloud_platform 'profile' addon
* When installed, it pulls the addons required for Odoo to run on the
  Cloud Platform.
* It provides a method to configure Odoo at the installation.
* It checks if the environment variables are correct according the the
  'server environment'
* And add documentation
2016-10-25 09:38:48 +02:00
Guewen Baconnier 63daa99cdd Add session_redis 2016-10-24 17:12:27 +02:00
Guewen Baconnier 9ca3f87614 Remove the bin_size return
When we return a bin_size (such as 28672), the web client does not
accept it as as bin size and try to use it as value for the b64 src of
the image.  Though, returning the image as b64 in all cases does seem to
be supported.
2016-10-24 17:12:27 +02:00
Guewen Baconnier ec59d275e2 Add read-only mode that fallbacks on the database 2016-10-24 17:12:27 +02:00
Guewen Baconnier 7825661a1a Add attachment_s3 2016-10-24 17:12:27 +02:00
Guewen Baconnier 2f00f776e8 Fix queries without status_code 2016-10-10 13:34:10 +02:00