Skip to content

Canarie-api should not be a mandatory component#310

Merged
mishaschwartz merged 7 commits intomasterfrom
proxy-rewrite
Apr 11, 2023
Merged

Canarie-api should not be a mandatory component#310
mishaschwartz merged 7 commits intomasterfrom
proxy-rewrite

Conversation

@mishaschwartz
Copy link
Collaborator

Overview

Canarie-api is currently deployed in the same container as the nginx reverse proxy
service meaning that it is not possible to deploy nginx without including canarie-api.

This means that it is currently not possible to run this deployment without canarie-api
or use a different monitoring application. This change fully separates the configuration
for canarie-api and nginx so that a user can choose to run nginx with or without canarie-api.

Canarie-api has been kept on the DEFAULT_CONF_DIRS list so that canarie-api is included by
default, for backwards-compatibility. In order to run nginx without canarie-api, remove the
./conf/canarie-api line from the DEFAULT_CONF_DIRS environment variable.

A user can also choose a specific version of the nginx docker image to use by specifying
the PROXY_IMAGE environment variable (default is "nginx"). Note that if canarie-api is used
(by including the ./conf/canarie-api line in DEFAULT_CONF_DIRS), then the PROXY_IMAGE
variable will be ignored.

Changes

Non-breaking changes
Makes it possible to run the stack without canarie-api

Breaking changes
None

Related Issue / Discussion

Related to the various "pluggable component" issues. This makes canarie-api a "pluggable component".

Additional Information

@crim-jenkins-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@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/1424/
Result : success

BIRDHOUSE_DEPLOY_BRANCH : proxy-rewrite
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/1056/

NOTEBOOK TEST RESULTS
    
