-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from bird-house/true-plugable-components
Improved plugable component architecture. Before this PR, components needing default values, needing template variable substitution, needing to execute commands pre and post `docker-compose up` are hardcoding their needs directly to the "core" system, basically "leaking" their requirements out even when they are not activated (fixes #62). This PR provides true plugable architecture for the components so they can provide all their needs without having to modify the code of the "core" system. All the components (monitoring, generic_bird, emu, testthredds) are modified to leverage the new plugable architecture, with additional customizations given it is cleaner/easier to have default configuration values. Given this PR both changes the architecture and modify many components at the same time, it is best to read each commit separately to easier understand which code change belongs to which "goal". Deployed here https://lvupavicsmaster.ouranos.ca with all the impacted components activated to test the change: * Canarie: https://lvupavicsmaster.ouranos.ca/canarie/node/service/status * Generic bird (using Finch): https://lvupavicsmaster.ouranos.ca/twitcher/ows/proxy/generic_bird?service=WPS&version=1.0.0&request=GetCapabilities * Emu: https://lvupavicsmaster.ouranos.ca/twitcher/ows/proxy/emu?service=WPS&version=1.0.0&request=GetCapabilities * Test Thredds: https://lvupavicsmaster.ouranos.ca/testthredds/catalog.html * Prometheus: http://lvupavicsmaster.ouranos.ca:9090/alerts * AlertManager: http://lvupavicsmaster.ouranos.ca:9093/ * Grafana dashboard: http://lvupavicsmaster.ouranos.ca:3001/d/pf6xQMWGz/docker-and-system-monitoring?orgId=1&refresh=5m
- Loading branch information
Showing
30 changed files
with
262 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# All env in this default.env can be overridden by env.local. | ||
# All env in this default.env must not depend on any env in env.local. | ||
|
||
export GRAFANA_ADMIN_PASSWORD="changeme!" | ||
export ALERTMANAGER_ADMIN_EMAIL_RECEIVER="" # "user1@example.com,user2@example.com" | ||
export SMTP_SERVER="" # "smtp.example.com:25" | ||
export ALERTMANAGER_EXTRA_GLOBAL="" | ||
export ALERTMANAGER_EXTRA_ROUTES="" | ||
export ALERTMANAGER_EXTRA_INHIBITION="" | ||
export ALERTMANAGER_EXTRA_RECEIVERS="" | ||
|
||
|
||
|
||
# add vars only needed to be substituted in templates | ||
|
||
VARS=" | ||
$VARS | ||
\$ALERTMANAGER_ADMIN_EMAIL_RECEIVER | ||
\$SMTP_SERVER | ||
" | ||
|
||
OPTIONAL_VARS=" | ||
$OPTIONAL_VARS | ||
\$ALERTMANAGER_EXTRA_GLOBAL | ||
\$ALERTMANAGER_EXTRA_ROUTES | ||
\$ALERTMANAGER_EXTRA_INHIBITION | ||
\$ALERTMANAGER_EXTRA_RECEIVERS | ||
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh -x | ||
|
||
docker volume create prometheus_persistence # metrics db | ||
docker volume create grafana_persistence # dashboard and config db | ||
docker volume create alertmanager_persistence # storage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# All env in this default.env can be overridden by env.local. | ||
# All env in this default.env must not depend on any env in env.local. | ||
|
||
# Should have been "birdhouse/emu" but at the moment the current config only | ||
# works with the "watchdog/jobqueue" branch so have to default to an image that | ||
# works by default. | ||
export EMU_IMAGE="tlvu/emu:watchdog" | ||
export EMU_PORT="8888" | ||
export EMU_INTERNAL_PORT="5000" | ||
# name in Twitcher/Magpie and Canarie monitoring | ||
export EMU_NAME="emu" | ||
# set to 'testwps_outputs' when used together with testthredds component | ||
export EMU_WPS_OUTPUTS_VOL="wps_outputs" | ||
|
||
|
||
|
||
# add vars only needed to be substituted in templates | ||
|
||
OPTIONAL_VARS=" | ||
$OPTIONAL_VARS | ||
\$EMU_PORT | ||
\$EMU_NAME | ||
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
birdhouse/optional-components/emu/emu-magpie-permission.cfg.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
permissions: | ||
- service: emu | ||
- service: ${EMU_NAME} | ||
permission: getcapabilities | ||
group: anonymous | ||
action: create | ||
|
||
- service: emu | ||
- service: ${EMU_NAME} | ||
permission: describeprocess | ||
group: anonymous | ||
action: create | ||
|
||
- service: emu | ||
- service: ${EMU_NAME} | ||
permission: execute | ||
group: anonymous | ||
action: create |
6 changes: 3 additions & 3 deletions
6
birdhouse/optional-components/emu/emu-magpie-provider.cfg.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
birdhouse/optional-components/emu/emu_canarie_api_monitoring.py.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.