Skip to content
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

Add dockerized instance for demo purposes #28

Merged
merged 17 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*
!demo
!src
!Dockerfile
!LICENSE.txt
!Makefile
!manage.py
!pyproject.toml
!README.md
!requirements.txt
!setup.py
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This Dockerfile is designed to run a Geant Argus for demo purposes. Together with the
# accompanying docker-compose.yaml it contains all that's needed to showcase Geant Argus.
# For additional instructions,

FROM python:3.10-slim
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends tini \
build-essential libpq-dev libffi-dev libssl-dev postgresql-client
RUN mkdir -p /argus

WORKDIR /argus
COPY requirements.txt /argus

RUN pip install -r requirements.txt

COPY . /argus
RUN pip install -e .

COPY ./demo /argus
RUN mv /argus/settings.py /argus/src/geant_argus/settings/demo.py

ENV PYTHONPATH=/argus/src
ENV PYTHONDONTWRITEBYTECODE=1
ENV DJANGO_SETTINGS_MODULE='geant_argus.settings.demo'

ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["/argus/docker-entrypoint.sh"]
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,32 @@ frontend for the NOC. Argus is an application written in Django. This web framew
extension/customization capabilities, which makes it relatively easy to slightly modify
applications written in Django

## Quick start

The easiest way to start an instance of Geant Argus is to use docker compose:

```
docker compose up
```

This will spin up everything you need for demoing Argus. It can be reached on
http://127.0.0.1:8000. The database is automatically populated with the incidents described in
the `demo/incidents` directory. You can reset the instance to its initial settings by running one
of two commands.:

```bash
docker compose down -v && docker compose up
```

The `demo/incidents` directory is mounted inside the container, so you can also edit the indicents
as you see fit and then run to update the incident list.

*note* this will also reset the database to its initial state.

```bash
docker compose exec -t argus ./initialize-db.py --force
```

## Development