[2023-04-10T13:10:42.143Z] ============================= test session starts ==============================
[2023-04-10T13:10:42.143Z] platform linux -- Python 3.8.16, pytest-7.2.0, pluggy-1.0.0
[2023-04-10T13:10:42.143Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2023-04-10T13:10:42.143Z] plugins: anyio-3.6.2, dash-2.7.0, nbval-0.9.6, tornasync-0.6.0.post2
[2023-04-10T13:10:42.143Z] collected 268 items
[2023-04-10T13:10:42.143Z] 
[2023-04-10T13:10:51.634Z] notebooks-auth/test_thredds.ipynb ...........                            [  4%]
[2023-04-10T13:10:59.990Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb .......        [  6%]
[2023-04-10T13:11:07.308Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb ......         [  8%]
[2023-04-10T13:11:16.106Z] pavics-sdi-master/docs/source/notebooks/WMS_example.ipynb ........       [ 11%]
[2023-04-10T13:11:19.203Z] pavics-sdi-master/docs/source/notebooks/WPS_example.ipynb ..........     [ 15%]
[2023-04-10T13:19:09.822Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb ............        [ 20%]
[2023-04-10T13:19:09.822Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 20%]
[2023-04-10T13:19:09.822Z] ...............                                                          [ 26%]
[2023-04-10T13:19:15.633Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 27%]
[2023-04-10T13:19:22.757Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb ......            [ 30%]
[2023-04-10T13:19:40.462Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 32%]
[2023-04-10T13:19:41.846Z] pavics-sdi-master/docs/source/notebooks/jupyter_extensions.ipynb .       [ 32%]
[2023-04-10T13:19:46.487Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 35%]
[2023-04-10T13:19:52.603Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb .....       [ 37%]
[2023-04-10T13:23:24.989Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 42%]
[2023-04-10T13:24:32.655Z] .............                                                            [ 47%]
[2023-04-10T13:24:37.367Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 49%]
[2023-04-10T13:24:39.581Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 52%]
[2023-04-10T13:25:08.759Z] .................                                                        [ 58%]
[2023-04-10T13:25:16.106Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb .....           [ 60%]
[2023-04-10T13:25:17.491Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 60%]
[2023-04-10T13:25:33.560Z] .........                                                                [ 64%]
[2023-04-10T13:25:44.948Z] finch-master/docs/source/notebooks/dap_subset.ipynb ...........          [ 68%]
[2023-04-10T13:25:55.381Z] finch-master/docs/source/notebooks/finch-usage.ipynb ......              [ 70%]
[2023-04-10T13:26:35.462Z] finch-master/docs/source/notebooks/subset.ipynb ....................ss.  [ 79%]
[2023-04-10T13:26:37.381Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 79%]
[2023-04-10T13:26:46.480Z] ......                                                                   [ 81%]
[2023-04-10T13:29:53.060Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 82%]
[2023-04-10T13:30:57.550Z] .............                                                            [ 86%]
[2023-04-10T13:31:12.458Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 87%]
[2023-04-10T13:34:34.038Z] ....s.                                                                   [ 89%]
[2023-04-10T13:34:42.188Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 89%]
[2023-04-10T13:34:47.381Z] ...                                                                      [ 91%]
[2023-04-10T13:35:02.276Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 91%]
[2023-04-10T13:35:24.622Z] ......                                                                   [ 93%]
[2023-04-10T13:35:27.104Z] notebooks/hummingbird.ipynb ............                                 [ 98%]
[2023-04-10T13:39:13.262Z] notebooks/stress-tests.ipynb .....                                       [100%]
[2023-04-10T13:39:13.262Z] 
[2023-04-10T13:39:13.262Z] ================= 265 passed, 3 skipped in 1702.43s (0:28:22) ==================
    
  

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.

Totally approve the spirit of this PR. However I probably will not be able to perform a proper review of this PR and your 2 other PR as well this week. I have to give a hand for the paper David is alluring about in this comment #300 (comment)

However I do not want to hold you back either. So I propose that as long as your PR is back-compat (no manual intervention required to roll-out, to clean up after roll-out, to ensure subsequent autodeploy works) and Francis is okay with it, then go ahead and merge.

If later we find some problems, ex: the component load order changed and it's a regression, we can simply just fix it in a subsequent PR, just like the component load order. There is no requirement a PR is perfect on first try. Software have bugs all the time.

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.

Quick review, just minor comment.


# Folder inside "proxy" container to drop extra monitoring config
export CANARIE_MONITORING_EXTRA_CONF_DIR="/conf.d"
export PROXY_IMAGE="nginx"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would rather pin the specific latest version at this point in time. Because latest version is not reproducible. It changes on each build.

Reproducibility is very important if we want to be able to diagnose problem across multiple different deployments of PAVICS.

For a given PAVICS tag, we should know precisely which version of the binary is being deployed. We do allow image override via env.local but that's mostly for testing or the staging env. For production deployment, I think and hope most users will want to stick to the tested versions coming from the stack.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure and I agree. This is literally just a copy from https://github.com/Ouranosinc/CanarieAPI/blob/master/Dockerfile#L1 to maintain the existing settings but I'll explicitly pin it to whatever is the latest going forward.

# Folder inside "proxy" container to drop extra monitoring config
export CANARIE_MONITORING_EXTRA_CONF_DIR="/conf.d"

export PROXY_IMAGE="pavics/canarieapi:0.3.5"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for keeping this old behavior for backward compat.

@mishaschwartz
Copy link
Collaborator Author

Thanks @tlvu I appreciate it. Does that apply to #304 as well since I would like to pull that in so that I can apply my changes on top of that as well?

@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/1428/
Result : success

BIRDHOUSE_DEPLOY_BRANCH : proxy-rewrite
DACCS_CONFIGS_BRANCH : master
PAVICS_E2E_WORKFLOW_TESTS_BRANCH : master
PAVICS_SDI_BRANCH : master

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

PAVICS-e2e-workflow-tests Pipeline Results

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

NOTEBOOK TEST RESULTS
    
[2023-04-10T20:57:28.154Z] ============================= test session starts ==============================
[2023-04-10T20:57:28.154Z] platform linux -- Python 3.8.16, pytest-7.2.0, pluggy-1.0.0
[2023-04-10T20:57:28.154Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2023-04-10T20:57:28.154Z] plugins: anyio-3.6.2, dash-2.7.0, nbval-0.9.6, tornasync-0.6.0.post2
[2023-04-10T20:57:28.154Z] collected 268 items
[2023-04-10T20:57:28.154Z] 
[2023-04-10T20:57:37.653Z] notebooks-auth/test_thredds.ipynb ...........                            [  4%]
[2023-04-10T20:57:47.169Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb .......        [  6%]
[2023-04-10T20:57:55.876Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb ......         [  8%]
[2023-04-10T20:58:04.960Z] pavics-sdi-master/docs/source/notebooks/WMS_example.ipynb ........       [ 11%]
[2023-04-10T20:58:08.525Z] pavics-sdi-master/docs/source/notebooks/WPS_example.ipynb ..........     [ 15%]
[2023-04-10T21:06:12.003Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb ............        [ 20%]
[2023-04-10T21:06:12.003Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 20%]
[2023-04-10T21:06:12.003Z] ...............                                                          [ 26%]
[2023-04-10T21:06:17.819Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 27%]
[2023-04-10T21:06:25.737Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb ......            [ 30%]
[2023-04-10T21:06:45.188Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 32%]
[2023-04-10T21:06:46.837Z] pavics-sdi-master/docs/source/notebooks/jupyter_extensions.ipynb .       [ 32%]
[2023-04-10T21:06:52.178Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 35%]
[2023-04-10T21:06:58.768Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb .....       [ 37%]
[2023-04-10T21:11:32.475Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 42%]
[2023-04-10T21:12:52.626Z] .............                                                            [ 47%]
[2023-04-10T21:12:57.604Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 49%]
[2023-04-10T21:13:00.215Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 52%]
[2023-04-10T21:13:27.953Z] .................                                                        [ 58%]
[2023-04-10T21:13:34.618Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb .....           [ 60%]
[2023-04-10T21:13:36.013Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 60%]
[2023-04-10T21:13:52.317Z] .........                                                                [ 64%]
[2023-04-10T21:14:04.436Z] finch-master/docs/source/notebooks/dap_subset.ipynb ...........          [ 68%]
[2023-04-10T21:14:14.993Z] finch-master/docs/source/notebooks/finch-usage.ipynb ......              [ 70%]
[2023-04-10T21:14:56.235Z] finch-master/docs/source/notebooks/subset.ipynb ....................ss.  [ 79%]
[2023-04-10T21:14:58.153Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 79%]
[2023-04-10T21:15:10.098Z] ......                                                                   [ 81%]
[2023-04-10T21:18:31.704Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 82%]
[2023-04-10T21:19:44.925Z] .............                                                            [ 86%]
[2023-04-10T21:20:03.069Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 87%]
[2023-04-10T21:23:59.669Z] ....s.                                                                   [ 89%]
[2023-04-10T21:24:09.991Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 89%]
[2023-04-10T21:24:16.072Z] ...                                                                      [ 91%]
[2023-04-10T21:24:34.445Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 91%]
[2023-04-10T21:25:00.275Z] ......                                                                   [ 93%]
[2023-04-10T21:25:03.035Z] notebooks/hummingbird.ipynb ............                                 [ 98%]
[2023-04-10T21:28:52.798Z] notebooks/stress-tests.ipynb .....                                       [100%]
[2023-04-10T21:28:52.798Z] 
[2023-04-10T21:28:52.798Z] ================= 265 passed, 3 skipped in 1879.55s (0:31:19) ==================
    
  

@github-actions github-actions bot added ci/operations Continuous Integration components documentation Improvements or additions to documentation labels Apr 11, 2023
@mishaschwartz mishaschwartz merged commit cf90bc5 into master Apr 11, 2023
@mishaschwartz mishaschwartz deleted the proxy-rewrite branch April 11, 2023 13:03
@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/1432/
Result : failure

BIRDHOUSE_DEPLOY_BRANCH : proxy-rewrite
DACCS_CONFIGS_BRANCH : master
PAVICS_E2E_WORKFLOW_TESTS_BRANCH : master
PAVICS_SDI_BRANCH : master

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

Infrastructure deployment failed. Instance has not been destroyed. @matprov

@fmigneault
Copy link
Member

@mishaschwartz
Can you backport any relevant changes from this PR into #284?

@mishaschwartz
Copy link
Collaborator Author

@fmigneault of course. I'll do that today. What is the current state for #284 btw? Is it waiting on any more changes or is it almost ready to merge?

@fmigneault
Copy link
Member

@mishaschwartz It only needs some final validation to confirm that the monitoring is working correctly, but I did not get the chance to invest more time into it lately.

@@ -1,2 +1,5 @@
docker_configuration.py
conf.extra-service.d/canarie-api.conf
Copy link
Collaborator

Choose a reason for hiding this comment

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

@mishaschwartz Our staging env found this file became "new" file for git and broke the subsequent autodeploy !

Could you re-add this file to .gitignore?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@tlvu I've added a PR #314 . Is this what is breaking the Jenkins build as well do you think or is that unrelated?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Completely un-related to Jenkins. I merged #308 yesterday and today I went onto our staging machine and see it still did not autodeploy that merge. So I checked the logs and found out the reason.

mishaschwartz added a commit that referenced this pull request Apr 12, 2023
## Overview

In order to maintain backwards compatibility, old files that are no
longer present in the code should be
kept in the gitignore files. This adds back one file to the relevant
.gitignore file that no longer exists under
`conf.extra-service.d/canarie-api.conf`.

## Changes

**Non-breaking changes**

Add old file to gitignore

**Breaking changes**

None

## Related Issue / Discussion

See:
#310 (comment)

## Additional Information
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/operations Continuous Integration components documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants