Edit readme

This commit is contained in:
Guewen Baconnier
2018-12-03 10:09:23 +01:00
parent c9323733ae
commit 67bf8b8286
+26 -29
View File
@@ -1,4 +1,6 @@
# Cloud Platform
[![Build Status](https://travis-ci.com/camptocamp/odoo-cloud-platform.svg?token=Lpp9PcS5on9AGbp76WKB&branch=12.0)](https://travis-ci.com/camptocamp/odoo-cloud-platform)
# Odoo Cloud Addons
Camptocamp odoo addons used on our Cloud Platform.
@@ -11,16 +13,8 @@ On the platform we want to achieve having:
* Metrics read from the logs or sent to Prometheus to monitor the instances
* Logs sent to ElasticSearch-Kibana structured as JSON for better searching
For the storage, we store all the attachments on a object storage such as S3 or
Swift, and we store the werkzeug sessions on Redis.
Two providers are available for the Cloud Platform, Exoscale based in
Switzerland and OVH in France.
The main difference between the two is the Object Store they use :
* Exoscale uses S3
* OVH uses Swift
For the storage, we store all the attachments on an object storage such as S3 or
Swift, and we store the werkzeug sessions on Redis.
## Setup
@@ -36,7 +30,7 @@ statsd==3.2.1
# For S3 object storage (Exoscale, AWS)
boto==2.42.0
# For Swift object storage (OVH)
# For Swift object storage (Openstack, OVH)
python-swiftclient==3.4.0
python-keystoneclient==3.13.0
```
@@ -45,18 +39,21 @@ python-keystoneclient==3.13.0
The `--load` option of Odoo must contains the following addons:
* `attachment_s3` or `attachment_swift` depending of the provider used.
* `session_redis`
* `logging_json`
Example:
`--load=web,attachment_s3,session_redis,logging_json`
`--load=web,attachment_swift,session_redis,logging_json`
`--load=web,web_kanban,session_redis,logging_json`
### Server Environment
The server environments in `server_environment_files` must be at least:
The addon `cloud_platform` is an addon that we use for 2 things:
* validate that we setup the required environment variables depending on the running environment
* install and configure the cloud addons
For this purpose, we use the `server_environment` with the following envs:
* `prod`
* `integration`
@@ -73,15 +70,15 @@ The exact naming is important, because the `cloud_platform` addon rely on these
* `AWS_REGION`: region's endpoint
* `AWS_ACCESS_KEY_ID`: depends of the platform
* `AWS_SECRET_ACCESS_KEY`: depends of the platform
* `AWS_BUCKETNAME`: `<client>-odoo-prod`
* `AWS_BUCKETNAME`: `<project>-odoo-prod`
* integration:
* `AWS_ACCESS_KEY_ID`: depends of the platform
* `AWS_SECRET_ACCESS_KEY`: depends of the platform
* `AWS_BUCKETNAME`: `<client>-odoo-integration`
* `AWS_BUCKETNAME`: `<project>-odoo-integration`
* test: attachments are stored in database
Besides, the attachment location should be set to `s3` (but this is
automatically done by the `install` methods of the `cloud_platform` module.
Besides, the attachment location should be set to `s3` (this is
automatically done by the `install` methods of the `cloud_platform` module).
* `ir.config_parameter` `ir_attachment.location`: `s3`
@@ -91,16 +88,16 @@ automatically done by the `install` methods of the `cloud_platform` module.
* `SWIFT_AUTH_URL`: depends of the platform
* `SWIFT_ACCOUNT`: depends of the platform
* `SWIFT_PASSWORD`: depends of the platform
* `SWIFT_WRITE_CONTAINER`: `<client>-odoo-prod`
* `SWIFT_WRITE_CONTAINER`: `<project>-odoo-prod`
* integration:
* `SWIFT_AUTH_URL`: depends of the platform
* `SWIFT_ACCOUNT`: depends of the platform
* `SWIFT_PASSWORD`: depends of the platform
* `SWIFT_WRITE_CONTAINER`: `<client>-odoo-integration`
* `SWIFT_WRITE_CONTAINER`: `<project>-odoo-integration`
* test: attachments are stored in database
Besides, the attachment location should be set to `swift` (but this is
automatically done by the `install` methods of the `cloud_platform` module.
Besides, the attachment location should be set to `swift` (this is
automatically done by the `install` methods of the `cloud_platform` module).
* `ir.config_parameter` `ir_attachment.location`: `swift`
### Sessions in Redis
@@ -109,17 +106,17 @@ automatically done by the `install` methods of the `cloud_platform` module.
* `ODOO_SESSION_REDIS`: 1
* `ODOO_SESSION_REDIS_HOST`: depends of the platform
* `ODOO_SESSION_REDIS_PASSWORD`: depends of the platform
* `ODOO_SESSION_REDIS_PREFIX`: `<client>-odoo-prod`
* `ODOO_SESSION_REDIS_PREFIX`: `<project>-odoo-prod`
* integration:
* `ODOO_SESSION_REDIS`: 1
* `ODOO_SESSION_REDIS_HOST`: depends of the platform
* `ODOO_SESSION_REDIS_PASSWORD`: depends of the platform
* `ODOO_SESSION_REDIS_PREFIX`: `<client>-odoo-integration`
* `ODOO_SESSION_REDIS_PREFIX`: `<project>-odoo-integration`
* test:
* `ODOO_SESSION_REDIS`: 1
* `ODOO_SESSION_REDIS_HOST`: depends of the platform
* `ODOO_SESSION_REDIS_PASSWORD`: depends of the platform
* `ODOO_SESSION_REDIS_PREFIX`: `<client>-odoo-test`
* `ODOO_SESSION_REDIS_PREFIX`: `<project>-odoo-test`
* `ODOO_SESSION_REDIS_EXPIRATION`: `86400` (1 day)
### JSON Logging
@@ -134,7 +131,7 @@ At least on production and integration, activate:
Should be active at least on the production server
* `ODOO_STATSD`: 1
* `STATSD_CUSTOMER`: `<client>`
* `STATSD_CUSTOMER`: `<project>`
* `STATSD_ENVIRONMENT`: set if you want to send metrics for a special
environment which does not match with the `server_environment`
* `STATSD_HOST`: depends of the platform
@@ -146,7 +143,7 @@ An automatic configuration can be executed from an `anthem` song to configure
some parameters such as the `ir_attachment.location` and migrate the existing
attachments to the object storage.
It can be called like this:
From `anthem`, it can be called like this:
`ctx.env['cloud.platform'].install(cloud_platform_kind)`
Replacing `cloud_platform_kind` with 'exoscale' or 'ovh'