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

Geoserver: protect web interface and ows routes behind magpie/twitcher #348

Merged
merged 20 commits into from
Nov 1, 2023

Conversation

mishaschwartz
Copy link
Collaborator

@mishaschwartz mishaschwartz commented Jun 16, 2023

Overview

Geoserver: protect web interface and ows routes behind magpie/twitcher

Updates Magpie version to 3.35.0 in order to take advantage of updated Geoserver Service.

The geoserverwms Magpie service is now deprecated. If a deployment is currently using this service, it is highly recommended that the permissions are transferred from the deprecated geoserverwms service to the geoserver service.

The /geoserver endpoint is now protected by default. If a deployment currently assumes open access to Geoserver and would like to keep the same permissions after upgrading to this version, please update the permissions for the geoserver service in Magpie to allow the anonymous group access.

A Magpie service named geoserver with type wfs exists already and must be manually deleted before the new Magpie service created here can take effect.

The optional-components/all-public-access component provides full access to the geoserver service for the anonymous group in Magpie. Please note that this includes some permissions that will allow anonymous users to perform destructive operations. Because of this, please remember that enabling the optional-components/all-public-access component is not recommended in a production environment.

Introduces the GEOSERVER_SKIP_AUTH environment variable. If set to True, then requests to the geoserver endpoint will not be authorized through twitcher/magpie at all. This is not recommended at all. However, it will slightly improve performance when accessing geoserver endpoints.

Changes

Non-breaking changes

In order to provide public access to geoserver by default now, the all-public-access optional component must be enabled

Breaking changes

The current wfs Magpie service named geoserver must be deleted before the change here can take effect.

Related Issue / Discussion

Additional Information

@github-actions github-actions bot added component/geoserver Related to GeoServer or one of its underlying services component/magpie Related to https://github.com/Ouranosinc/Magpie documentation Improvements or additions to documentation labels Jun 16, 2023
@crim-jenkins-bot
Copy link
Collaborator

E2E Test Results

DACCS-iac Pipeline Results

Build URL : http://daccs-jenkins.crim.ca:80/job/DACCS-iac-birdhouse/1682/
Result : failure

BIRDHOUSE_DEPLOY_BRANCH : geoserver-behind-twitcher
DACCS_CONFIGS_BRANCH : master
PAVICS_E2E_WORKFLOW_TESTS_BRANCH : master
PAVICS_SDI_BRANCH : master

DESTROY_INFRA_ON_EXIT : true
PAVICS_HOST : https://host-140-154.rdext.crim.ca

PAVICS-e2e-workflow-tests Pipeline Results

Tests URL : http://daccs-jenkins.crim.ca:80/job/PAVICS-e2e-workflow-tests/job/master/1199/

NOTEBOOK TEST RESULTS
    