_note_ additional information on how we customize Argus can be found in `DEVELOPMENT.md`
Expand Down
4 changes: 4 additions & 0 deletions demo/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
python3 manage.py migrate --noinput
python3 manage.py collectstatic --noinput
python3 manage.py runserver --insecure --noreload --no-color 0.0.0.0:8000
60 changes: 60 additions & 0 deletions demo/incidents/bgp-alarm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"phase": "FINALIZED",
"status": "ACTIVE",
"version": "v0a5",
"severity": "WARNING",
"init_time": "2024-08-31T23:35:55",
"endpoints": {
"bgp": [
{
"events": [
{
"is_up": false,
"init_time": "2024-08-31T23:35:55",
"clear_time": null,
"properties": {
"id": 15465849,
"peer": "159.226.10.14",
"status": "connected",
"idle_time": "2024-08-31T23:35:55",
"source_ip": "62.40.96.5",
"connect_time": "2024-08-31T23:36:02",
"snmp_trap_oid": "BGP4-MIB::bgpBackwardTransition",
"equipment_name": "rt1.mar.fr.geant.net",
"establish_time": null
}
},
{
"is_up": true,
"init_time": "2024-08-31T09:20:09",
"clear_time": "2024-08-31T23:34:13",
"properties": {
"id": 15465234,
"peer": "159.226.10.14",
"status": "established",
"idle_time": "2024-08-31T09:20:09",
"source_ip": "62.40.96.5",
"connect_time": "2024-08-31T09:20:11",
"snmp_trap_oid": "BGP4-MIB::bgpBackwardTransition",
"equipment_name": "rt1.mar.fr.geant.net",
"establish_time": "2024-08-31T23:34:13"
}
}
],
"hostname": "rt1.mar.fr.geant.net",
"remote_peer": "159.226.10.14"
}
],
"link": [],
"coriant": [],
"infinera": []
},
"description": "BGP peering (159.226.10.14) Incident",
"location": ["mar"],
"equipment": ["rt1.mar.fr"],
"short_lived": false,
"endpoint_count": 2,
"blacklist": {
"applied": false
}
}
76 changes: 76 additions & 0 deletions demo/incidents/hide-alarm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"phase": "FINALIZED",
"status": "CLEAR",
"version": "v0a5",
"location": [
"kie",
"kie"
],
"severity": "HIDE",
"blacklist": {
"applied": true,
"message": "TO hide alarms from NE monitoring tools",
"original_severity": "WARNING"
},
"endpoints": {
"bgp": [
{
"events": [
{
"is_up": true,
"init_time": "2023-05-16T13:56:04",
"clear_time": "2023-05-16T13:58:20",
"properties": {
"id": 13692641,
"peer": "193.177.129.61",
"status": "established",
"idle_time": "2023-05-16T13:55:32",
"source_ip": "62.40.96.1",
"connect_time": null,
"snmp_trap_oid": "BGP4-MIB::bgpBackwardTransition",
"equipment_name": "rt1.kie.ua.geant.net",
"establish_time": "2023-05-16T13:58:20"
}
}
],
"hostname": "rt1.kie.ua.geant.net",
"remote_peer": "193.177.129.61"
},
{
"events": [
{
"is_up": true,
"init_time": "2023-05-16T13:57:33",
"clear_time": "2023-05-16T16:26:43",
"properties": {
"id": 13692647,
"peer": "193.177.129.61",
"status": "established",
"idle_time": "2023-05-16T13:57:33",
"source_ip": "62.40.96.68",
"connect_time": null,
"snmp_trap_oid": "BGP4-MIB::bgpBackwardTransition",
"equipment_name": "rt2.kie.ua.geant.net",
"establish_time": "2023-05-16T16:26:43"
}
}
],
"hostname": "rt2.kie.ua.geant.net",
"remote_peer": "193.177.129.61"
}
],
"link": [],
"coriant": [],
"infinera": []
},
"equipment": [
"rt1.kie.ua",
"rt2.kie.ua"
],
"init_time": "2023-05-16T16:13:06",
"clear_time": "2023-05-16T16:26:43",
"ticket_ref": "",
"description": "BGP peering (193.177.129.61) Incident",
"short_lived": false,
"endpoint_count": 2
}
82 changes: 82 additions & 0 deletions demo/incidents/ix-peering.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"phase": "FINALIZED",
"status": "ACTIVE",
"version": "v0a5",
"severity": "MINOR",
"init_time": "2024-08-31T01:01:09",
"endpoints": {
"bgp": [
{
"events": [
{
"is_up": false,
"init_time": "2024-08-31T01:01:09",
"clear_time": null,
"properties": {
"id": 15464929,
"peer": "2001:07f8:0001:0000:0000:a501:6265:0001",
"status": "idle",
"idle_time": "2024-08-31T01:01:09",
"source_ip": "62.40.96.71",
"connect_time": null,
"snmp_trap_oid": "BGP4-V2-MIB-JUNIPER::jnxBgpM2BackwardTransition",
"equipment_name": "rt1.ams.nl.geant.net",
"establish_time": null
}
},
{
"is_up": true,
"init_time": "2024-08-31T00:00:02",
"clear_time": "2024-08-31T01:01:06",
"properties": {
"id": 15464869,
"peer": "2001:07f8:0001:0000:0000:a501:6265:0001",
"status": "established",
"idle_time": "2024-08-31T00:00:02",
"source_ip": "62.40.96.71",
"connect_time": "2024-08-31T00:00:24",
"snmp_trap_oid": "BGP4-V2-MIB-JUNIPER::jnxBgpM2BackwardTransition",
"equipment_name": "rt1.ams.nl.geant.net",
"establish_time": "2024-08-31T01:01:06"
}
}
],
"hostname": "rt1.ams.nl.geant.net",
"remote_peer": "2001:07f8:0001:0000:0000:a501:6265:0001"
},
{
"events": [
{
"is_up": true,
"init_time": "2024-08-31T00:00:14",
"clear_time": "2024-08-31T00:01:10",
"properties": {
"id": 15464874,
"peer": "2001:07f8:0001:0000:0000:a500:4134:0001",
"status": "established",
"idle_time": "2024-08-31T00:00:14",
"source_ip": "62.40.96.71",
"connect_time": "2024-08-31T00:00:28",
"snmp_trap_oid": "BGP4-V2-MIB-JUNIPER::jnxBgpM2BackwardTransition",
"equipment_name": "rt1.ams.nl.geant.net",
"establish_time": "2024-08-31T00:01:10"
}
}
],
"hostname": "rt1.ams.nl.geant.net",
"remote_peer": "2001:07f8:0001:0000:0000:a500:4134:0001"
}
],
"link": [],
"coriant": [],
"infinera": []
},
"description": "One or more IX peering down on rt1.ams.nl.geant.net",
"location": ["AMSTERDAM"],
"equipment": ["RT1.AMS.NL"],
"short_lived": false,
"endpoint_count": 3,
"blacklist": {
"applied": false
}
}
69 changes: 69 additions & 0 deletions demo/incidents/link-alarm-clear.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"phase": "FINALIZED",
"status": "CLEAR",
"version": "v0a5",
"severity": "WARNING",
"init_time": "2024-08-29T07:19:05",
"clear_time": "2024-08-29T07:30:30",
"endpoints": {
"bgp": [],
"link": [
{
"events": [
{
"is_up": true,
"init_time": "2024-08-29T07:19:05",
"clear_time": "2024-08-29T07:30:30",
"properties": {
"id": 15448074,
"oper_status": "up",
"admin_status": "up",
"oper_up_time": "2024-08-29T07:30:30",
"admin_up_time": "2024-08-29T07:19:05",
"snmp_trap_oid": "IF-MIB::linkDown",
"equipment_name": "rt1.rig.lv.geant.net",
"interface_name": "ae3",
"oper_down_time": "2024-08-29T07:19:05",
"admin_down_time": null
}
}
],
"hostname": "rt1.rig.lv.geant.net",
"interface": "ae3"
},
{
"events": [
{
"is_up": true,
"init_time": "2024-08-29T07:19:05",
"clear_time": "2024-08-29T07:30:27",
"properties": {
"id": 15448084,
"oper_status": "up",
"admin_status": "up",
"oper_up_time": "2024-08-29T07:30:27",
"admin_up_time": "2024-08-29T07:19:05",
"snmp_trap_oid": "IF-MIB::linkDown",
"equipment_name": "rt1.rig.lv.geant.net",
"interface_name": "xe-0/1/0",
"oper_down_time": "2024-08-29T07:19:05",
"admin_down_time": null
}
}
],
"hostname": "rt1.rig.lv.geant.net",
"interface": "xe-0/1/0"
}
],
"coriant": [],
"infinera": []
},
"description": "DCN-MANAGEMENT-RIG1-LV-, EX4300-MANAGEMENT-RIG-LV (interface ae3) Incident",
"location":["RIGA"],
"equipment": ["RT1.RIG.LV"],
"short_lived": false,
"endpoint_count": 2,
"blacklist": {
"applied": false
}
}
Loading