Skip to content

Conversation

@tlvu
Copy link
Collaborator

@tlvu tlvu commented Dec 11, 2025

Fixes

CI Operations

birdhouse_daccs_configs_branch: master
birdhouse_skip_ci: false

Copy link
Collaborator

@mishaschwartz mishaschwartz left a comment

Choose a reason for hiding this comment

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

Thank you for this quick fix @tlvu!
I think there's a much simpler way to do this though, especially since this is meant as a temporary fix:

We can just add to the scheduler-job-logrotate component to handle the nginx logs as well. We already have the infrastructure in place to do log rotation, why not just add to that?

@tlvu
Copy link
Collaborator Author

tlvu commented Dec 11, 2025

We can just add to the scheduler-job-logrotate component to handle the nginx logs as well. We already have the infrastructure in place to do log rotation, why not just add to that?

I had thought of that but it does not work for 3 reasons:

  1. proxy is a default component, going that route means it should now depend on scheduler-job-logrotate component, which is bad since default component should be standalone.
  2. logrotate has to do a kill -USR1 <Nginx pid> to tell Nginx to re-open the new log file after the previous one has been rotated, so the logrotate should run in the same container as nginx to send the kill signal.
  3. The cron frequency is much different between scheduler-job-logrotate and the one we want. I'd rather not touch scheduler-job-logrotate now, preferring the least disruptive route to go fastest to production with least chance of regression.

Copy link
Member

@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.

Thanks for the fix!

# All env in this default.env can be overridden by env.local.

export PROXY_IMAGE="nginx:1.23.4"
export PROXY_IMAGE="pavics/nginx-cron-logrotate:1.23.4-251205"
Copy link
Member

Choose a reason for hiding this comment

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

This is built manually? Should it be configured automatically on docker hub?

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 manually as this is a temporary work-around. Let's try to not make this too comfortable that it becomes a permanent solution.

@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/3883/
Result 🆘 ABORTED

BIRDHOUSE_DEPLOY_BRANCH : fix-nginx-proxy-missing-logrotate
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-91.rdext.crim.ca

⚠️ Infrastructure deployment failed. ⚠️
Instance destroyed due to CI execution.
To debug, launch an instance manually with PR reference
fix-nginx-proxy-missing-logrotate.

@mishaschwartz
Copy link
Collaborator

I had thought of that but it does not work for 3 reasons

Ok but...

proxy is a default component, going that route means it should now depend on scheduler-job-logrotate component, which is bad since default component should be standalone.

This is a temporary workaround and it's OK if we need to include a separate component for now. Also, when we eventually implement #618 it will be much easier to deprecate a single component instead of having to revert a bunch of code that has been added to the proxy component.

logrotate has to do a kill -USR1 to tell Nginx to re-open the new log file after the previous one has been rotated, so the logrotate should run in the same container as nginx to send the kill signal.

Good point. This can be handled by the scheduler jobs with a trigger

The cron frequency is much different between scheduler-job-logrotate and the one we want. I'd rather not touch scheduler-job-logrotate now, preferring the least disruptive route to go fastest to production with least chance of regression.

You're right. This makes more sense as a separate scheduler job, not as an add on to the existing scheduler-jog-logrotate job.

@mishaschwartz
Copy link
Collaborator

see #619 for an alternative using scheduler jobs

@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/3884/
ResultFAILURE

BIRDHOUSE_DEPLOY_BRANCH : fix-nginx-proxy-missing-logrotate
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-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/562/

NOTEBOOK TEST RESULTS
    