[2023-06-16T16:29:53.910Z] ============================= test session starts ==============================
[2023-06-16T16:29:53.910Z] platform linux -- Python 3.9.16, pytest-7.3.1, pluggy-1.0.0
[2023-06-16T16:29:53.910Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2023-06-16T16:29:53.910Z] plugins: anyio-3.6.1, dash-2.10.0, nbval-0.9.6, tornasync-0.6.0.post2, xdist-3.3.1
[2023-06-16T16:29:53.910Z] collected 245 items
[2023-06-16T16:29:53.910Z] 
[2023-06-16T16:30:02.655Z] notebooks-auth/test_thredds.ipynb ...........                            [  4%]
[2023-06-16T16:30:12.203Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb .......        [  7%]
[2023-06-16T16:30:24.139Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb ......         [  9%]
[2023-06-16T16:30:32.336Z] pavics-sdi-master/docs/source/notebooks/WMS_example.ipynb ........       [ 13%]
[2023-06-16T16:30:34.888Z] pavics-sdi-master/docs/source/notebooks/WPS_example.ipynb ..........     [ 17%]
[2023-06-16T16:37:56.595Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb ............        [ 22%]
[2023-06-16T16:37:56.596Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 22%]
[2023-06-16T16:38:04.759Z] ...............                                                          [ 28%]
[2023-06-16T16:38:13.639Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 30%]
[2023-06-16T16:38:20.943Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb .....F            [ 33%]
[2023-06-16T16:38:36.148Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 35%]
[2023-06-16T16:38:37.535Z] pavics-sdi-master/docs/source/notebooks/jupyter_extensions.ipynb .       [ 35%]
[2023-06-16T16:38:41.965Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 38%]
[2023-06-16T16:38:46.475Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb .....       [ 40%]
[2023-06-16T16:42:12.150Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 46%]
[2023-06-16T16:43:21.984Z] .............                                                            [ 52%]
[2023-06-16T16:43:26.072Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 53%]
[2023-06-16T16:43:28.206Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 57%]
[2023-06-16T16:43:44.467Z] .................                                                        [ 64%]
[2023-06-16T16:43:51.345Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb .....           [ 66%]
[2023-06-16T16:43:52.732Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 66%]
[2023-06-16T16:44:02.703Z] .FF......                                                                [ 70%]
[2023-06-16T16:44:13.345Z] finch-master/docs/source/notebooks/dap_subset.ipynb ...........          [ 74%]
[2023-06-16T16:44:22.328Z] finch-master/docs/source/notebooks/finch-usage.ipynb ......              [ 77%]
[2023-06-16T16:44:24.255Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 77%]
[2023-06-16T16:44:27.061Z] ......                                                                   [ 80%]
[2023-06-16T16:44:35.193Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 80%]
[2023-06-16T16:44:51.133Z] .............                                                            [ 85%]
[2023-06-16T16:45:01.131Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 86%]
[2023-06-16T16:45:52.884Z] ....s.                                                                   [ 88%]
[2023-06-16T16:46:01.010Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 88%]
[2023-06-16T16:46:13.531Z] ...                                                                      [ 90%]
[2023-06-16T16:46:25.758Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 90%]
[2023-06-16T16:46:47.794Z] ......                                                                   [ 93%]
[2023-06-16T16:46:50.482Z] notebooks/hummingbird.ipynb ............                                 [ 97%]
[2023-06-16T16:49:45.357Z] notebooks/stress-tests.ipynb .....                                       [100%]
[2023-06-16T16:49:45.357Z] 
[2023-06-16T16:49:45.357Z] =================================== FAILURES ===================================
    
  

Copy link
Collaborator

@fmigneault fmigneault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the right approach.
Although this looks to work, it is very hackish and does not handle all use cases.

For example, the WPS endpoint can be accessed in multiple ways:
https://pavics.ouranos.ca/geoserver/ows?request=GetCapabilities&service=wps
https://pavics.ouranos.ca/geoserver/wps?request=GetCapabilities
Same for all other W*[X]*S variants:
https://pavics.ouranos.ca/geoserver/wms?request=GetCapabilities
https://pavics.ouranos.ca/geoserver/ows?request=GetCapabilities&service=wms

This does not include also the upcoming OGC API endpoints:
/geoserver/ogc/features/...
/geoserver/ogc/maps/...
etc.

Using different services causes a lot of permission duplication across the endpoints, which will cause access errors. Instead the Magpie implementation should be updated to handle the /web/ endpoint accordingly:

https://github.com/Ouranosinc/Magpie/blob/f9b00c6142372aff96fd0edf0537c8b383fd5ee9/magpie/services.py#L1475-L1488

@mishaschwartz
Copy link
Collaborator Author

Instead the Magpie implementation should be updated to handle the /web/ endpoint accordingly

Is this a change you already have proposed for Magpie or should I add an issue for it?

@mishaschwartz
Copy link
Collaborator Author

mishaschwartz commented Jun 20, 2023

@fmigneault

What if we flipped the nginx conf for now:

    location /geoserver/ {
        proxy_pass http://${PAVICS_FQDN}${TWITCHER_PROTECTED_PATH}/geoserver-ows/;
        ....
    }

    location /geoserver/web/ {
        proxy_pass http://${PAVICS_FQDN}${TWITCHER_PROTECTED_PATH}/geoserver-web/;
        ....

That way we can accommodate the wms/, wps/, ogc/ routes all together and the web/ routes will be the exception.

Then when magpie catches up we can put it back under one magpie service definition

@fmigneault
Copy link
Collaborator

Is this a change you already have proposed for Magpie or should I add an issue for it?

You can add it. It was not already planned. It should be fairly easy to extend the existing class using ServiceAPI.

@fmigneault
Copy link
Collaborator

fmigneault commented Jun 21, 2023

location /geoserver/web/ {
        proxy_pass http://${PAVICS_FQDN}${TWITCHER_PROTECTED_PATH}/geoserver-web/;

This can potentially completely open GeoServer if the admin adds the read permission at the top level thinking they want to make only the /web part accessible, while they are unaware that what happens is in fact that all GeoServer is available since it is the same service behind the scene.
Someone could still call https://${PAVICS_FQDN}${TWITCHER_PROTECTED_PATH}/geoserver-web/ows/... manually.

To properly configure it for web-only access, they need to actually create a /web resource under geoserver-web, make it read, and leave the top level access without permission.
And to access the web part, you would actually need to call https://${PAVICS_FQDN_PUBLIC}/geoserver/web/web/ which is odd.

It is possible to do workarounds, but I think this causes more confusion than fixing the missing implementation on the Magpie side.

@@ -1,5 +1,16 @@
location /geoserver/ {
proxy_pass http://${PAVICS_FQDN}:8087;
proxy_pass http://${PAVICS_FQDN}${TWITCHER_PROTECTED_PATH}/geoserver-web/;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be easy to have a toogle to disable this? Meaning a toogle to restore the original proxy config to not go through Twitcher?

@crim-jenkins-bot
Copy link
Collaborator

E2E Test Results

DACCS-iac Pipeline Results

Build URL : http://daccs-jenkins.crim.ca:80/job/DACCS-iac-birdhouse/1877/
Result : failure

BIRDHOUSE_DEPLOY_BRANCH : geoserver-behind-twitcher
DACCS_CONFIGS_BRANCH : master
PAVICS_E2E_WORKFLOW_TESTS_BRANCH : master
PAVICS_SDI_BRANCH : master

DESTROY_INFRA_ON_EXIT : true
PAVICS_HOST : https://host-140-35.rdext.crim.ca

PAVICS-e2e-workflow-tests Pipeline Results

Tests URL : http://daccs-jenkins.crim.ca:80/job/PAVICS-e2e-workflow-tests/job/master/1230/

NOTEBOOK TEST RESULTS
    
[2023-07-25T20:12:18.072Z] ============================= test session starts ==============================
[2023-07-25T20:12:18.072Z] platform linux -- Python 3.9.16, pytest-7.3.1, pluggy-1.0.0
[2023-07-25T20:12:18.072Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2023-07-25T20:12:18.073Z] plugins: anyio-3.6.1, dash-2.10.0, nbval-0.9.6, tornasync-0.6.0.post2, xdist-3.3.1
[2023-07-25T20:12:18.073Z] collected 236 items
[2023-07-25T20:12:18.073Z] 
[2023-07-25T20:12:27.047Z] notebooks-auth/test_thredds.ipynb ...........                            [  4%]
[2023-07-25T20:12:32.629Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb .FFFFF.        [  7%]
[2023-07-25T20:12:40.766Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb ......         [ 10%]
[2023-07-25T20:12:49.277Z] pavics-sdi-master/docs/source/notebooks/WMS_example.ipynb ........       [ 13%]
[2023-07-25T20:20:44.829Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb ............        [ 18%]
[2023-07-25T20:20:44.829Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 19%]
[2023-07-25T20:20:51.607Z] ...............                                                          [ 25%]
[2023-07-25T20:21:00.758Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 27%]
[2023-07-25T20:21:07.542Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb ......            [ 30%]
[2023-07-25T20:21:23.017Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 32%]
[2023-07-25T20:21:24.406Z] pavics-sdi-master/docs/source/notebooks/jupyter_extensions.ipynb .       [ 33%]
[2023-07-25T20:21:29.315Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 36%]
[2023-07-25T20:21:34.009Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb .....       [ 38%]
[2023-07-25T20:26:45.489Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 44%]
[2023-07-25T20:28:01.810Z] .............                                                            [ 50%]
[2023-07-25T20:28:03.784Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 51%]
[2023-07-25T20:28:08.413Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 55%]
[2023-07-25T20:28:27.651Z] .................                                                        [ 62%]
[2023-07-25T20:28:34.623Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb ....F.          [ 64%]
[2023-07-25T20:28:36.008Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 65%]
[2023-07-25T20:28:39.993Z] .FFFFFFFF                                                                [ 69%]
[2023-07-25T20:28:51.154Z] finch-master/docs/source/notebooks/dap_subset.ipynb ...........          [ 73%]
[2023-07-25T20:29:00.503Z] finch-master/docs/source/notebooks/finch-usage.ipynb ......              [ 76%]
[2023-07-25T20:29:01.890Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 76%]
[2023-07-25T20:29:04.944Z] ......                                                                   [ 79%]
[2023-07-25T20:29:13.067Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 79%]
[2023-07-25T20:29:29.087Z] .............                                                            [ 85%]
[2023-07-25T20:29:39.086Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 85%]
[2023-07-25T20:30:15.639Z] ....s.                                                                   [ 88%]
[2023-07-25T20:30:25.628Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 88%]
[2023-07-25T20:30:40.390Z] ...                                                                      [ 89%]
[2023-07-25T20:30:52.632Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 90%]
[2023-07-25T20:31:15.516Z] ......                                                                   [ 92%]
[2023-07-25T20:31:19.965Z] notebooks/hummingbird.ipynb ............                                 [ 97%]
[2023-07-25T20:34:24.655Z] notebooks/stress-tests.ipynb .....                                       [100%]
[2023-07-25T20:34:24.655Z] 
[2023-07-25T20:34:24.655Z] =================================== FAILURES ===================================
    
  

@fmigneault
Copy link
Collaborator

Maggie https://github.com/Ouranosinc/Magpie/releases/tag/3.35.0 is released with the relevant functionality.

@crim-jenkins-bot
Copy link
Collaborator

E2E Test Results

DACCS-iac Pipeline Results

Build URL : http://daccs-jenkins.crim.ca:80/job/DACCS-iac-birdhouse/2058/
Result : failure

BIRDHOUSE_DEPLOY_BRANCH : geoserver-behind-twitcher
DACCS_CONFIGS_BRANCH : master
PAVICS_E2E_WORKFLOW_TESTS_BRANCH : master
PAVICS_SDI_BRANCH : master

DESTROY_INFRA_ON_EXIT : true
PAVICS_HOST : https://host-140-216.rdext.crim.ca

PAVICS-e2e-workflow-tests Pipeline Results

Tests URL : http://daccs-jenkins.crim.ca:80/job/PAVICS-e2e-workflow-tests/job/master/1305/

NOTEBOOK TEST RESULTS
    
[2023-09-14T18:21:13.404Z] ============================= test session starts ==============================
[2023-09-14T18:21:13.404Z] platform linux -- Python 3.9.16, pytest-7.3.1, pluggy-1.0.0
[2023-09-14T18:21:13.404Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2023-09-14T18:21:13.404Z] plugins: anyio-3.6.1, dash-2.10.0, nbval-0.9.6, tornasync-0.6.0.post2, xdist-3.3.1
[2023-09-14T18:21:13.404Z] collected 237 items
[2023-09-14T18:21:13.404Z] 
[2023-09-14T18:21:20.824Z] notebooks-auth/test_thredds.ipynb ...........                            [  4%]
[2023-09-14T18:21:33.105Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb .......        [  7%]
[2023-09-14T18:21:43.183Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb ......         [ 10%]
[2023-09-14T18:21:51.835Z] pavics-sdi-master/docs/source/notebooks/WMS_example.ipynb .F......       [ 13%]
[2023-09-14T18:29:20.787Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb ............        [ 18%]
[2023-09-14T18:29:21.355Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 18%]
[2023-09-14T18:29:29.392Z] ...............                                                          [ 25%]
[2023-09-14T18:29:37.813Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 27%]
[2023-09-14T18:29:44.746Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb ......            [ 29%]
[2023-09-14T18:30:00.653Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 32%]
[2023-09-14T18:30:02.038Z] pavics-sdi-master/docs/source/notebooks/jupyter_extensions.ipynb .       [ 32%]
[2023-09-14T18:30:15.168Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 35%]
[2023-09-14T18:30:19.133Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb .....       [ 37%]
[2023-09-14T18:30:24.683Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb EEEEEEEEEEEEEEE [ 44%]
[2023-09-14T18:30:32.924Z] EEEEEEEEEEEEE                                                            [ 49%]
[2023-09-14T18:30:37.124Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 51%]
[2023-09-14T18:30:39.439Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 54%]
[2023-09-14T18:30:56.308Z] .................                                                        [ 62%]
[2023-09-14T18:31:03.250Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb ......          [ 64%]
[2023-09-14T18:31:04.644Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 64%]
[2023-09-14T18:31:12.977Z] .........                                                                [ 68%]
[2023-09-14T18:31:23.861Z] finch-master/docs/source/notebooks/dap_subset.ipynb ...........          [ 73%]
[2023-09-14T18:31:32.604Z] finch-master/docs/source/notebooks/finch-usage.ipynb ......              [ 75%]
[2023-09-14T18:31:33.995Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 76%]
[2023-09-14T18:31:37.063Z] ......                                                                   [ 78%]
[2023-09-14T18:31:43.655Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 79%]
[2023-09-14T18:31:59.199Z] .............                                                            [ 84%]
[2023-09-14T18:32:09.203Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 85%]
[2023-09-14T18:32:44.568Z] ....s.                                                                   [ 87%]
[2023-09-14T18:32:52.705Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 88%]
[2023-09-14T18:33:08.327Z] ...                                                                      [ 89%]
[2023-09-14T18:33:23.237Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 89%]
[2023-09-14T18:33:45.459Z] ......                                                                   [ 92%]
[2023-09-14T18:33:46.766Z] notebooks/hummingbird.ipynb ............                                 [ 97%]
[2023-09-14T18:36:20.944Z] notebooks/stress-tests.ipynb ......                                      [100%]
[2023-09-14T18:36:20.944Z] 
[2023-09-14T18:36:20.944Z] ==================================== ERRORS ====================================
    
  

@crim-jenkins-bot
Copy link
Collaborator

E2E Test Results

DACCS-iac Pipeline Results

Build URL : http://daccs-jenkins.crim.ca:80/job/DACCS-iac-birdhouse/2059/
Result : failure

BIRDHOUSE_DEPLOY_BRANCH : geoserver-behind-twitcher
DACCS_CONFIGS_BRANCH : master
PAVICS_E2E_WORKFLOW_TESTS_BRANCH : master
PAVICS_SDI_BRANCH : master

DESTROY_INFRA_ON_EXIT : true
PAVICS_HOST : https://host-140-216.rdext.crim.ca

PAVICS-e2e-workflow-tests Pipeline Results

Tests URL : http://daccs-jenkins.crim.ca:80/job/PAVICS-e2e-workflow-tests/job/master/1306/

NOTEBOOK TEST RESULTS
    
[2023-09-14T20:03:41.873Z] ============================= test session starts ==============================
[2023-09-14T20:03:41.873Z] platform linux -- Python 3.9.16, pytest-7.3.1, pluggy-1.0.0
[2023-09-14T20:03:41.873Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2023-09-14T20:03:41.873Z] plugins: anyio-3.6.1, dash-2.10.0, nbval-0.9.6, tornasync-0.6.0.post2, xdist-3.3.1
[2023-09-14T20:03:41.873Z] collected 237 items
[2023-09-14T20:03:41.873Z] 
[2023-09-14T20:03:49.787Z] notebooks-auth/test_thredds.ipynb ...........                            [  4%]
[2023-09-14T20:03:58.844Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb .......        [  7%]
[2023-09-14T20:04:07.265Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb ......         [ 10%]
[2023-09-14T20:04:15.735Z] pavics-sdi-master/docs/source/notebooks/WMS_example.ipynb .F......       [ 13%]
[2023-09-14T20:11:53.837Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb ............        [ 18%]
[2023-09-14T20:11:53.837Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 18%]
[2023-09-14T20:12:00.928Z] ...............                                                          [ 25%]
[2023-09-14T20:12:09.017Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 27%]
[2023-09-14T20:12:15.928Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb ......            [ 29%]
[2023-09-14T20:12:31.104Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 32%]
[2023-09-14T20:12:32.488Z] pavics-sdi-master/docs/source/notebooks/jupyter_extensions.ipynb .       [ 32%]
[2023-09-14T20:12:38.769Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 35%]
[2023-09-14T20:12:43.026Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb .....       [ 37%]
[2023-09-14T20:16:08.274Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 44%]
[2023-09-14T20:17:21.489Z] .............                                                            [ 49%]
[2023-09-14T20:17:22.955Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 51%]
[2023-09-14T20:17:24.906Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 54%]
[2023-09-14T20:17:41.706Z] .................                                                        [ 62%]
[2023-09-14T20:17:48.334Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb ......          [ 64%]
[2023-09-14T20:17:49.723Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 64%]
[2023-09-14T20:17:57.964Z] .........                                                                [ 68%]
[2023-09-14T20:18:08.099Z] finch-master/docs/source/notebooks/dap_subset.ipynb ...........          [ 73%]
[2023-09-14T20:18:16.816Z] finch-master/docs/source/notebooks/finch-usage.ipynb ......              [ 75%]
[2023-09-14T20:18:18.197Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 76%]
[2023-09-14T20:18:21.258Z] ......                                                                   [ 78%]
[2023-09-14T20:18:27.857Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 79%]
[2023-09-14T20:18:43.127Z] .............                                                            [ 84%]
[2023-09-14T20:18:53.126Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 85%]
[2023-09-14T20:19:27.647Z] ....s.                                                                   [ 87%]
[2023-09-14T20:19:35.790Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 88%]
[2023-09-14T20:19:50.533Z] ...                                                                      [ 89%]
[2023-09-14T20:20:02.772Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 89%]
[2023-09-14T20:20:24.274Z] ......                                                                   [ 92%]
[2023-09-14T20:20:26.555Z] notebooks/hummingbird.ipynb ............                                 [ 97%]
[2023-09-14T20:23:00.675Z] notebooks/stress-tests.ipynb ......                                      [100%]
[2023-09-14T20:23:00.675Z] 
[2023-09-14T20:23:00.675Z] =================================== FAILURES ===================================
    
  

Comment on lines 3 to 4
resource: /
type: route
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not necessary, or might cause a problem. At this / level, the type is the service itself, not a nested route.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. I don't think I understood how to set this properly with the new geoserver. Do you mind pointing me to the documentation or an example please

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resource field is needed mostly when applying a permission on a child resource under the service. Since the permission is applied directly on the service such that it applies for all its children, the resource shouldn't be needed.
The config might be completely valid, I just don't remember if Magpie code handled the / correctly to resolve as the service. If it does, it's good to leave the config as is.

CHANGES.md Outdated
## Changes
- Geoserver: protect web interface and ows routes behind magpie/twitcher

Updates Magpie version to 3.35.0 in order to take advantage of the updated Geoserver Service.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the tag link [3.35.0](https://github.com/Ouranosinc/Magpie/tree/3.35.0)

CHANGES.md Outdated
Comment on lines 19 to 23
- Geoserver: protect web interface and ows routes behind magpie/twitcher

Updates Magpie version to 3.35.0 in order to take advantage of the updated Geoserver Service.

See https://github.com/bird-house/birdhouse-deploy/issues/333 for details.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a bit more verbose about the "potentially breaking" changes:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I can add some of these as warnings.

makes optional-components/test-geoserver-secured-access deprecated and geoserver-secured endpoint and service deprecated as well

If these are now deprecated, I could move them to the deprecated-components directory as part of this PR. What would you suggest @fmigneault

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that would be good. Thank you.

Comment on lines 44 to 47
- service: geoserver
permission: describeprocess
group: anonymous
action: create
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not relevant if wps: false. Same as other comment.

Comment on lines 28 to 31
- service: geoserver
permission: execute
group: anonymous
action: create
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not relevant if wps: false.
I don't think it would break, so can be left there with a comment regarding wps option for reference.

@fmigneault
Copy link
Collaborator

  1. complains that a resource with that name already exists and does not create it at all

It should update the wfs for the geoserver definition.
The code path at startup should be:

If this is not what happens, I would need further logs to investigate.

  1. Permissions that are currently set for groups and users for the geoserver (type = wfs) and geoserverwms services are not translated over to the new geoserver service

That is correct. Magpie will not merge services together. This must be done manually.

Steps should be (pseudo SQL, don't use directly):

  1. UPDATE services WHERE type = 'wfs' SET url = 'http://geoserver:8080/geoserver/', type = 'geoserver'
    (probably need a filter for resources.resource_name = 'geoserver' as well).
    Here I recommend http://geoserver:8080/geoserver/ instead of http://proxy:80 to allow using /twitcher/ows/proxy if we ever want to. There's no need to force http://proxy:80 to make use of /twitcher/ows/verify.
  2. UDPATE resources SET parent_id = <service-geoserver>.resource_id WHERE parent_id = <service-geoserverwms>.resource_id
  3. DELETE FROM resources WHERE resource_id = <service-geoserverwms>.resource_id (cascade should wipe corresponding services entry automatically, otherwise do it manually).

It could be formalized in a specific script.

@mishaschwartz
Copy link
Collaborator Author

Here's the relevant section of the Magpie logs:

[2023-10-03 16:46:11,894] WARNING    [MainThread][magpie.register] Services configuration are empty.
[2023-10-03 16:46:11,925] INFO       [MainThread][magpie.register] Service URL already properly set [http://cowbird:7000] (cowbird)
[2023-10-03 16:46:11,927] INFO       [MainThread][magpie.register] Service URL already properly set [http://finch:5000/wps] (finch)
[2023-10-03 16:46:11,929] INFO       [MainThread][magpie.register] Service URL update [http://geoserver:8080/geoserver] => [http://proxy:80] (geoserver)
[2023-10-03 16:46:11,933] INFO       [MainThread][magpie.register] Service URL already properly set [http://hummingbird:8080/wps] (hummingbird)
[2023-10-03 16:46:11,934] INFO       [MainThread][magpie.register] Service URL already properly set [http://raven:9099/wps] (raven)
[2023-10-03 16:46:11,936] INFO       [MainThread][magpie.register] Service URL already properly set [http://proxy:80] (secure-data-proxy)
[2023-10-03 16:46:11,944] INFO       [MainThread][magpie.register] Service URL already properly set [http://stac:8000] (stac)
[2023-10-03 16:46:11,946] INFO       [MainThread][magpie.register] Service URL already properly set [http://geoserver:8080/geoserver] (geoserver-secured)
[2023-10-03 16:46:11,947] INFO       [MainThread][magpie.register] Service URL already properly set [http://thredds:8080/twitcher/ows/proxy/thredds] (thredds)
[2023-10-03 16:46:11,950] INFO       [MainThread][magpie.register] All services processed.

The URL for the geoserver (type = wfs) is updated but the actual "type" is not updated. Since Magpie thinks that it has processed the changes for this provider, it doesn't create a new service with type = geoserver or update to current service to type = geoserver.

I think that we're missing a line like:

svc.type = svc_type

here: https://github.com/Ouranosinc/Magpie/blob/1d602eedbe4047fd95c4d2684b5731f4d0600977/magpie/register.py#L496-L500

@fmigneault
Copy link
Collaborator

@mishaschwartz
Indeed. It's missing svc.type. I misread svc.sync_type and had in mind the type was updated as well.

@mishaschwartz
Copy link
Collaborator Author

Indeed. It's missing svc.type. I misread svc.sync_type and had in mind the type was updated as well.

Ok cool. Should we update that on the Magpie side then? This PR can wait until Magpie has been updated

@fmigneault
Copy link
Collaborator

@fmigneault
Copy link
Collaborator

https://github.com/Ouranosinc/Magpie/tree/3.36.0 pushed. The docker image should be ready in ~10min.

@mishaschwartz
Copy link
Collaborator Author

@fmigneault I've bumped the magpie version so that the service type will be updated nicely.

With this update, we still need to manually do steps 2 and 3 from here first right? #348 (comment)

@crim-jenkins-bot
Copy link
Collaborator

E2E Test Results

DACCS-iac Pipeline Results

Build URL : http://daccs-jenkins.crim.ca:80/job/DACCS-iac-birdhouse/2151/
Result : failure

BIRDHOUSE_DEPLOY_BRANCH : geoserver-behind-twitcher
DACCS_CONFIGS_BRANCH : master
PAVICS_E2E_WORKFLOW_TESTS_BRANCH : master
PAVICS_SDI_BRANCH : master

DESTROY_INFRA_ON_EXIT : true
PAVICS_HOST : https://host-140-118.rdext.crim.ca

PAVICS-e2e-workflow-tests Pipeline Results

Tests URL : http://daccs-jenkins.crim.ca:80/job/PAVICS-e2e-workflow-tests/job/master/1363/

NOTEBOOK TEST RESULTS
    
[2023-10-10T18:18:46.273Z] ============================= test session starts ==============================
[2023-10-10T18:18:46.273Z] platform linux -- Python 3.9.16, pytest-7.3.1, pluggy-1.0.0
[2023-10-10T18:18:46.273Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2023-10-10T18:18:46.273Z] plugins: anyio-3.6.1, dash-2.10.0, nbval-0.9.6, tornasync-0.6.0.post2, xdist-3.3.1
[2023-10-10T18:18:46.273Z] collected 254 items
[2023-10-10T18:18:46.273Z] 
[2023-10-10T18:18:54.044Z] notebooks-auth/geoserver.ipynb .....FFFF....FFF.                         [  6%]
[2023-10-10T18:19:02.184Z] notebooks-auth/test_thredds.ipynb ...........                            [ 11%]
[2023-10-10T18:19:10.411Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb .......        [ 13%]
[2023-10-10T18:19:20.764Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb ......         [ 16%]
[2023-10-10T18:19:32.210Z] pavics-sdi-master/docs/source/notebooks/WMS_example.ipynb .F......       [ 19%]
[2023-10-10T18:27:21.868Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb ............        [ 24%]
[2023-10-10T18:27:21.868Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 24%]
[2023-10-10T18:27:29.264Z] ...............                                                          [ 30%]
[2023-10-10T18:27:39.362Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb F.F..    [ 32%]
[2023-10-10T18:27:47.856Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb ......            [ 34%]
[2023-10-10T18:28:04.623Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 37%]
[2023-10-10T18:28:06.006Z] pavics-sdi-master/docs/source/notebooks/jupyter_extensions.ipynb .       [ 37%]
[2023-10-10T18:28:13.674Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 40%]
[2023-10-10T18:28:18.196Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb .....       [ 42%]
[2023-10-10T18:33:16.958Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 48%]
[2023-10-10T18:34:28.221Z] .............                                                            [ 53%]
[2023-10-10T18:34:32.427Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 54%]
[2023-10-10T18:34:34.758Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 57%]
[2023-10-10T18:34:52.035Z] .................                                                        [ 64%]
[2023-10-10T18:34:59.047Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb ......          [ 66%]
[2023-10-10T18:35:00.429Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 67%]
[2023-10-10T18:35:16.082Z] .........                                                                [ 70%]
[2023-10-10T18:35:26.104Z] finch-master/docs/source/notebooks/dap_subset.ipynb ...........          [ 75%]
[2023-10-10T18:35:34.841Z] finch-master/docs/source/notebooks/finch-usage.ipynb ......              [ 77%]
[2023-10-10T18:35:36.221Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 77%]
[2023-10-10T18:35:39.301Z] ......                                                                   [ 80%]
[2023-10-10T18:35:45.890Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 80%]
[2023-10-10T18:36:00.630Z] .............                                                            [ 85%]
[2023-10-10T18:36:10.633Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 86%]
[2023-10-10T18:36:44.509Z] ....s.                                                                   [ 88%]
[2023-10-10T18:36:52.662Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 88%]
[2023-10-10T18:37:05.195Z] ...                                                                      [ 90%]
[2023-10-10T18:37:17.434Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 90%]
[2023-10-10T18:37:38.856Z] ......                                                                   [ 92%]
[2023-10-10T18:37:41.603Z] notebooks/hummingbird.ipynb ............                                 [ 97%]
[2023-10-10T18:40:30.999Z] notebooks/stress-tests.ipynb ......                                      [100%]
[2023-10-10T18:40:30.999Z] 
[2023-10-10T18:40:30.999Z] =================================== FAILURES ===================================
    
  

@fmigneault
Copy link
Collaborator

fmigneault commented Oct 10, 2023

@mishaschwartz

With this update, we still need to manually do steps 2 and 3 from here first right? #348 (comment)

yes
It could be a script also that does the operation once before magpie boots.

@mishaschwartz
Copy link
Collaborator Author

@tlvu Are you ok with this PR? I'd like to get it merged soon if there's no outstanding changes that need to be made

Copy link
Collaborator

@tlvu tlvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, as long as the new Magpie has no DB upgrade. We have a very old DB in production so we've had many db upgrade problem in the past.

@mishaschwartz
Copy link
Collaborator Author

@tlvu

If you have permissions in magpie set for the geoserverwms service then you'll need to update the database (see #348 (comment) and #348 (comment) for details). Note that this does not require an update to the database schema, you may just need to move some settings around which can be done with the SQL commands that @fmigneault mentions in the comment above or manually through the UI.

@github-actions github-actions bot added the ci/operations Continuous Integration components label Nov 1, 2023
@crim-jenkins-bot
Copy link
Collaborator

E2E Test Results

DACCS-iac Pipeline Results

Build URL : http://daccs-jenkins.crim.ca:80/job/DACCS-iac-birdhouse/2202/
Result : failure

BIRDHOUSE_DEPLOY_BRANCH : geoserver-behind-twitcher
DACCS_CONFIGS_BRANCH : master
PAVICS_E2E_WORKFLOW_TESTS_BRANCH : master
PAVICS_SDI_BRANCH : master

DESTROY_INFRA_ON_EXIT : true
PAVICS_HOST : https://host-140-104.rdext.crim.ca

PAVICS-e2e-workflow-tests Pipeline Results

Tests URL : http://daccs-jenkins.crim.ca:80/job/PAVICS-e2e-workflow-tests/job/master/1390/

NOTEBOOK TEST RESULTS
    
[2023-11-01T13:18:47.831Z] ============================= test session starts ==============================
[2023-11-01T13:18:47.831Z] platform linux -- Python 3.9.16, pytest-7.3.1, pluggy-1.0.0
[2023-11-01T13:18:47.831Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2023-11-01T13:18:47.831Z] plugins: anyio-3.6.1, dash-2.10.0, nbval-0.9.6, tornasync-0.6.0.post2, xdist-3.3.1
[2023-11-01T13:18:47.831Z] collected 254 items
[2023-11-01T13:18:47.831Z] 
[2023-11-01T13:18:56.177Z] notebooks-auth/geoserver.ipynb .....FFFF....FFF.                         [  6%]
[2023-11-01T13:19:03.899Z] notebooks-auth/test_thredds.ipynb ...........                            [ 11%]
[2023-11-01T13:19:11.790Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb .......        [ 13%]
[2023-11-01T13:19:20.077Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb ......         [ 16%]
[2023-11-01T13:19:26.989Z] pavics-sdi-master/docs/source/notebooks/WMS_example.ipynb .F......       [ 19%]
[2023-11-01T13:27:04.710Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb ............        [ 24%]
[2023-11-01T13:27:04.710Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb F [ 24%]
[2023-11-01T13:27:07.425Z] FFFFFFFFFFFFFFF                                                          [ 30%]
[2023-11-01T13:27:14.543Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb F.FFF    [ 32%]
[2023-11-01T13:27:21.309Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb ......            [ 34%]
[2023-11-01T13:27:36.704Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 37%]
[2023-11-01T13:27:38.085Z] pavics-sdi-master/docs/source/notebooks/jupyter_extensions.ipynb .       [ 37%]
[2023-11-01T13:27:44.947Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 40%]
[2023-11-01T13:27:49.703Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb .....       [ 42%]
[2023-11-01T13:31:00.296Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 48%]
[2023-11-01T13:32:14.062Z] .............                                                            [ 53%]
[2023-11-01T13:32:18.564Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 54%]
[2023-11-01T13:32:20.784Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 57%]
[2023-11-01T13:32:36.013Z] .................                                                        [ 64%]
[2023-11-01T13:32:44.076Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb ......          [ 66%]
[2023-11-01T13:32:45.987Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 67%]
[2023-11-01T13:33:09.374Z] ........F                                                                [ 70%]
[2023-11-01T13:33:18.149Z] finch-master/docs/source/notebooks/dap_subset.ipynb ...........          [ 75%]
[2023-11-01T13:33:27.630Z] finch-master/docs/source/notebooks/finch-usage.ipynb ......              [ 77%]
[2023-11-01T13:33:29.010Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 77%]
[2023-11-01T13:33:32.065Z] ......                                                                   [ 80%]
[2023-11-01T13:33:38.644Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 80%]
[2023-11-01T13:33:53.578Z] .............                                                            [ 85%]
[2023-11-01T13:34:03.572Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 86%]
[2023-11-01T13:34:38.810Z] ....s.                                                                   [ 88%]
[2023-11-01T13:34:46.950Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 88%]
[2023-11-01T13:35:01.739Z] ...                                                                      [ 90%]
[2023-11-01T13:35:13.973Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 90%]
[2023-11-01T13:35:35.195Z] ......                                                                   [ 92%]
[2023-11-01T13:35:37.621Z] notebooks/hummingbird.ipynb ............                                 [ 97%]
[2023-11-01T13:38:11.734Z] notebooks/stress-tests.ipynb ......                                      [100%]
[2023-11-01T13:38:11.734Z] 
[2023-11-01T13:38:11.734Z] =================================== FAILURES ===================================
    
  

@mishaschwartz mishaschwartz merged commit 6cf2066 into master Nov 1, 2023
4 of 5 checks passed
@mishaschwartz mishaschwartz deleted the geoserver-behind-twitcher branch November 1, 2023 14:09
fmigneault added a commit that referenced this pull request Nov 3, 2023
…ions (#397)

## Overview

The `type: route` is invalid in that case, because the permission is applied on the service itself (not a child `route` resource). The type should be `service`, but can be omitted when no `resource` is specified, as in the case for all other permissions.

## Changes

**Non-breaking changes**
- Remove erroneous `type: route` for a Magpie permission set directly on the service.

**Breaking changes**
- n/a

## Related Issue / Discussion

- Introduced by #348
## Changes
- Geoserver: protect web interface and ows routes behind magpie/twitcher

Updates Magpie version to [3.35.0](https://github.com/Ouranosinc/Magpie/tree/3.35.0) in order to take advantage of
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops, the actual Magpie in this PR is 3.36 and not 3.35 !

@tlvu
Copy link
Collaborator

tlvu commented Apr 12, 2024

@fmigneault @mishaschwartz

I test deploy this against our Magpie production DB, got the following warning, just want to ensure these are normal and expected:

[2024-04-12 03:31:36,349] WARNING    [MainThread][magpie.register] Service URL update [http://geoserver:8080/geoserver] => [http://proxy:80] (geoserver)
[2024-04-12 03:31:36,350] WARNING    [MainThread][magpie.register] Service type update [wfs] => [geoserver] (geoserver). If children resources/permissions
 are not compatible, this could break the instance.  

@fmigneault
Copy link
Collaborator

@tlvu
Yes. This is intentional. The request to GeoServer should now use Twitcher's /ows/verify as a pre-auth request instead of /ows/proxy request going through Twitcher, which was causing the memory/latency issues.
See:

auth_request /secure-geoserver-auth;
auth_request_set $auth_status $upstream_status;

tlvu added a commit to Ouranosinc/PAVICS-e2e-workflow-tests that referenced this pull request Apr 15, 2024
# Overview

Add a new text box `CONFIG_OVERRIDE_SCRIPT_URL` so we can specify a URL
to a script that can be sourced to alter any configs before starting the
test run.

A sample script is provided to filter the notebooks for testing
GeoServer only. This greatly improve the turn over time by avoiding to
run unrelated notebooks. Was useful to test this PR
bird-house/birdhouse-deploy#348.

This custom script can be coming from any URL and change other configs
than just the list of notebooks to run.

Default is no custom script URL, same as the current behavior.

@fmigneault excellent question:

I'm curious to better understand the use case to see if it is the right
(and only) solution.

The current (CRIM) birdhouse-deploy CI sources the `env.local` file,
starts a test instance with it, and then forwards the env values to the
children Jenkins job for E2E workflow tests. In other words, if a
variable needs to be overridden for tests, it can be set directly in it,
or a custom component can be defined and listed at the end of
`EXTRA_CONF_DIRS`. There is also a `EXTRA_TEST_ENV_VAR` variable for yet
even more additional variables to pass between the test instance
creation and the E2E workflow tests. This is notably useful for manual
test trigger or quick tweaks against some existing branch/config
combination.

Is there no way to use those approaches or accomplish similar behavior
in case another CI (or local test) are used? More specifically, is there
a need for yet another method to override variables?

@tlvu answer:

2 reasons:

1. The existing way via `env.local` only works for CRIM pipeline where
each PAVICS deployment is meant to run only one test run, then the
deployment is discarded.

My test servers are meant for multiple tests configs so I'd rather not
have to change my `env.local` each time and having to restart the stack,
wait for all the compoments to be ready, then launch Jenkins, it's too
slow.

Furthermore, if I want to test against the production instance, I won't
be able to touch the `env.local`.

1. The existing way can only impact "input" configs, not the "resulting"
configs.

The list of notebooks to run is not part of the input, it is calculated
so there is no other way to modify it than to intercept it the way I
did.

I had thought of exposing a big text box to manually specify the list of
notebooks but that is way too cumbersome. Filtering it programmatically
is way more flexible and repeatable across multiples runs.

Talking about flexibility, this "hook" can do way more than just
filtering the list of notebooks. Any extra oneoff pre-processing steps
for some edge-case scenario just before launching `py.test` can be done
there. Those are edge-cases processing so can not be committed as
"regular" steps.

@fmigneault Just to be clear, this new way to customize the config is
not meant to replace the existing way. It just gives us new
possibilities not possible before. It is 100% backward-compatible with
the existing way so there are no changes required on CRIM pipeline side.
If whatever you are doing already works, keep it, no need to change
anything.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/operations Continuous Integration components ci/tests Issues or changes related to tests scripts component/geoserver Related to GeoServer or one of its underlying services component/magpie Related to https://github.com/Ouranosinc/Magpie documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

💡 [Feature] Protect GeoServer
4 participants