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

Bump canarie api 1.0.0 #452

Merged
merged 14 commits into from
May 14, 2024
Merged

Bump canarie api 1.0.0 #452

merged 14 commits into from
May 14, 2024

Conversation

mishaschwartz
Copy link
Collaborator

Overview

This version of canarie-api permits running the proxy (nginx) container independently of the canarie-api application. This makes it easier to monitor the logs of canarie-api and proxy containers simultaneously and allows for the configuration files for canarie-api to be mapped to the canarie-api containers where appropriate.

Changes

Non-breaking changes

  • New component version canarie-api:1.0.0

Breaking changes

Related Issue / Discussion

Additional Information

Links to other issues or sources.

CI Operations

birdhouse_daccs_configs_branch: master
birdhouse_skip_ci: false

@github-actions github-actions bot added ci/operations Continuous Integration components ci/tests Issues or changes related to tests scripts component/cowbird Related to https://github.com/Ouranosinc/cowbird component/geoserver Related to GeoServer or one of its underlying services component/jupyterhub Related to JupyterHub as development frontend with notebooks component/magpie Related to https://github.com/Ouranosinc/Magpie component/STAC Features or components related to STAC component/THREDDS Features or components related to THREDDS component/twitcher Related to https://github.com/bird-house/twitcher component/weaver Related to https://github.com/crim-ca/weaver documentation Improvements or additions to documentation feature/WPS Feature or service related to Web Processing Service labels May 7, 2024
@fmigneault
Copy link
Collaborator

@mishaschwartz
Not sure if I found the issue, but I think the build trigger only considered organizations bird-house, Ouranosinc and crim-ca. I added you manually for the time being. Maybe if you push another commit, it will run (?).

@fmigneault
Copy link
Collaborator

run tests

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.

Didn't test it, but looks ok conceptually. Just a few comments to confirm.

Might need to push the component into the CI's EXTRA_CONF_DIRS to have a valid test run. It monitors the /canarie/ endpoint to check when the instance is ready to perform test.

Comment on lines +3 to +6
canarie-api: &canarie-volumes
volumes:
- ./components/twitcher/config/canarie-api/canarie_api_monitoring.py:${CANARIE_MONITORING_EXTRA_CONF_DIR}/twitcher_canarie_api_monitoring.py:ro
canarie-api-cron: *canarie-volumes
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this anchor work when all components are combined into one big compose file?
Doesn't it get overridden by whichever definition was loaded first/last/whatever?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes it works, docker compose parses yaml file individually first and then combines them into one big definition. Yaml anchors are applied at the file level.

nginx && \
gunicorn -b 0.0.0.0:2000 --workers 1 --log-level=DEBUG --timeout 30 -k gevent canarieapi.wsgi \
"
exec /bin/sh -c "gunicorn -b 0.0.0.0:2000 --workers 1 --log-level=DEBUG --timeout 30 -k gevent canarieapi.wsgi"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this be left multi-line? It's easier to read diffs.

@@ -1,7 +1,7 @@
# Folder inside "proxy" container to drop extra monitoring config
export CANARIE_MONITORING_EXTRA_CONF_DIR="/conf.d"

export PROXY_IMAGE="pavics/canarieapi:0.7.1"
export CANARIE_IMAGE="pavics/canarieapi:1.0.0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use a CANARIE_VERSION and other CANARIE_... similar variables as for other components?

