Commit cf54b20
authored
fix CanarieAPI config to support Python 3.x (#284)
## Overview
Please include a summary of the changes and which issues are fixed.
Please also include relevant motivation and context.
List any dependencies that are required for this change.
## Breaking changes
- CanarieAPI: update to `0.7.1`.
- The Docker running `CanarieAPI` is now using Python 3 (since `0.4.x` tags).
Configurations need to be updated if any specific Python 2 definitions were used.
See [2to3](https://docs.python.org/3/library/2to3.html) to help migrate configurations automatically if necessary.
- Update the [CanarieAPI configuration](birdhouse/config/canarie-api/docker_configuration.py.template) to use
Python 3.x executable code.
## Changes
- CanarieAPI: update to `0.7.1`.
- The server node now provides a generic ``server`` configuration for the current ``platform`` definition.
- Added multiple missing docuementation references for all the services included within `CanarieAPI` configurations.
- With new `CanarieAPI` version, a slightly improved UI with more service details are provided for the active server:

- Add optional variables witht defaults to define reference Docker image version tags.
Following optional variables are defined by default. These are used as reference in the respective Docker compose
service definition of these components, as well as in their `CanarieAPI` configuration to retrieve the release time
of the tag, and refer to relevant URL references as needed.
- `CATALOG_VERSION`
- `FINCH_VERSION`
- `FLYINGPIGEON_VERSION`
- `GEOSERVER_VERSION`
- `HUMMINGBIRD_VERSION`
- `MALLEEFOWL_VERSION`
- `RAVEN_VERSION`
## Fixes:
- CanarieAPI: update to `0.7.1`.
- Fixes an `AttributeError` raised due to misconfiguration of the Web Application with Flask 2.x definitions
(relates to [Ouranosinc/CanarieAPI#10](Ouranosinc/CanarieAPI#10)).
- Skip over `0.4.x`, `0.5.x`, `0.6.x` versions to avoid issue related to `cron` job monitoring and log parser
command failures in order to collect configured service statistics and statuses
(see also [Ouranosinc/CanarieAPI#14](Ouranosinc/CanarieAPI#14)).
- Weaver: update CanarieAPI monitoring definitions
- Move monitoring of public endpoint under [optional-components/canarie-api-full-monitoring][canarie-monitor].
- Add monitoring of private endpoint by default when using Weaver component.
- Cowbird: update CanarieAPI monitoring definitions
- Add monitoring of public endpoint under [optional-components/canarie-api-full-monitoring][canarie-monitor].
- Add public Magpie permission on Cowbird entrypoint only to allow its monitoring.
## Additional Information
Resolves the following log error.
```
proxy | [2023-01-31 19:37:01 +0000] [37] [DEBUG] GET /canarie/
proxy | [2023-01-31 19:37:01,708] [37] [INFO] app_object : Disconnecting from database
proxy | [2023-01-31 19:37:01,709] [37] [DEBUG] app_object : Using db filename : /opt/local/src/CanarieAPI/stats.db
proxy | [2023-01-31 19:37:01 +0000] [37] [DEBUG] Closing connection.
proxy | [2023-01-31 19:37:02 +0000] [37] [DEBUG] GET /canarie/background.jpg
proxy | [2023-01-31 19:37:02,176] [37] [INFO] app_object : Disconnecting from database
proxy | [2023-01-31 19:37:02,176] [37] [DEBUG] app_object : Using db filename : /opt/local/src/CanarieAPI/stats.db
proxy | [2023-01-31 19:37:02 +0000] [37] [ERROR] Error handling request /canarie/background.jpg
proxy | Traceback (most recent call last):
proxy | File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/async.py", line 56, in handle
proxy | self.handle_request(listener_name, req, client, addr)
proxy | File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 152, in handle_request
proxy | super(GeventWorker, self).handle_request(*args)
proxy | File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/async.py", line 107, in handle_request
proxy | respiter = self.wsgi(environ, resp.start_response)
proxy | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1997, in __call__
proxy | return self.wsgi_app(environ, start_response)
proxy | File "/opt/local/src/CanarieAPI/canarieapi/reverse_proxied.py", line 33, in __call__
proxy | return self.app(environ, start_response)
proxy | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1985, in wsgi_app
proxy | response = self.handle_exception(e)
proxy | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1532, in handle_exception
proxy | handler = self._find_error_handler(InternalServerError())
proxy | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1449, in _find_error_handler
proxy | .get(code))
proxy | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1440, in find_handler
proxy | handler = handler_map.get(cls)
proxy | AttributeError: 'function' object has no attribute 'get'
```
The above problem lead to unresponsive CanarieAPI, which in turn caused the platform to fail responding with successful monitoring statuses for requests toward the configured services, which in turn, caused the stack to never completely boot. When the stack failed to boot, the *End2End Test Results* (example: #283 (comment)) could not run due to the unresponsive instance, which is the cause of the incomplete output:
`````
Tests URL :
NOTEBOOK TEST RESULTS
````
</code>
``
`````
# To Do (in follow-up PRs)
- remove deprecated configs deleted in #287
- remove deprecated configs deleted in #291
- remove deprecated configs deleted in #292File tree
64 files changed
+972
-164
lines changed- birdhouse
- components
- cowbird
- config
- magpie
- proxy
- weaver/config/canarie-api
- config
- canarie-api
- catalog
- config/canarie-api
- finch
- config/canarie-api
- flyingpigeon
- config/canarie-api
- frontend/config/canarie-api
- geoserver
- config/canarie-api
- hummingbird
- config/canarie-api
- jupyterhub
- config/canarie-api
- magpie
- config/canarie-api
- malleefowl
- config/canarie-api
- phoenix
- config/canarie-api
- project-api/config/canarie-api
- raven
- config/canarie-api
- solr
- config/canarie-api
- thredds
- config/canarie-api
- twitcher
- config/canarie-api
- optional-components
- all-public-access/config/ncwms2
- canarie-api-full-monitoring/config/canarie-api
- emu
- generic_bird
- docs/source
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
64 files changed
+972
-164
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
20 | 78 | | |
21 | 79 | | |
22 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
21 | 32 | | |
22 | 33 | | |
23 | 34 | | |
| |||
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
8 | 15 | | |
9 | 16 | | |
Lines changed: 35 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
6 | 12 | | |
7 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
8 | 37 | | |
9 | 38 | | |
0 commit comments