[2025-12-11T20:10:05.089Z] ============================= test session starts ==============================
[2025-12-11T20:10:05.089Z] platform linux -- Python 3.11.12, pytest-8.3.5, pluggy-1.5.0
[2025-12-11T20:10:05.089Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2025-12-11T20:10:05.089Z] plugins: anyio-4.9.0, dash-3.0.3, nbval-0.11.0, tornasync-0.6.0.post2, xdist-3.6.1
[2025-12-11T20:10:05.089Z] collected 537 items
[2025-12-11T20:10:05.089Z] 
[2025-12-11T20:10:12.783Z] notebooks-auth/geoserver.ipynb ..................                        [  3%]
[2025-12-11T20:11:24.034Z] notebooks-auth/test_cowbird_jupyter.ipynb ..........                     [  5%]
[2025-12-11T20:11:24.034Z] notebooks-auth/test_thredds.ipynb ...........                            [  7%]
[2025-12-11T20:13:39.778Z] pavics-sdi-master/docs/source/notebooks/CaSR_basic.ipynb ......          [  8%]
[2025-12-11T20:37:50.784Z] pavics-sdi-master/docs/source/notebooks/FAQ_dask_parallel.ipynb ..s..... [  9%]
[2025-12-11T20:39:12.222Z] .                                                                        [ 10%]
[2025-12-11T20:39:14.762Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb ......         [ 11%]
[2025-12-11T20:39:21.603Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb .....          [ 12%]
[2025-12-11T20:56:14.930Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb ...........         [ 14%]
[2025-12-11T20:56:14.930Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 14%]
[2025-12-11T20:56:14.930Z] ...............                                                          [ 17%]
[2025-12-11T20:56:22.589Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 18%]
[2025-12-11T20:56:31.713Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb ....              [ 18%]
[2025-12-11T20:56:46.208Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 19%]
[2025-12-11T20:56:52.358Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 21%]
[2025-12-11T20:56:56.400Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb .....       [ 22%]
[2025-12-11T21:01:28.439Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 24%]
[2025-12-11T21:02:39.292Z] .............                                                            [ 27%]
[2025-12-11T21:02:43.367Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 28%]
[2025-12-11T21:02:45.263Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 29%]
[2025-12-11T21:03:11.635Z] .................                                                        [ 32%]
[2025-12-11T21:03:18.631Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb .....           [ 33%]
[2025-12-11T21:03:20.011Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 33%]
[2025-12-11T21:03:30.817Z] .........                                                                [ 35%]
[2025-12-11T21:03:42.953Z] finch-main/docs/source/notebooks/dap_subset.ipynb ...........            [ 37%]
[2025-12-11T21:03:53.032Z] finch-main/docs/source/notebooks/finch-usage.ipynb ......                [ 38%]
[2025-12-11T21:03:54.409Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 38%]
[2025-12-11T21:04:01.247Z] .....                                                                    [ 39%]
[2025-12-11T21:04:57.485Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 40%]
[2025-12-11T21:07:01.877Z] ............                                                             [ 42%]
[2025-12-11T21:08:09.578Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 42%]
[2025-12-11T21:10:46.085Z] .....s.                                                                  [ 43%]
[2025-12-11T21:10:46.357Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 43%]
[2025-12-11T21:10:53.102Z] ..                                                                       [ 44%]
[2025-12-11T21:11:03.100Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 44%]
[2025-12-11T21:12:12.095Z] .........                                                                [ 46%]
[2025-12-11T21:12:22.081Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-6Regridding_Conversion.ipynb . [ 46%]
[2025-12-11T21:15:04.482Z] ....                                                                     [ 47%]
[2025-12-11T21:15:04.482Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-01_Intro.ipynb . [ 47%]
[2025-12-11T21:15:08.939Z] ....                                                                     [ 48%]
[2025-12-11T21:15:13.133Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-02_Calibration.ipynb . [ 48%]
[2025-12-11T21:15:23.112Z] .....                                                                    [ 49%]
[2025-12-11T21:15:27.300Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-03_Watershed_properties.ipynb . [ 49%]
[2025-12-11T21:15:33.160Z] .............                                                            [ 51%]
[2025-12-11T21:15:38.428Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-04_Time_series_analysis.ipynb . [ 51%]
[2025-12-11T21:15:39.507Z] ......                                                                   [ 53%]
[2025-12-11T21:15:55.015Z] raven-main/docs/source/notebooks/Region_selection.ipynb .........        [ 54%]
[2025-12-11T21:15:56.389Z] raven-main/docs/source/notebooks/Subset_climate_data_over_watershed.ipynb . [ 54%]
[2025-12-11T21:16:20.363Z] ......                                                                   [ 56%]
[2025-12-11T21:16:22.904Z] RavenPy-main/docs/notebooks/00_Introduction_to_JupyterLab.ipynb ......   [ 57%]
[2025-12-11T21:16:47.387Z] RavenPy-main/docs/notebooks/01_Getting_watershed_boundaries.ipynb ...... [ 58%]
[2025-12-11T21:16:47.387Z] ..                                                                       [ 58%]
[2025-12-11T21:16:53.971Z] RavenPy-main/docs/notebooks/02_Extract_geographical_watershed_properties.ipynb . [ 58%]
[2025-12-11T21:16:58.416Z] .............                                                            [ 61%]
[2025-12-11T21:18:41.106Z] RavenPy-main/docs/notebooks/03_Extracting_forcing_data.ipynb ........... [ 63%]
[2025-12-11T21:18:41.106Z]                                                                          [ 63%]
[2025-12-11T21:18:43.588Z] RavenPy-main/docs/notebooks/04_Emulating_hydrological_models.ipynb ..... [ 64%]
[2025-12-11T21:18:50.884Z] ...............                                                          [ 67%]
[2025-12-11T21:18:56.744Z] RavenPy-main/docs/notebooks/05_Advanced_RavenPy_configuration.ipynb .... [ 67%]
[2025-12-11T21:19:05.156Z] .........                                                                [ 69%]
[2025-12-11T21:19:17.346Z] RavenPy-main/docs/notebooks/06_Raven_calibration.ipynb ......            [ 70%]
[2025-12-11T21:19:24.489Z] RavenPy-main/docs/notebooks/07_Making_and_using_hotstart_files.ipynb ... [ 71%]
[2025-12-11T21:19:27.280Z] ...                                                                      [ 71%]
[2025-12-11T21:19:32.550Z] RavenPy-main/docs/notebooks/08_Getting_and_bias_correcting_CMIP6_data.ipynb . [ 71%]
[2025-12-11T21:29:04.942Z] ...............                                                          [ 74%]
[2025-12-11T21:29:07.482Z] RavenPy-main/docs/notebooks/09_Hydrological_impacts_of_climate_change.ipynb . [ 74%]
[2025-12-11T21:29:14.474Z] ....                                                                     [ 75%]
[2025-12-11T21:29:55.462Z] RavenPy-main/docs/notebooks/10_Data_assimilation.ipynb ........          [ 77%]
[2025-12-11T21:30:04.237Z] RavenPy-main/docs/notebooks/11_Climatological_ESP_forecasting.ipynb .... [ 77%]
[2025-12-11T21:30:30.442Z] ....                                                                     [ 78%]
[2025-12-11T21:30:38.579Z] RavenPy-main/docs/notebooks/12_Performing_hindcasting_experiments.ipynb . [ 78%]
[2025-12-11T21:30:49.506Z] .......                                                                  [ 80%]
[2025-12-11T21:31:14.753Z] RavenPy-main/docs/notebooks/Assess_probabilistic_flood_risk.ipynb ...... [ 81%]
[2025-12-11T21:31:15.690Z] .                                                                        [ 81%]
[2025-12-11T21:31:23.807Z] RavenPy-main/docs/notebooks/Comparing_hindcasts_and_ESP_forecasts.ipynb . [ 81%]
[2025-12-11T21:31:46.378Z] .......                                                                  [ 82%]
[2025-12-11T21:31:53.216Z] RavenPy-main/docs/notebooks/Distributed_hydrological_modelling.ipynb ... [ 83%]
[2025-12-11T21:32:12.695Z] ....                                                                     [ 84%]
[2025-12-11T21:32:24.586Z] RavenPy-main/docs/notebooks/Hydrological_realtime_forecasting.ipynb .... [ 84%]
[2025-12-11T21:32:31.423Z] ..                                                                       [ 85%]
[2025-12-11T21:32:54.305Z] RavenPy-main/docs/notebooks/Managing_Jupyter_Environments.ipynb ...      [ 85%]
[2025-12-11T21:33:28.019Z] RavenPy-main/docs/notebooks/Perform_Regionalization.ipynb .......        [ 87%]
[2025-12-11T21:33:34.360Z] RavenPy-main/docs/notebooks/Running_HMETS_with_CANOPEX_dataset.ipynb ... [ 87%]
[2025-12-11T21:33:51.694Z] ..........                                                               [ 89%]
[2025-12-11T21:34:21.752Z] RavenPy-main/docs/notebooks/Sensitivity_analysis.ipynb ......            [ 90%]
[2025-12-11T21:34:26.404Z] RavenPy-main/docs/notebooks/time_series_analysis.ipynb ...........       [ 92%]
[2025-12-11T21:34:36.389Z] RavenPy-main/docs/notebooks/paper/Perform_a_climate_change_impact_study_on_a_watershed.ipynb . [ 92%]
[2025-12-11T21:40:12.940Z] .............Fxxxxxx                                                     [ 96%]
[2025-12-11T21:40:12.940Z] notebooks/hummingbird.ipynb ............                                 [ 98%]
[2025-12-11T21:42:52.022Z] notebooks/stress-tests.ipynb ......                                      [100%]
[2025-12-11T21:42:52.022Z] 
[2025-12-11T21:42:52.022Z] =================================== FAILURES ===================================
    
  

@tlvu
Copy link
Collaborator Author

tlvu commented Dec 15, 2025

much easier to deprecate a single component instead of having to revert a bunch of code

We are using source control, it's not that hard to do a revert using source control. But I agree your fix is easier to revert, even without source control.

Thanks for finding an alternate solution.

@mishaschwartz
Copy link
Collaborator

We are using source control, it's not that hard to do a revert using source control.

If we don't make any further changes to these files then yes you're right. If we make additional changes before we revert these ones then we run the risk of creating merge conflicts later on. I'm sure we could figure it out either way.

mishaschwartz added a commit that referenced this pull request Dec 16, 2025
## Overview

Currently the nginx logs are not rotated so they can build up to quite a
large size.

Previously, they were rotated by the `canarie-api` component but that is
no longer a required component and CanarieAPI hasn't handled log
rotation since CanarieAPI version 1.0.0.

Fixes #593.

This quick and least disruptive fix to get the production server out of
the water should be a temporary solution until a better solution using
container STDOUT parsing is implemented for the CanarieAPI and
prometheus-log-parser
(#618). Then we can
deprecate this scheduler job.

## Changes

**Non-breaking changes**
- adds new scheduler job

**Breaking changes**
- None

## Related Issue / Discussion

- This is an alternative to #617. See
#617 (comment)
for reasons why I believe this is a preferred solution.

## Additional Information

## CI Operations

<!--
The test suite can be run using a different DACCS config with
``birdhouse_daccs_configs_branch: branch_name`` in the PR description.
To globally skip the test suite regardless of the commit message use
``birdhouse_skip_ci`` set to ``true`` in the PR description.

Using ``[<cmd>]`` (with the brackets) where ``<cmd> = skip ci`` in the
commit message will override ``birdhouse_skip_ci`` from the PR
description.
Such commit command can be used to override the PR description behavior
for a specific commit update.
However, a commit message cannot 'force run' a PR which the description
turns off the CI.
To run the CI, the PR should instead be updated with a ``true`` value,
and a running message can be posted in following PR comments to trigger
tests once again.
-->

birdhouse_daccs_configs_branch: master
birdhouse_skip_ci: false
@tlvu
Copy link
Collaborator Author

tlvu commented Dec 17, 2025

Replaced by #619

@tlvu tlvu closed this Dec 17, 2025
@tlvu tlvu deleted the fix-nginx-proxy-missing-logrotate branch December 17, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [BUG]: Nginx/Canarie logging parsing bottleneck

5 participants