CHANGES.md Outdated
[//]: # (list changes here, using '-' for each new entry, remove this when items are added)
## Changes

- bump canarie-api version to 1.0.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

use reference URL to the tagged versions in the source repo

- canarie-data:/data/
- ./components/canarie-api/docker_configuration.py:/config/docker_configuration.py:ro
- ./components/canarie-api/entrypoint-cron:/entrypoint:ro
- proxy-logs:/logs/:ro
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be worth adding a note that this path aligns with

@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/2636/
ResultSUCCESS

BIRDHOUSE_DEPLOY_BRANCH : bump-canarie-api-1.0.0
DACCS_IAC_BRANCH : master
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/1596/

NOTEBOOK TEST RESULTS
    
[2024-05-07T19:52:10.905Z] ============================= test session starts ==============================
[2024-05-07T19:52:10.905Z] platform linux -- Python 3.9.16, pytest-7.3.1, pluggy-1.0.0
[2024-05-07T19:52:10.905Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2024-05-07T19:52:10.905Z] plugins: anyio-3.6.1, dash-2.10.0, nbval-0.9.6, tornasync-0.6.0.post2, xdist-3.3.1
[2024-05-07T19:52:10.905Z] collected 269 items
[2024-05-07T19:52:10.905Z] 
[2024-05-07T19:52:21.532Z] notebooks-auth/geoserver.ipynb ..................                        [  6%]
[2024-05-07T19:53:03.653Z] notebooks-auth/test_cowbird_jupyter.ipynb ..........                     [ 10%]
[2024-05-07T19:53:08.165Z] notebooks-auth/test_thredds.ipynb ...........                            [ 14%]
[2024-05-07T19:54:26.864Z] pavics-sdi-master/docs/source/notebooks/CaSR_basic.ipynb ......          [ 16%]
[2024-05-07T19:54:36.578Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb .......        [ 19%]
[2024-05-07T19:54:45.910Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb ......         [ 21%]
[2024-05-07T19:54:53.341Z] pavics-sdi-master/docs/source/notebooks/WMS_example.ipynb ........       [ 24%]
[2024-05-07T20:02:30.142Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb ............        [ 28%]
[2024-05-07T20:02:30.142Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 29%]
[2024-05-07T20:02:37.936Z] ...............                                                          [ 34%]
[2024-05-07T20:02:47.303Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 36%]
[2024-05-07T20:02:54.473Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb ......            [ 39%]
[2024-05-07T20:03:12.405Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 41%]
[2024-05-07T20:03:18.292Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 43%]
[2024-05-07T20:03:22.790Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb .....       [ 45%]
[2024-05-07T20:07:38.508Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 51%]
[2024-05-07T20:08:52.706Z] .............                                                            [ 56%]
[2024-05-07T20:08:56.785Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 57%]
[2024-05-07T20:08:59.107Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 60%]
[2024-05-07T20:09:18.077Z] .................                                                        [ 66%]
[2024-05-07T20:09:27.424Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb ......          [ 69%]
[2024-05-07T20:09:28.807Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 69%]
[2024-05-07T20:09:46.840Z] .........                                                                [ 72%]
[2024-05-07T20:09:56.650Z] finch-master/docs/source/notebooks/dap_subset.ipynb ...........          [ 76%]
[2024-05-07T20:10:06.260Z] finch-master/docs/source/notebooks/finch-usage.ipynb ......              [ 79%]
[2024-05-07T20:10:07.659Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 79%]
[2024-05-07T20:10:11.041Z] ......                                                                   [ 81%]
[2024-05-07T20:10:23.272Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 82%]
[2024-05-07T20:10:37.416Z] .............                                                            [ 86%]
[2024-05-07T20:10:47.420Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 87%]
[2024-05-07T20:11:20.790Z] ....s.                                                                   [ 89%]
[2024-05-07T20:11:28.923Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 89%]
[2024-05-07T20:11:43.699Z] ..                                                                       [ 90%]
[2024-05-07T20:11:55.931Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 91%]
[2024-05-07T20:12:20.456Z] ......                                                                   [ 93%]
[2024-05-07T20:12:21.823Z] notebooks/hummingbird.ipynb ............                                 [ 97%]
[2024-05-07T20:14:55.990Z] notebooks/stress-tests.ipynb ......                                      [100%]
[2024-05-07T20:14:55.990Z] 
[2024-05-07T20:14:55.990Z] ================= 268 passed, 1 skipped in 1362.53s (0:22:42) ==================
    
  

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.

Minor feedback about data persistance. Not a blocker because currently it's the same behavior already, if the container is delete, we lose proxy logs and canarie-api stats.


volumes:
canarie-data:
proxy-logs:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very much like this PR. It's much cleaner this way that the canarie-api monitoring is separate from the proxy container.

I just wonder why are you using data-volume and not direct persistence on disk. And if you really need to use data-volume, the current way we will lose the data on ./pavics-compose.sh down -v.

To avoid losing data on ./pavics-compose.sh down -v, use external data-volume like the monitoring component.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A few reasons...

No other component is storing logs in a persistent manner. I'm not opposed to this but this could be a larger discussion about log retention that isn't related to this PR

the current way we will lose the data on ./pavics-compose.sh down -v

Sure, but are you bringing the stack down with the -v flag often? Personally, I never ever use the -v flag in production for that reason, and I'll delete a volume if needed manually.

I actually find it annoying to have to delete the externally created jupyterhub, prometheus, grafana, etc. volumes when I'm testing and want to start with a blank slate. I personally would actually like to see the externally created volumes become non-external (or a bind-mount from disk) for this reason.

Like I mentioned above, we don't currently have a defined log retention mechanism/policy. I'd love to add one, but maybe we can defer the discussion of how to manage logs when we discuss that.

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 the way it is defined currently is the right way.
If a platform maintainer wants to persist the logs at a specific location/drive/bind-mount, they simply need to add the relevant overrides to define the volume.
The flexibility is left up to the maintainer.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure, but are you bringing the stack down with the -v flag often?

I actually do use -v from time to time. Otherwise, all the anonymous volume are not delete and next up new anonymous volumes will be created and the old anonymous volumes are only deleted with docker volume prune --all.

Here is an example of anonymous volume:

@mishaschwartz
Copy link
Collaborator Author

@tlvu @fmigneault I'm thinking this needs a minor version bump to 2.3.0. Is that ok with everyone?

@tlvu
Copy link
Collaborator

tlvu commented May 11, 2024

@tlvu @fmigneault I'm thinking this needs a minor version bump to 2.3.0. Is that ok with everyone?

Yes you are technically introducing a new component (canarie-api) so yes, a minor bump.

@tlvu
Copy link
Collaborator

tlvu commented May 11, 2024

you are technically introducing a new component (canarie-api)

Oh sorry, new container, the component already exist.

@mishaschwartz mishaschwartz merged commit 444a7c3 into master May 14, 2024
4 checks passed
@mishaschwartz mishaschwartz deleted the bump-canarie-api-1.0.0 branch May 14, 2024 13:46
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/cowbird Related to https://github.com/Ouranosinc/cowbird component/geoserver Related to GeoServer or one of its underlying services component/jupyterhub Related to JupyterHub as development frontend with notebooks component/magpie Related to https://github.com/Ouranosinc/Magpie component/STAC Features or components related to STAC component/THREDDS Features or components related to THREDDS component/twitcher Related to https://github.com/bird-house/twitcher component/weaver Related to https://github.com/crim-ca/weaver documentation Improvements or additions to documentation feature/WPS Feature or service related to Web Processing Service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants