Skip to content

Commit

Permalink
Merge branch 'csu_2023_team_3' into tsdb_master_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
dajtxx authored Jul 16, 2024
2 parents b8d8e7f + 1cb0487 commit a1bc414
Show file tree
Hide file tree
Showing 74 changed files with 4,280 additions and 122 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,7 @@ swag/*
!swag/nginx/proxy-confs/dpi-device-manager.subfolder.conf
*.pem

settings.json
settings.json

#303 back up database
backup-db/
9 changes: 9 additions & 0 deletions compose/.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ PGDATABASE=broker
POSTGRES_PASSWORD=CHANGEME
POSTGRES_DB=broker

#TSDB -- KEEP SYNCED WITH ./.tsdb_env
TSDB_USER=postgres
TSDB_PASSWORD=admin
TSDB_PORT=5432
TSDB_HOST=tsdb
TSDB_DB=postgres
TSDB_TABLE=timeseries #set in init.sql
NAMING_UPDATE_INTERVAL=600 ##how often on new message to map will it check to update word_list and type_maps

# Set this to the root of the git repo as it is seen by the containers.
PYTHONPATH=/home/broker/python

Expand Down
3 changes: 3 additions & 0 deletions compose/.tsdb_env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POSTGRES_USER=postgres
POSTGRES_PASSWORD=admin
POSTGRES_PORT=5432
32 changes: 31 additions & 1 deletion compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ services:
working_dir: "/home/broker/python"
entrypoint: [ "python", "-m", "delivery.FRRED" ]


axistech:
image: broker/python-base
logging:
Expand All @@ -266,10 +267,39 @@ services:
- frred
depends_on:
db:
entrypoint: [ "python", "-m", "pollers.axistech" ]

timescaledb:
build: ../timescale # Point to the directory containing the custom Dockerfile
hostname: "tsdb"
image: custom-timescaledb:latest
restart: "no"

env_file:
- .tsdb_env
volumes:
- ../timescale/init.sql:/docker-entrypoint-initdb.d/init.sql
- ../timescale/pgbackrest/pgbackrest.conf:/home/postgres/pgdata/backup/pgbackrest.conf
- ../timescale/logs:/var/log/timescale
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${TSDB_USER}"]
interval: 10s
timeout: 5s
retries: 3

iota_tsdb_decoder:
image: broker/python-base
restart: "no"
env_file:
- .env
depends_on:
timescaledb:
condition: "service_healthy"
mq:
condition: "service_healthy"
volumes:
- ../src/python:/home/broker/python
working_dir: "/home/broker/python"
entrypoint: [ "python", "-m", "pollers.axistech" ]
entrypoint: [ "python", "-m", "timescale.TS_LTSReader" ]
11 changes: 11 additions & 0 deletions compose/production/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,20 @@ services:
ports:
- "127.0.0.1:5000:5000"

timescaledb:
volumes:
- tsdb_db:/home/postgres/pgdata/data
- pgbackrest_data:/var/lib/pgbackrest

volumes:
broker_db:
external: true

mq_data:
external: true

tsdb_db:
external: true

pgbackrest_data:
external: false
7 changes: 7 additions & 0 deletions compose/test/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@ services:
- ..:/home/broker/broker
working_dir: "/home/broker/broker"
entrypoint: [ "./forever.sh" ]
mq:
ports:
- 15672:15672
restapi:
ports:
- 5687:5687

Loading

0 comments on commit a1bc414

Please sign in to comment.