-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[O2B-830] Add to global docs #900
base: main
Are you sure you want to change the base?
Changes from all commits
8f31920
55ec569
d799abc
652bcda
02e4548
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,29 @@ | ||
# Bookkeeping | ||
This repository contains the software for ALICE Bookkeeping. | ||
|
||
## Wiki | ||
- Go to chapter: [Configuration](./docs/CONFIGURATION.md) | ||
- Go to chapter: [Contributing](./docs/CONTRIBUTING.md) | ||
- Go to chapter: [Development](./docs/DEVELOPMENT.md) | ||
- Go to chapter: [Docker](./docs/DOCKER.md) | ||
- Go to chapter: [gRPC](/docs/grpc.md) | ||
- ~~Go to chapter: OpenAPI~~ OpenAPI has been removed in version 0.48.0 and is not supported anymore | ||
This repository contains the software for ALICE Bookkeeping whose main purpose is to keep track of the experiment and provide a history state of the system | ||
|
||
Bookkeeping allows users to manually insert system updates which then can be filtered and retrieved to quickly access the information they are looking for. Moreover, it provides the means to other systems to enable them to automatically store and retrieve data. Based on the input, it builds global and individual statistics about the system performances which in turn helps improving the overall efficiency of the experiment. | ||
|
||
## Installation instructions | ||
|
||
What is your use case? | ||
|
||
### A. :arrow_right: I want to use Bookkeeping and other O<sup>2</sup> Components. | ||
|
||
In order to deploy a fully operational O<sup>2</sup> FLP Suite, please use these [instructions](https://alice-flp.docs.cern.ch/system-configuration/utils/o2-flp-setup/). | ||
|
||
For support, please contact [email protected] | ||
|
||
### B. :telescope: I want to use Bookkeeping and connect it to other systems already deployed | ||
|
||
You can deploy Bookkeeping on your own setup by following our [SETUP](/docs/setup.md) guide. | ||
|
||
### C. :hammer_and_wrench: I want to contribute to Bookkeeping software | ||
|
||
You are more than welcomed to contribute to Bookkeeping. Please fellow our [CONTRIBUTING](./docs/CONTRIBUTING.md) guide where you can find out more about how to set up a dev environment and how to follow our coding standards. | ||
|
||
## Bookkeeping Requests | ||
|
||
If you would like to see a new feature in Bookkeeping, please raise a JIRA ticket and explain the use-case you envisage and why the feature is needed. [JIRA Board](https://alice.its.cern.ch/jira/secure/RapidBoard.jspa?projectKey=O2B) | ||
|
||
## Bookkeeping Status | ||
GitHub Actions: ![Status](https://github.com/AliceO2Group/Bookkeeping/actions/workflows/bookkeeping.yml/badge.svg) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,49 @@ | ||
# Development | ||
|
||
## Getting started | ||
### Configuration | ||
The following `.env` configuration is the bare minimum required for development. It must be placed in the top dir. | ||
```ini | ||
; Database | ||
MYSQL_ROOT_PASSWORD=cern | ||
OPENID_ID= | ||
OPENID_SECRET= | ||
OPENID_REDIRECT= | ||
## Prerequisite | ||
|
||
JWT_SECRET= | ||
Local development requires the following programs to run: | ||
- docker ([documentation](https://docs.docker.com/engine/install/)) and [Docker](./docs/DOCKER.md) | ||
- npm, which is bundled with nodejs ([download](https://nodejs.org/en/download/)) | ||
|
||
ATTACHMENT_PATH=/var/storage | ||
For recent versions of docker, `docker-compose` utility is now part of docker (in `docker compose`). | ||
For compatibility reasons, create an alias or a script that aliases `docker-compose` to `docker compose`. | ||
Comment on lines
+9
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not necessary following Luckasz improvement |
||
|
||
NOTIFICATION_BROKER= | ||
``` | ||
## Installation | ||
|
||
Clone the Bookkeeping project | ||
|
||
On mac, the file database/configuration/my.cnf must be modified to set this variable to 1 : | ||
```sh | ||
git clone [email protected]:AliceO2Group/Bookkeeping.git | ||
cd Bookkeeping | ||
``` | ||
lower_case_table_names=1 | ||
|
||
## Run the docker stack | ||
|
||
Use the npm script (the `docker-compose` command must be available to npm) | ||
|
||
```sh | ||
npm run docker-run | ||
``` | ||
|
||
### Running | ||
You will then see in this tabs the server's log | ||
|
||
Execute `npm run docker-run` to launch the application. Once it is running, go to [localhost:4000](localhost:4000). | ||
### Run seeders [optional] | ||
|
||
## Sequlize (CLI) | ||
For the first time, database can be feed with fake data. To do so: | ||
|
||
In order to run those commands locally, you can either install `sequelize-cli` globally or simply run `npm i`. | ||
Wait until you see the log | ||
|
||
### Usage | ||
```sh | ||
$ npx sequelize-cli [command] | ||
``` | ||
|
||
### Show help | ||
```sh | ||
$ npx sequelize-cli --help | ||
[DATABASE] info: Executed pending migrations | ||
``` | ||
|
||
### Generates a new migration file | ||
```sh | ||
$ npx sequelize-cli migration:generate --name <MIGRATION_FILE_NAME> | ||
``` | ||
Then you can run seeders in a different terminal window to populate your database | ||
|
||
### Run pending migrations | ||
```sh | ||
$ npx sequelize-cli db:migrate | ||
docker-compose exec application npm run sequelize -- db:seed:all | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
``` | ||
|
||
### Generates a new seed file | ||
```sh | ||
$ npx sequelize-cli seed:generate --name <SEEDER_FILE_NAME> | ||
``` | ||
### You are ready | ||
|
||
### Run every seeder | ||
```sh | ||
$ npx sequelize-cli db:seed:all | ||
``` | ||
You can now open the app at [http://localhost:4000](http://localhost:4000) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# B. :telescope: I want to use Bookkeeping and connect it to other systems already deployed | ||
## Getting started | ||
|
||
Below instructions, are provided for those who would like to deploy and setup Bookkeeping on its own. For this, you will need: | ||
- npm, which is bundled with nodejs ([download](https://nodejs.org/en/download/)) | ||
- mariaDB ([download](https://mariadb.org/download/)) | ||
### Configuration | ||
|
||
The following `.env` configuration is the bare minimum required for setup. It must be placed in the top dir. | ||
```ini | ||
; Database | ||
MYSQL_ROOT_PASSWORD=cern | ||
OPENID_ID= | ||
OPENID_SECRET= | ||
OPENID_REDIRECT= | ||
|
||
JWT_SECRET= | ||
|
||
ATTACHMENT_PATH=/var/storage | ||
|
||
NOTIFICATION_BROKER= | ||
``` | ||
Comment on lines
+9
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not necessary |
||
|
||
On mac, the file `database/configuration/my.cnf` must be modified to set this variable to `1`: | ||
``` | ||
lower_case_table_names=1 | ||
``` | ||
|
||
### Running | ||
|
||
Execute `npm run start:prod` to launch the application. Once it is running, go to [localhost:4000](localhost:4000). | ||
|
||
## Sequlize (CLI) | ||
Bookkeeping uses **sequalize** to migrate schemas from one version of Bookkeeping to another. It is also used for seed data into the existing database setup. | ||
In order to run below commands locally, you can either install `sequelize-cli` globally or simply run `npm ci`. | ||
|
||
### Usage | ||
```sh | ||
$ npx sequelize-cli [command] | ||
``` | ||
|
||
### Show help | ||
```sh | ||
$ npx sequelize-cli --help | ||
``` | ||
|
||
### Generates a new migration file | ||
```sh | ||
$ npx sequelize-cli migration:generate --name <MIGRATION_FILE_NAME> | ||
``` | ||
|
||
### Run pending migrations | ||
```sh | ||
$ npx sequelize-cli db:migrate | ||
``` | ||
|
||
### Generates a new seed file | ||
```sh | ||
$ npx sequelize-cli seed:generate --name <SEEDER_FILE_NAME> | ||
``` | ||
|
||
### Run every seeder | ||
```sh | ||
$ npx sequelize-cli db:seed:all | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fellow > Please f
o
llow