Skip to content
Snippets Groups Projects
Commit 593327f5 authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

L2SS-429: add readme file

parent 6e815fa4
No related branches found
No related tags found
1 merge request!177Resolve L2SS-429 "Timescaledb container"
...@@ -6,8 +6,3 @@ COPY resources/02_hdb_schema.sql docker-entrypoint-initdb.d/003_hdb_schema.sql ...@@ -6,8 +6,3 @@ COPY resources/02_hdb_schema.sql docker-entrypoint-initdb.d/003_hdb_schema.sql
COPY resources/03_hdb_roles.sql docker-entrypoint-initdb.d/004_hdb_roles.sql COPY resources/03_hdb_roles.sql docker-entrypoint-initdb.d/004_hdb_roles.sql
COPY resources/04_hdb_ext_aggregates.sql docker-entrypoint-initdb.d/005_hdb_ext_aggregates.sql COPY resources/04_hdb_ext_aggregates.sql docker-entrypoint-initdb.d/005_hdb_ext_aggregates.sql
COPY resources/05_cleanup.sql docker-entrypoint-initdb.d/006_cleanup.sql COPY resources/05_cleanup.sql docker-entrypoint-initdb.d/006_cleanup.sql
# 2nd version
#COPY resources_v2/schema.sql docker-entrypoint-initdb.d/002_schema.sql
#COPY resources_v2/schema.sql docker-entrypoint-initdb.d/003_users.sql
#COPY resources_v2/schema.sql docker-entrypoint-initdb.d/004_cluster.sql
# TimescaleDB Docker Image
The Dockerfile in this directory allows to create a container with a PostrgreSQL-Timescale DBMS (https://www.timescale.com/), and then initialise it with the DB schema required by the Tango Archiving framework.
The main image is pulled from the official PostgreSQL repository in the Docker Hub (https://hub.docker.com/_/postgres). This image offers several features to customize and extend itself.
## Initialization scripts
If you would like to do additional initialization in an image derived from the Postgres official one, add one or more *.sql, *.sql.gz, or *.sh scripts under /docker-entrypoint-initdb.d (creating the directory if necessary). After the entrypoint calls initdb to create the default postgres user and database, it will run any *.sql files, run any executable *.sh scripts, and source any non-executable *.sh scripts found in that directory to do further initialization before starting the service.
The script files in the directory /docker-entrypoint-initdb.d are sequentially executed following their preempted number in the filename. Hence, the first ones (000_install_timescaledb.sh and 001_timescaledb_tune.sh) are provided by default.
The next ones have been pulled from the official Tango repository in order to create the desired DB schema. These files are in the 'resources' directory and they have been pulled from Tango-Hdbpp_Timescale_Project (https://github.com/tango-controls-hdbpp/hdbpp-timescale-project/tree/master/resources/schema):
- admin.sql creates the admin user that will create the tables
- hdb_schema.sql creates the standard Tango Archiving DB (This is the only MANDATORY script)
- hdb_roles.sql creates additional roles
- hdb_ext_aggregates.sql creates the continuous aggregate views (https://docs.timescale.com/timescaledb/latest/how-to-guides/continuous-aggregates/)
- cleanup.sql strips the SUPERUSER trait from hdb_admin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment