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

Feature/dac 300 weaver compose #114

Merged
merged 130 commits into from
Nov 1, 2021
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
7ba12e8
basic working /processes route
Zvax Nov 5, 2020
c3cb446
pushes nginx files inside proxy container
Zvax Nov 6, 2020
a7d5e5b
explicitely adds environment variables to the templating engine and n…
Zvax Nov 6, 2020
47e59f0
fixes postgres-pavics database not found psql error
Zvax Nov 6, 2020
4a87f1a
unhardcodes various twitcher and weaver configs
Zvax Nov 11, 2020
381c0d1
adds path config from environment for weaver wps
Zvax Nov 11, 2020
721ed5c
first pass aligning params with deploy variables
fmigneault Dec 12, 2020
4a107d6
tag mongodb 3.6.21 + remap volumes for docker-compose 3.4
fmigneault Jan 5, 2021
278714f
employ log rotation shared logging config
fmigneault Jan 5, 2021
b376620
add DATA_PERSIST_ROOT value to override root data directory path as n…
fmigneault Jan 5, 2021
bac7b32
move all weaver configs under their optional-component directory
fmigneault Jan 6, 2021
35aece5
add server/contact/support variables that can be shared across contai…
fmigneault Jan 6, 2021
f3c6687
revert mongodb 3.4
fmigneault Jan 6, 2021
784f00d
fix weaver twitcher nginx variable
fmigneault Jan 6, 2021
6745774
fix incorrect user:anonymous magpie permission to group:anonymous
fmigneault Jan 7, 2021
98908c7
fix weaver/twitcher nginx path + use variable to service name of weaver
fmigneault Jan 7, 2021
7a3946c
bump weaver version 1.13.1
fmigneault Jan 7, 2021
aaa19fe
bump weaver 1.14.0 (providers-config) & apply depends_on to load othe…
fmigneault Jan 12, 2021
480d6e7
add healthchecks for wps providers registed in weaver + remove extra …
fmigneault Jan 12, 2021
54e7700
fix healthcheck commands
fmigneault Jan 12, 2021
13144ac
revert service names
fmigneault Jan 12, 2021
3f85413
adjust weaver nginx redirects
fmigneault Jan 12, 2021
786bdb3
move healthchecks into separate optional-component
fmigneault Jan 12, 2021
3d12392
add Weaver WPS providers Magpie permissions
fmigneault Jan 12, 2021
f598a9e
change weaver magpie permissions to allow read all provider processes…
fmigneault Jan 13, 2021
a1f2a55
use same wpsoutputs location as other birds for weaver's location
fmigneault Jan 13, 2021
3a6b7b3
revert named volume 'testdatasets' to literal path and employ DATA_PE…
fmigneault Jan 13, 2021
d7c442e
remove CRIM-ADES from default weaver data-source locations
fmigneault Jan 13, 2021
f5c8346
use variable for weaver location + remove weaver config path as endpo…
fmigneault Jan 13, 2021
4bd4e65
add DATA_PERSIST_ROOT to template variables
fmigneault Jan 13, 2021
e911e29
add notes about startup weaver provider references
fmigneault Jan 15, 2021
39efac8
more details and adjustments of volume/paths wps-outputs + add magpie…
fmigneault Jan 15, 2021
89f2af2
move weaver to 'components'
fmigneault Jan 15, 2021
8baa010
user PAVICS_FQDN_PUBLIC
fmigneault Jan 26, 2021
80559a3
add read-only attribute to applicable weaver config files
fmigneault Jan 26, 2021
61ff3f1
use dummy default contact values
fmigneault Feb 1, 2021
d181b09
update weaver readme details
fmigneault Feb 13, 2021
c69bac6
target weaver 2.0.0
fmigneault Feb 22, 2021
f32b656
add POST job magpie permission for weaver onto hummingbird-ncdump pro…
fmigneault Feb 23, 2021
ead9414
add explicit dependencies between weaver/worker/mongodb/docker-proxy …
fmigneault Feb 23, 2021
88043d0
adjust networks to avoid other birds to connect to weaver-worker, but…
fmigneault Feb 23, 2021
63c81cb
add missing mongodb network
fmigneault Feb 23, 2021
c93b217
revert mounted volume path in proxy for wps-outputs
fmigneault Feb 25, 2021
5a3d6b1
add magpie anonymous permissions for weaver /versions and /conformanc…
fmigneault Mar 3, 2021
fed1740
apply specific healthcheck commands per service
fmigneault Mar 3, 2021
5e7a1ed
fix healthcheck interval/timeout expecting strings
fmigneault Mar 3, 2021
7381acd
Merge branch 'master' into feature/DAC-300-weaver-compose
fmigneault Mar 18, 2021
23be4cd
fix typos
fmigneault Mar 18, 2021
72be4e4
bump weaver 2.2.0
fmigneault Mar 19, 2021
683ffc3
ensure admin perms full access to weaver - for backward compat of mag…
fmigneault Mar 19, 2021
35c1bcf
force ignore files
fmigneault Mar 22, 2021
446e944
Merge branch 'master' into feature/DAC-300-weaver-compose
fmigneault Apr 21, 2021
dc3b555
remove pavics-compose env vars specific to weaver metadata
fmigneault Apr 21, 2021
e76c7a0
Merge branch 'docker-compose-update' into feature/DAC-300-weaver-compose
fmigneault Apr 21, 2021
0233590
Merge branch 'docker-compose-update' into feature/DAC-300-weaver-compose
fmigneault Apr 21, 2021
93dcadd
Merge branch 'docker-compose-update' into feature/DAC-300-weaver-compose
fmigneault Apr 21, 2021
9582e23
Merge branch 'util-optional-components' into feature/DAC-300-weaver-c…
fmigneault Apr 21, 2021
b48ff45
Merge branch 'extra-envvar' into feature/DAC-300-weaver-compose
fmigneault Apr 22, 2021
d0ddeca
Merge branch 'extra-envvar' into tmp-everything-except-weaver
fmigneault Apr 22, 2021
f13cc68
Merge branch 'extra-envvar' into feature/DAC-300-weaver-compose
fmigneault Apr 22, 2021
41e67d3
Merge branch 'extra-envvar' into feature/DAC-300-weaver-compose
fmigneault Apr 22, 2021
5428c3c
Merge branch 'extra-envvar' into tmp-everything-except-weaver
fmigneault Apr 22, 2021
c317638
Merge branch 'tmp-everything-except-weaver' into feature/DAC-300-weav…
fmigneault Apr 22, 2021
f22dd34
patch merge conflict
fmigneault Apr 22, 2021
0d24192
Merge branch 'tmp-everything-except-weaver' into feature/DAC-300-weav…
fmigneault Apr 22, 2021
db210bb
Merge branch 'extra-envvar' into tmp-everything-except-weaver
fmigneault Apr 22, 2021
44f6684
Merge branch 'tmp-everything-except-weaver' into feature/DAC-300-weav…
fmigneault Apr 22, 2021
a084ca6
Merge branch 'docker-compose-update' into tmp-everything-except-weaver
fmigneault Apr 23, 2021
d583e0d
Merge branch 'tmp-everything-except-weaver' into feature/DAC-300-weav…
fmigneault Apr 23, 2021
8e2513a
Merge branch 'extra-envvar' into tmp-everything-except-weaver
fmigneault May 3, 2021
9513ba7
Merge branch 'tmp-everything-except-weaver' into feature/DAC-300-weav…
fmigneault May 3, 2021
acf8e40
skip weaver 2.x and move directly to 3.x for integration in platform
fmigneault May 3, 2021
11a4112
Merge branch 'extra-envvar' into tmp-everything-except-weaver
fmigneault May 3, 2021
69e9831
Merge branch 'tmp-everything-except-weaver' into feature/DAC-300-weav…
fmigneault May 3, 2021
c03f091
Merge branch 'extra-envvar' into tmp-everything-except-weaver
fmigneault May 3, 2021
1d3045c
Merge branch 'tmp-everything-except-weaver' into feature/DAC-300-weav…
fmigneault May 3, 2021
8be633b
update weaver with mongodb specific network
fmigneault May 4, 2021
63d90d7
Merge branch 'util-optional-components' into tmp-everything-except-we…
fmigneault May 4, 2021
8bd7f04
Merge branch 'tmp-everything-except-weaver' into feature/DAC-300-weav…
fmigneault May 4, 2021
bb7e807
Merge branch 'master' into feature/DAC-300-weaver-compose
fmigneault Aug 18, 2021
1e72862
add note about config.yml employed in Weaver component config
fmigneault Aug 18, 2021
3421866
bump weaver 3.1.0 -> 3.5.0
fmigneault Aug 19, 2021
0150629
add 'wait-for-wps' image for weaver to wait until GetCapabilities res…
fmigneault Aug 19, 2021
0455ed4
add dynamic build of weaver+dockerize such that it correctly waits fo…
fmigneault Aug 25, 2021
949f8d9
update changelog with weaver changes
fmigneault Aug 25, 2021
757ad59
patch wrong comment in weaver's config default.env
fmigneault Sep 1, 2021
1821939
align weaver's compose logging config with rest of server's main logg…
fmigneault Sep 1, 2021
c1acdfd
pin explicit tag tecnativa/docker-socket-proxy:0.1.1
fmigneault Sep 1, 2021
46e935d
rename 'worker' to 'weaver-worker' for clarity
fmigneault Sep 1, 2021
de702ab
convert weaver's data_sources.json to YAML
fmigneault Sep 1, 2021
23a5bd7
Merge branch 'master' into feature/DAC-300-weaver-compose
fmigneault Sep 2, 2021
ec2bb0e
add optional-component/test-weaver and move test-specific configs fro…
fmigneault Sep 2, 2021
2b32e69
[wip] use post-compose script to register weaver birds
fmigneault Sep 1, 2021
dae501c
script post-docker-compose-up for weaver WPS providers registration
fmigneault Sep 2, 2021
6b4a8d5
add variables of new weaver script post-docker-compose-up to EXTRA_VA…
fmigneault Sep 2, 2021
fcd917b
add wait for weaver to be ready
fmigneault Sep 2, 2021
b5f1325
add note about WEAVER_WPS_PROVIDERS_MAX_TIME unit seconds
fmigneault Sep 2, 2021
c48e54d
replace curl opts that are not self-explanatory by long forms
fmigneault Sep 2, 2021
b861c71
improve message of which step failed WPS provider registration in Weaver
fmigneault Sep 2, 2021
a0164e5
small patch of weaver wps-processes config
fmigneault Sep 2, 2021
ae57d60
fix incorrect field name to register WPS provider
fmigneault Sep 2, 2021
8bda1cc
post-docker-compose-up chmod x for running
fmigneault Sep 3, 2021
bed06dd
avoid exposing token during wps-registration in weaver + fixes to han…
fmigneault Sep 3, 2021
c5417a4
revert 'name' field invalid back to 'id'
fmigneault Sep 3, 2021
190c363
ignore more backup files
fmigneault Sep 21, 2021
18b748a
bump weaver 3.5.0 -> 4.0.0
fmigneault Sep 21, 2021
f341fdd
patch incorrect check of empty cookie + add minimal validation of aut…
fmigneault Sep 21, 2021
69dac7d
ignore failing tput when missing TERM definition
fmigneault Sep 22, 2021
10130e4
log info about requested WPS providers for easier debugging
fmigneault Sep 22, 2021
c1dece5
add Magpie permission for 'app_producers' group to allow Weaver app (…
fmigneault Sep 24, 2021
b15e22d
bump weaver 4.1.0
fmigneault Sep 30, 2021
1839c40
add celery result config and for startup before weaver api
fmigneault Oct 6, 2021
0927352
bump weaver 4.1.1
fmigneault Oct 13, 2021
08b17b5
bump weaver 4.1.2 (add celery task events https://github.com/crim-ca/…
fmigneault Oct 13, 2021
d7cb2c3
add explicit import location of task execution in celery-ini config f…
fmigneault Oct 13, 2021
e7fb2d2
add adjusted wps-outputs volume to proxy for weaver results
fmigneault Oct 14, 2021
0d84b46
add healtcheck with celery inspect to attempt retry setup of missing …
fmigneault Oct 19, 2021
147278f
move healtcheck to weaver-worker to force retry setup task
fmigneault Oct 19, 2021
7265a71
bump weaver 4.2.0
fmigneault Oct 20, 2021
ba40f82
add auto-restart weaver/worker on invalid celery tasks healthcheck
fmigneault Oct 20, 2021
9e6af09
adjust celery healthcheck & its usage within post-docker-compose-up
fmigneault Oct 20, 2021
583aca2
patch incorrect check of celery task name in healthcheck
fmigneault Oct 20, 2021
63a1bb3
bump weaver 4.2.1
fmigneault Oct 20, 2021
a6d7feb
Merge pull request #192 from bird-house/weaver-extra-config
fmigneault Oct 20, 2021
e5053d2
Merge remote-tracking branch 'origin/master' into feature/DAC-300-wea…
fmigneault Oct 20, 2021
e02ec48
move weaver canarie-api monitoring to distinct config mounted when co…
fmigneault Oct 27, 2021
bc30eff
Merge remote-tracking branch 'origin/master' into feature/DAC-300-wea…
fmigneault Oct 27, 2021
fba7632
double the time for weaver's wps provider timeout (120s) since 60s wa…
fmigneault Oct 28, 2021
d3aabec
detect error celery setup although docker-compose command is ok to fo…
fmigneault Oct 29, 2021
c770f9c
Bump version: 1.16.2 → 1.17.0
fmigneault Nov 1, 2021
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ ubuntu-bionic-18.04-cloudimg-console.log
.idea
.vscode
*.bak
weaver/

# vim temp files
*.swp
67 changes: 65 additions & 2 deletions birdhouse/components/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ How to Enable the Component
- Add "./components/scheduler" to ``EXTRA_CONF_DIRS``.
- Set ``AUTODEPLOY_EXTRA_REPOS``, ``AUTODEPLOY_DEPLOY_KEY_ROOT_DIR``,
``AUTODEPLOY_PLATFORM_FREQUENCY``, ``AUTODEPLOY_NOTEBOOK_FREQUENCY`` as desired,
full documentation in env.local.example_.
full documentation in `env.local.example`_.
- Run once fix-write-perm_ (:download:`download <../deployment/fix-write-perm>`), see doc in script.


Expand Down Expand Up @@ -155,7 +155,7 @@ Usage
How to Enable the Component
---------------------------

- Edit ``env.local`` (a copy of env.local.example_ (:download:`download <../env.local.example>`))
- Edit ``env.local`` (a copy of `env.local.example`_ (:download:`download <../env.local.example>`))

- Add "./components/monitoring" to ``EXTRA_CONF_DIRS``
- Set ``GRAFANA_ADMIN_PASSWORD`` to login to Grafana
Expand Down Expand Up @@ -229,8 +229,71 @@ Customizing the Component
Slack or other services accepting webhooks), ``ALERTMANAGER_EXTRA_RECEIVERS``.


Weaver
======

By enabling this component, the `Weaver`_ service will be integrated into the stack.

This component offers `OGC API - Processes`_ interace to WPS components (a.k.a `WPS-REST bindings` and
`WPS-T (Transactional)` support).
This provides a RESTful JSON interface with asynchronous WPS processes execution over remote instances.
Other WPS components of the birdhouse stack (`finch`_, `flyingpigeon`_, etc.) will also all be registered
under `Weaver`_ in order to provide a common endpoint to retrieve all available processes, and dispatch
their execution to the corresponding service.
Finally, `Weaver`_ also adds `Docker` image execution capabilities as a WPS process, allowing deployment
and execution of custom applications and workflows.


Usage
-----

Once this component is enabled, `Weaver`_ will be accessible at ``https://<PAVICS_FQDN_PUBLIC>/weaver`` endpoint,
where ``PAVICS_FQDN_PUBLIC`` is defined in your ``env.local`` file.

Full process listing (across WPS providers) should be available using request:

.. code-block::

GET https://<PAVICS_FQDN_PUBLIC>/weaver/processes?providers=true

Please refer to the `Weaver OpenAPI`_ for complete description of available requests.
This description will also be accessible via ``https://<PAVICS_FQDN_PUBLIC>/weaver/api`` once the instance is started.

For any specific details about `Weaver`_ configuration parameters, functionalities or questions, please refer to its
`documentation <https://pavics-weaver.readthedocs.io/en/latest/>`_.

How to Enable the Component
---------------------------

- Edit ``env.local`` (a copy of `env.local.example`_)

- Add ``"./components/weaver"`` to ``EXTRA_CONF_DIRS``.

- Component ``birdhouse/optional-components/all-public-access`` should also be enabled to ensure that `Weaver`_
can request ``GetCapabilities`` of every WPS provider to be registered. Publicly inaccessible services will not
succeed registration and will not provide the WPS-REST interface.


Customizing the Component
-------------------------

- Edit ``env.local`` (a copy of `env.local.example`_)

- Optionally, set any additional environment variable overrides amongst values defined in `weaver/default.env`_.

- Optionally, mount any additional `Weaver`_-specific configuration files
(see contents of ``birdhouse/components/weaver/config/weaver``) if extended functionalities need to be defined.
Further ``docker-compose-extra.yml`` could be needed to define
any other ``volumes`` entries where these component would need to be mounted to.



.. _finch: https://github.com/bird-house/finch
.. _flyingpigeon: https://github.com/bird-house/flyingpigeon
.. _Weaver: https://github.com/crim-ca/weaver
.. _Weaver OpenAPI: https://pavics-weaver.readthedocs.io/en/latest/api.html
.. _weaver/default.env: ./weaver/default.env
.. _OGC API - Processes: https://github.com/opengeospatial/ogcapi-processes
.. _env.local.example: ../env.local.example
.. _fix-write-perm: ../deployment/fix-write-perm
.. _deploy.sh: ../deployment/deploy.sh
Expand Down
2 changes: 1 addition & 1 deletion birdhouse/components/monitoring/docker-compose-extra.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '2.1'
version: "3.4"

services:
# https://github.com/google/cadvisor/blob/master/docs/running.md
Expand Down
2 changes: 1 addition & 1 deletion birdhouse/components/scheduler/docker-compose-extra.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '2.1'
version: "3.4"

services:
scheduler:
Expand Down
6 changes: 6 additions & 0 deletions birdhouse/components/weaver/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
conf.extra-service.d/weaver.conf
config/magpie/config.yml
config/weaver/data_sources.json
config/weaver/request_options.yml
config/weaver/wps_processes.yml
config/weaver/weaver.ini
25 changes: 25 additions & 0 deletions birdhouse/components/weaver/conf.extra-service.d/weaver.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

fmigneault marked this conversation as resolved.
Show resolved Hide resolved
# NOTE:
# Redirect to internal network of twitcher with Weaver root endpoint and alias allows to set
# the same 'magpie' permissions on the 'weaver' service defined by "WEAVER_MANAGER_NAME".
# This allows verification of the same service user/group permissions references regardless
# whether the *shortcut* Weaver endpoint, the alias or the explicit 'twitcher' proxy route is used.
# redirect EMS/ADES to actual secured Weaver path
#location /EMS {
# return 302 https://localhost/twitcher/ows/proxy/weaver;
#}

location /weaver {
proxy_pass https://localhost/twitcher/ows/proxy/weaver;
proxy_set_header Host $host;
proxy_buffering off;
include /etc/nginx/conf.d/cors.include;
}

# NOTE:
# this is needed only if not using the location already provided by the core configuration
# see 'birdhouse/config/proxy/conf.d/all-services.include.template'
# location where process job outputs will be accessible
#location ^~ /wpsoutputs/weaver/ {
# alias /data/daccs/wps_outputs/weaver/;
#}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# NOTE:
# Redirect to internal network of twitcher with Weaver root endpoint and alias allows to set
# the same 'magpie' permissions on the 'weaver' service defined by "WEAVER_MANAGER_NAME".
# This allows verification of the same service user/group permissions references regardless
# whether the *shortcut* Weaver endpoint, the alias or the explicit 'twitcher' proxy route is used.
# redirect EMS/ADES to actual secured Weaver path
#location /${WEAVER_CONFIG} {
# return 302 https://${PAVICS_FQDN_PUBLIC}${TWITCHER_PROTECTED_PATH}/${WEAVER_MANAGER_NAME};
#}

location /${WEAVER_MANAGER_NAME} {
proxy_pass https://${PAVICS_FQDN_PUBLIC}${TWITCHER_PROTECTED_PATH}/${WEAVER_MANAGER_NAME};
proxy_set_header Host $host;
proxy_buffering off;
include /etc/nginx/conf.d/cors.include;
}

# NOTE:
# this is needed only if not using the location already provided by the core configuration
# see 'birdhouse/config/proxy/conf.d/all-services.include.template'
# location where process job outputs will be accessible
#location ^~ ${WEAVER_WPS_OUTPUTS_PATH}/ {
# alias ${WEAVER_WPS_OUTPUTS_DIR}/;
#}
106 changes: 106 additions & 0 deletions birdhouse/components/weaver/config/magpie/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
## see reference example for details:
fmigneault marked this conversation as resolved.
Show resolved Hide resolved
# https://github.com/Ouranosinc/Magpie/blob/master/config/config.yml

providers:
# definition of Weaver service
weaver:
url: http://localhost:4001
title: Weaver (EMS)
public: true
c4i: false
type: api
sync_type: api

# FIXME: remove when https://github.com/Ouranosinc/Magpie/issues/360 implemented, see 'default.env'
weaver-wps:
url: http://localhost:4001/wps
title: Weaver (WPS)
public: true
c4i: false
type: wps
sync_type: wps

permissions:
# Entrypoint
- service: weaver
permission: read-match
group: anonymous
action: create

# OpenAPI JSON schema
- service: weaver
resource: /json
permission: read
group: anonymous
action: create

# OpenAPI Swagger
- service: weaver
resource: /api
permission: read
group: anonymous
action: create

# Process deploy/listing (builtin/deployed processes)
- service: weaver
resource: /processes # GET is processes listing, POST is deploy: only allow view by anonymous
permission: read # under '/processes/...', JSON 'DescribeProcess', POST job submit, GET results, etc.
group: anonymous
action: create

# Providers listing
- service: weaver
resource: /providers
permission: read-match
group: anonymous
action: create

# Provider processes listing
# (each provider in './components/weaver/config/weaver/wps_processes.yml.template')
# catalog
- service: weaver
resource: /providers/catalog
permission: read
group: anonymous
action: create
# finch
- service: weaver
resource: /providers/finch
permission: read
group: anonymous
action: create
# flyingpigeon
- service: weaver
resource: /providers/flyingpigeon
permission: read
group: anonymous
action: create
# hummingbird
- service: weaver
resource: /providers/hummingbird
permission: read
group: anonymous
action: create
# malleefowl
- service: weaver
resource: /providers/malleefowl
permission: read
group: anonymous
action: create
# raven
- service: weaver
resource: /providers/raven
permission: read
group: anonymous
action: create

# FIXME: remove when https://github.com/Ouranosinc/Magpie/issues/360 implemented
# for the moment, align WPS processes to allow public GetCapabilities and DescribeProcess like REST endpoint does
- service: weaver-wps
permission: getcapabilities
group: anonymous
action: create
- service: weaver-wps
permission: describeprocess
group: anonymous
action: create
Loading