docs(administration): explain the magic

!42 #74
This commit is contained in:
2024-07-19 16:27:33 +09:30
parent 034857d088
commit 92a411baec
3 changed files with 69 additions and 5 deletions

View File

@ -24,6 +24,8 @@
_Breaking Change must also be notated in the commit that introduces it and in [Conventional Commit Format](https://www.conventionalcommits.org/en/v1.0.0/)._
- [ ] Release notes updated
- [ ] ~Documentation Documentation written
_All features to be documented within the correct section(s). Administration, Development and/or User_

7
Release-Notes.md Normal file
View File

@ -0,0 +1,7 @@
# Version 1.0.0
Initial Release of Centurion ERP.
## Breaking changes
- Nil

View File

@ -8,25 +8,80 @@ about: https://gitlab.com/nofusscomputing/infrastructure/configuration-managemen
This documentation is targeted towards those whom administer the applications deployment.
Centurion ERP is a simple application to deploy with the only additional requirements being that you have already deployed a database server and a RabbitMQ server. Centurion ERP is container based and is deployable via Docker or upon Kubernetes. Our images are available on [Docker Hub](https://hub.docker.com/r/nofusscomputing/centurion-erp).
!!! note "TL;DR"
`docker pull nofusscomputing/centurion-erp:latest`.
## Installation
To install this application you must have a container engine installed, both docker and kubernetes are supported. The container image is available on [Docker Hub](https://hub.docker.com/r/nofusscomputing/centurion-erp) and can be pulled with `docker pull nofusscomputing/centurion-erp:latest`.
Basic installation steps are as follows:
Settings for the application are stored within a docker volume at path `/etc/itsm/`, with the settings living in `.py` files. A database is also required for the application to store it's settings. SQLLite and MariaDB/MySQL are supported.
1. Deploy a Database Server
1. Deploy a RabbitMQ Server
1. Deploy a Web container for Centurion ERP
1. Deploy a Worker container for Centurion ERP
1. Add settings file to path `/etc/itsm/settings.py` for both Centurion ERP containers.
1. Run migrations
- Docker `docker exec -ti <container name or id> -- python manage.py migrate`
- Kubernetes `kubectl exec -ti -n <namespace> deploy/<deployment-name> -- python manage.py migrate`
### Background workers
### Database Server
This application requires that you deploy at least one background worker. The background worker requires access to a RabbitMQ message broker for the queueing and routing of messages (background jobs). If you are using our docker container to deploy this application, launch an additional container with `celery -A app worker -l INFO` as the entrypoint/command. Configuration for the worker resides in directory `/etc/itsm/` within the container. see below for the `CELERY_` configuration.
As Centurion ERP is uses the Django Framework, Theoretically Every Django supported database is available. The reality is however, that we have only used PostgreSQL Server with Centurion ERP. By default if no database is configured a SQLite database will be used. This allows [tests](../development/testing.md) to function and to quickly spin up a deployment for testing.
### RabbitMQ Server
Centurion ERP uses RabbitMQ as for its worker queue. As tasks are created when using Centurion ERP, they are added to the RabbitMQ server for the background worker to pickup. When the background worker picks up the task, it does it's business, clears the task from the RabbitMQ server and saves the [results](../user/core/index.md#background-worker) within the Database.
### Web Container
The [web container](https://hub.docker.com/r/nofusscomputing/centurion-erp) is the guts of Centurion ERP. It provides the interface and endpoints for interacting with Centurion ERP. This container is scalable with the only additional requirement being that a load-balancer be placed in front of all web containers for traffic routing. If deploying to Kubernetes the service load-balancer is sufficient and setting the deployment `replicas` to the number of desired containers is the simplest method to scale.
### Background Worker Container
The [Background Worker container](https://hub.docker.com/r/nofusscomputing/centurion-erp) is a worker that waits for tasks sent to the RabbitMQ server. The worker is based upon [Celery](https://docs.celeryq.dev/en/stable/index.html). On the worker not being busy, it'll pickup and run the task. This container is scalable with nil additional requirements for launching additional workers. If deploying to Kubernetes the setting the deployment `replicas` to the number of desired containers is the simplest method to scale. The container start command will need to be set to `celery -A app worker -l INFO` so that the worker is started on container startup.
Configuration for the worker resides in directory `/etc/itsm/` within the container. see below for the `CELERY_` configuration.
### Settings file
The settings file is a python file `.py` and must remain a valid python file for the application to work.
The settings file is a python file `.py` and must remain a valid python file for the application to work. Settings for the application are stored within a docker volume at path `/etc/itsm/`, with the settings living in `.py` files. A database is also required for the application to store it's settings. SQLLite and MariaDB/MySQL are supported.
``` py title="settings.py"
--8<-- "includes/etc/itsm/settings.py"
```
### Migrations
Migrations serve the purpose of setting up the database. On initial deployment of Centurion ERP migrations must be run as must they be on any upgrade.
## Backup / Restoration
Most Data within Centurion ERP resides within the database. This simplifies the backup/restoration process as only the database the application uses needs to be backed up.
Tasks that have been sent to the RabbitMQ server will remain within the task queue, if Centurion ERP has not processed them. Should you wish not to loose tasks you should also backup the rabbitMQ server.
## Updating
We use [semver](https://semver.org/) versioning for Centurion ERP. Using this method of versioning enables us to clearly show what versions will have breaking changes. You can rest assured that every version whose `Major` version number remains the same will not break your deployment. [Release notes](https://gitlab.com/nofusscomputing/projects/centurion_erp/-/blob/master/Release-Notes.md) are available within the repository root and are a running document for the current `Major` release. To locate the release notes for your particular version please select the release tag from the branches drop-down. We will use the release notes to denote **Any** Breaking changes.
Updating to a newer version of Centurion ERP is as simple as backing up your database and RabbitMQ server, then updating the deployed image to the desired version and running the database migrations.