Skip to content

Commit e503b15

Browse files
committed
docs: some docs on how to deploy a new service
1 parent eb45e4d commit e503b15

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# How to deploy a new service
2+
3+
Open Food Facts is made of several components and tools for the community or to manage the innfrastructure.
4+
5+
Each of those service will cost resources and have certain requirements to run.
6+
It's important to keep those things in mind when deploying a new service.
7+
8+
## Decide where to deploy
9+
10+
First you have to decide the way you will deploy your service:
11+
12+
* using [docker-compose](./docker_architecture.md) is the preferred way to deploy a service that have developments.
13+
It enables an easy updgrade of main components, a good reproducibility of the environment,
14+
and a good integration in [CI/CD tools](./cicd.md)
15+
16+
Docker compose are to be deployed in a VM. We are also experimenting deploying them in containers, but there is no official support for that.
17+
18+
* using a [proxmox container](./proxmox.md#how-to-create-a-new-container) is the second best option.
19+
Use this if you deploy a service that is packaged in debian,
20+
or that updates easily in such environment (eg. a PHP software).
21+
22+
That decided you have to choose the best server to deploy your service.
23+
This is done in coordination with the infrastructure team.
24+
25+
Factors to consider:
26+
* resources needed by the service
27+
* latency needed to access other services (or the other way around)
28+
* how critical the service is
29+
30+
31+
## Separating data from the system
32+
33+
It's important to try to separate data from the system.
34+
35+
You have different types of data:
36+
* Primary source Data
37+
* Indexes (that can be rebuilt)
38+
* Caches and temporary data
39+
* Logs
40+
* Configurations data
41+
42+
Separating Data has a lot of benefits:
43+
* It enables updating the system without putting data at risk and enabling a roll-back without loosing data
44+
* It's enables putting data on faster disks if needed.
45+
46+
Of course if your service is not very important, does not have much data, and you can afford loosing some data, it might not be worth the effort.
47+
48+
## Watch for performance after deployment
49+
50+
If your service is heavy duty, try to do some performance check in staging.
51+
52+
After deployment you should also check
53+
how the new service impacts the performance of the whole system.
54+
55+
[Munin](./munin.md) offers a good way to check that,
56+
as you can compare performances before and after deployment.
57+
58+
Some key indicators to monitor:
59+
* CPU usage (also look at I/O wait time)
60+
* RAM usage
61+
* disk Usage (utilization per device)
62+
* Pressure stall information, gives you indication on the bottleneck between CPU, disk and RAM

docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ For a detailed overview of our production architecture, see [Production Architec
7878

7979
Other tools supporting the community are deployed in containers, some times on the same servers.
8080

81+
If you deploy a new service, see [How to deploy a new service](./how-to-deploy-a-new-service.md).
82+
8183
## Repository Structure
8284

8385
The repository is organized into several directories, each serving a specific purpose:

0 commit comments

Comments
 (0)