Skip to content

Commit

Permalink
Support for Peering Manager 1.7.0
Browse files Browse the repository at this point in the history
Closes #21 as it adds housekeeping and PeeringDB sync support too.
  • Loading branch information
gmazoyer committed Aug 21, 2022
1 parent 6b81440 commit e23c106
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ COPY ${PEERING_MANAGER_PATH} /opt/peering-manager

COPY docker/configuration.docker.py /opt/peering-manager/peering_manager/configuration.py
COPY docker/docker-entrypoint.sh /opt/peering-manager/docker-entrypoint.sh
COPY docker/housekeeping.sh /opt/peering-manager/housekeeping.sh
COPY docker/peeringdb.sh /opt/peering-manager/peeringdb.sh
COPY docker/launch-peering-manager.sh /opt/peering-manager/launch-peering-manager.sh
COPY startup_scripts/ /opt/peering-manager/startup_scripts/
COPY initializers/ /opt/peering-manager/initializers/
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.0
2.1.0
2 changes: 1 addition & 1 deletion configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def get_sys_tz():
}

CHANGELOG_RETENTION = int(os.environ.get("CHANGELOG_RETENTION", 90))
JOBRESULT_RETENTION = int(os.environ.get("JOBRESULT_RETENTION", 90))
LOGIN_REQUIRED = os.environ.get("LOGIN_REQUIRED", "False").lower() == "true"
BANNER_LOGIN = os.environ.get("BANNER_LOGIN", "")
PEERINGDB_USERNAME = os.environ.get("PEERINGDB_USERNAME", "")
Expand Down Expand Up @@ -144,7 +145,6 @@ def get_sys_tz():
"RELEASE_CHECK_URL",
"https://api.github.com/repos/peering-manager/peering-manager/releases",
)
RELEASE_CHECK_TIMEOUT = os.environ.get("RELEASE_CHECK_TIMEOUT", 86400)
SOFTDELETE_ENABLED = os.environ.get("SOFTDELETE_ENABLED", "False").lower() == "true"
SOFTDELETE_RETENTION = int(os.environ.get("SOFTDELETE_RETENTION", CHANGELOG_RETENTION))
DATE_FORMAT = os.environ.get("DATE_FORMAT", "jS F, Y")
Expand Down
20 changes: 17 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: "3.4"
services:
peering-manager:
&peering-manager
image: peeringmanager/peering-manager:${VERSION-v1.6}
image: peeringmanager/peering-manager:${VERSION-v1.7}
env_file: env/peering-manager.env
user: "unit:root"
volumes:
Expand All @@ -14,8 +14,8 @@ services:
depends_on:
- postgres
- redis
- peering-manager-worker
peering-manager-worker:
- rqworker
rqworker:
<<: *peering-manager
depends_on:
- postgres
Expand All @@ -24,6 +24,20 @@ services:
- /opt/peering-manager/venv/bin/python
- /opt/peering-manager/manage.py
- rqworker
housekeeping:
<<: *peering-manager
depends_on:
- postgres
- redis
command:
- /opt/peering-manager/housekeeping.sh
peeringdb-sync:
<<: *peering-manager
depends_on:
- postgres
- redis
command:
- /opt/peering-manager/peeringdb.sh
postgres:
image: postgres:14-alpine
env_file: env/postgres.env
Expand Down
9 changes: 9 additions & 0 deletions docker/housekeeping.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
SECONDS=${HOUSEKEEPING_INTERVAL:=86400}

echo "Interval set to ${SECONDS} seconds"
while true; do
date
/opt/peering-manager/venv/bin/python /opt/peering-manager/manage.py housekeeping
sleep "${SECONDS}s"
done
9 changes: 9 additions & 0 deletions docker/peeringdb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
SECONDS=${PEERINGDB_SYNC_INTERVAL:=86400}

echo "Interval set to ${SECONDS} seconds"
while true; do
date
/opt/peering-manager/venv/bin/python /opt/peering-manager/manage.py peeringdb_sync
sleep "${SECONDS}s"
done
2 changes: 2 additions & 0 deletions env/peering-manager.env
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ [email protected]
# PEERINGDB_USERNAME=
# PEERINGDB_PASSWORD=
# PEERINGDB_API_KEY=
# PEERINGDB_SYNC_INTERVAL=86400
# HOUSEKEEPING_INTERVAL=86400
# NAPALM_USERNAME=
# NAPALM_PASSWORD=
# NAPALM_TIMEOUT=
Expand Down

0 comments on commit e23c106

Please sign in to comment.