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

Jupyter: Restore terminal and allow recursive folder deletion #280

Merged

Conversation

tlvu
Copy link
Collaborator

@tlvu tlvu commented Jan 24, 2023

Changes:

  • Jupyter: allow recursive directory deletion

    This was not possible before since non-empty dir deletion was not possible.

  • Jupyter: re-enable terminal for all users

    It was disabled to avoid malicious usage but with the monitoring in
    place and the demo account restricted to limited resources, it's
    probably safe to try enabling this again.

    For legitimate users, not having the terminal is pretty annoying.
    Should not penalize legit users for some rogue users.

Deployed to https://lvupavicsmaster.ouranos.ca for testing.

It was disabled to avoid malicious usage but with the monitoring in
place and the demo account restricted to limited resources, it's
probably safe to try enabling this again.

For legitimate users, not having the terminal is pretty annoying.
Should not penalize legit users for some rogue users.
This was not possible before since non-empty dir deletion was not possible.
The container died instantly on creation startup.
Fix this error found during autodeploy:
```
fix GeoServer data dir permission on first run only, when data dir do not exist yet.
+ DATA_DIR='${DATA_PERSIST_ROOT}/geoserver'
+ '[' -n  ]
+ docker run --rm --name fix-geoserver-data-dir-perm --volume '${DATA_PERSIST_ROOT}/geoserver:/datadir' --env FIRST_RUN_ONLY bash:5.1.4 bash -xc 'if [ -z "$FIRST_RUN_ONLY" -o ! -f /datadir/global.xml ]; \
    then chown -R 1000:10001 /datadir; else echo "No execute."; fi'
docker: Error response from daemon: create ${DATA_PERSIST_ROOT}/geoserver: "${DATA_PERSIST_ROOT}/geoserver" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.
See 'docker run --help'.
```
…lways read last

env.local will always have the latest updated values so no need for
delayed eval.
@crim-jenkins-bot
Copy link
Collaborator

E2E Test Results

DACCS-iac Pipeline Results

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

BIRDHOUSE_DEPLOY_BRANCH : restore-jupyter-terminal-and-allow-recursive-folder-deletion
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/925/

NOTEBOOK TEST RESULTS
    
[2023-01-25T00:07:50.929Z] ============================= test session starts ==============================
[2023-01-25T00:07:50.929Z] platform linux -- Python 3.8.15, pytest-7.2.0, pluggy-1.0.0
[2023-01-25T00:07:50.929Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2023-01-25T00:07:50.929Z] plugins: anyio-3.6.2, dash-2.7.0, nbval-0.9.6, tornasync-0.6.0.post2
[2023-01-25T00:07:50.929Z] collected 263 items
[2023-01-25T00:07:50.929Z] 
[2023-01-25T00:08:01.592Z] notebooks-auth/test_thredds.ipynb ...........                            [  4%]
[2023-01-25T00:08:22.325Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb .......        [  6%]
[2023-01-25T00:08:31.517Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb ......         [  9%]
[2023-01-25T00:08:40.559Z] pavics-sdi-master/docs/source/notebooks/WMS_example.ipynb ........       [ 12%]
[2023-01-25T00:08:43.468Z] pavics-sdi-master/docs/source/notebooks/WPS_example.ipynb ..........     [ 15%]
[2023-01-25T00:09:11.902Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb FFFFFFFFFFF.        [ 20%]
[2023-01-25T00:09:15.214Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 20%]
[2023-01-25T00:09:23.119Z] ...............                                                          [ 26%]
[2023-01-25T00:09:34.529Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 28%]
[2023-01-25T00:09:46.787Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb F                 [ 28%]
[2023-01-25T00:10:04.335Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 31%]
[2023-01-25T00:10:05.730Z] pavics-sdi-master/docs/source/notebooks/jupyter_extensions.ipynb .       [ 31%]
[2023-01-25T00:10:12.017Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 34%]
[2023-01-25T00:10:17.779Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb ....F       [ 36%]
[2023-01-25T00:13:49.626Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 41%]
[2023-01-25T00:15:09.461Z] .............                                                            [ 46%]
[2023-01-25T00:15:14.157Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 48%]
[2023-01-25T00:15:17.037Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 51%]
[2023-01-25T00:15:43.530Z] .................                                                        [ 57%]
[2023-01-25T00:15:49.482Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb .....           [ 59%]
[2023-01-25T00:15:51.403Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 60%]
[2023-01-25T00:16:07.826Z] .........                                                                [ 63%]
[2023-01-25T00:16:19.542Z] finch-master/docs/source/notebooks/dap_subset.ipynb ...........          [ 67%]
[2023-01-25T00:16:29.717Z] finch-master/docs/source/notebooks/finch-usage.ipynb ......              [ 69%]
[2023-01-25T00:17:00.834Z] finch-master/docs/source/notebooks/subset.ipynb ....................ss.  [ 78%]
[2023-01-25T00:17:02.936Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 79%]
[2023-01-25T00:17:06.527Z] ......                                                                   [ 81%]
[2023-01-25T00:17:28.523Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 81%]
[2023-01-25T00:17:46.606Z] .............                                                            [ 86%]
[2023-01-25T00:17:56.616Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 87%]
[2023-01-25T00:18:32.954Z] ....s.                                                                   [ 89%]
[2023-01-25T00:18:41.158Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 89%]
[2023-01-25T00:18:47.298Z] ...                                                                      [ 90%]
[2023-01-25T00:19:02.268Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 91%]
[2023-01-25T00:19:29.639Z] ......                                                                   [ 93%]
[2023-01-25T00:19:35.470Z] notebooks/hummingbird.ipynb ............                                 [ 98%]
[2023-01-25T00:23:01.339Z] notebooks/stress-tests.ipynb .....                                       [100%]
[2023-01-25T00:23:01.340Z] 
[2023-01-25T00:23:01.340Z] =================================== FAILURES ===================================
    
  

@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/1140/
Result : failure

BIRDHOUSE_DEPLOY_BRANCH : restore-jupyter-terminal-and-allow-recursive-folder-deletion
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/925/

NOTEBOOK TEST RESULTS
    
[2023-01-25T00:07:50.929Z] ============================= test session starts ==============================
[2023-01-25T00:07:50.929Z] platform linux -- Python 3.8.15, pytest-7.2.0, pluggy-1.0.0
[2023-01-25T00:07:50.929Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2023-01-25T00:07:50.929Z] plugins: anyio-3.6.2, dash-2.7.0, nbval-0.9.6, tornasync-0.6.0.post2
[2023-01-25T00:07:50.929Z] collected 263 items
[2023-01-25T00:07:50.929Z] 
[2023-01-25T00:08:01.592Z] notebooks-auth/test_thredds.ipynb ...........                            [  4%]
[2023-01-25T00:08:22.325Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb .......        [  6%]
[2023-01-25T00:08:31.517Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb ......         [  9%]
[2023-01-25T00:08:40.559Z] pavics-sdi-master/docs/source/notebooks/WMS_example.ipynb ........       [ 12%]
[2023-01-25T00:08:43.468Z] pavics-sdi-master/docs/source/notebooks/WPS_example.ipynb ..........     [ 15%]
[2023-01-25T00:09:11.902Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb FFFFFFFFFFF.        [ 20%]
[2023-01-25T00:09:15.214Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 20%]
[2023-01-25T00:09:23.119Z] ...............                                                          [ 26%]
[2023-01-25T00:09:34.529Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 28%]
[2023-01-25T00:09:46.787Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb F                 [ 28%]
[2023-01-25T00:10:04.335Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 31%]
[2023-01-25T00:10:05.730Z] pavics-sdi-master/docs/source/notebooks/jupyter_extensions.ipynb .       [ 31%]
[2023-01-25T00:10:12.017Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 34%]
[2023-01-25T00:10:17.779Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb ....F       [ 36%]
[2023-01-25T00:13:49.626Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 41%]
[2023-01-25T00:15:09.461Z] .............                                                            [ 46%]
[2023-01-25T00:15:14.157Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 48%]
[2023-01-25T00:15:17.037Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 51%]
[2023-01-25T00:15:43.530Z] .................                                                        [ 57%]
[2023-01-25T00:15:49.482Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb .....           [ 59%]
[2023-01-25T00:15:51.403Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 60%]
[2023-01-25T00:16:07.826Z] .........                                                                [ 63%]
[2023-01-25T00:16:19.542Z] finch-master/docs/source/notebooks/dap_subset.ipynb ...........          [ 67%]
[2023-01-25T00:16:29.717Z] finch-master/docs/source/notebooks/finch-usage.ipynb ......              [ 69%]
[2023-01-25T00:17:00.834Z] finch-master/docs/source/notebooks/subset.ipynb ....................ss.  [ 78%]
[2023-01-25T00:17:02.936Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 79%]
[2023-01-25T00:17:06.527Z] ......                                                                   [ 81%]
[2023-01-25T00:17:28.523Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 81%]
[2023-01-25T00:17:46.606Z] .............                                                            [ 86%]
[2023-01-25T00:17:56.616Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 87%]
[2023-01-25T00:18:32.954Z] ....s.                                                                   [ 89%]
[2023-01-25T00:18:41.158Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 89%]
[2023-01-25T00:18:47.298Z] ...                                                                      [ 90%]
[2023-01-25T00:19:02.268Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 91%]
[2023-01-25T00:19:29.639Z] ......                                                                   [ 93%]
[2023-01-25T00:19:35.470Z] notebooks/hummingbird.ipynb ............                                 [ 98%]
[2023-01-25T00:23:01.339Z] notebooks/stress-tests.ipynb .....                                       [100%]
[2023-01-25T00:23:01.340Z] 
[2023-01-25T00:23:01.340Z] =================================== 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.

The changes look OK, but I wonder if it would not be better to have a separate .sh that does the full process_delayed_eval definition + . env.local + . default.env steps in the appropriate order. In other words, move the logic of sourcing ENV definitions together instead of duplicated in each script. It will be easier to maintain in case other approaches like in #272 (comment) are attempted.

@tlvu
Copy link
Collaborator Author

tlvu commented Jan 25, 2023

The changes look OK, but I wonder if it would not be better to have a separate .sh that does the full process_delayed_eval definition + . env.local + . default.env steps in the appropriate order. In other words, move the logic of sourcing ENV definitions together instead of duplicated in each script. It will be easier to maintain in case other approaches like in #272 (comment) are attempted.

Agreed. I think a further "logic grouping" is required.

Retrospectively, maybe I should not have supported delayed eval in the first place. It's a bit more complex than initially planned for not a very big gain (only 3 variables so far).

So I am not sure I want to put more effort into this feature. Let's keep it as-is for now and see how it evolves. But you are right, next time we leverage this feature again and decide to keep this feature, the "logic grouping" should be done at the same time.

@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/1142/
Result : failure

BIRDHOUSE_DEPLOY_BRANCH : restore-jupyter-terminal-and-allow-recursive-folder-deletion
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/927/

NOTEBOOK TEST RESULTS
    
[2023-01-25T01:38:20.552Z] ============================= test session starts ==============================
[2023-01-25T01:38:20.552Z] platform linux -- Python 3.8.15, pytest-7.2.0, pluggy-1.0.0
[2023-01-25T01:38:20.552Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2023-01-25T01:38:20.552Z] plugins: anyio-3.6.2, dash-2.7.0, nbval-0.9.6, tornasync-0.6.0.post2
[2023-01-25T01:38:20.552Z] collected 263 items
[2023-01-25T01:38:20.552Z] 
[2023-01-25T01:38:28.475Z] notebooks-auth/test_thredds.ipynb ...........                            [  4%]
[2023-01-25T01:38:38.009Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb .......        [  6%]
[2023-01-25T01:38:45.721Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb ......         [  9%]
[2023-01-25T01:38:52.794Z] pavics-sdi-master/docs/source/notebooks/WMS_example.ipynb ........       [ 12%]
[2023-01-25T01:38:55.569Z] pavics-sdi-master/docs/source/notebooks/WPS_example.ipynb ..........     [ 15%]
[2023-01-25T01:39:14.555Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb FFFFFFFFFFF.        [ 20%]
[2023-01-25T01:39:17.107Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 20%]
[2023-01-25T01:39:23.079Z] ...............                                                          [ 26%]
[2023-01-25T01:39:34.161Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 28%]
[2023-01-25T01:39:46.404Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb F                 [ 28%]
[2023-01-25T01:40:02.009Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 31%]
[2023-01-25T01:40:03.403Z] pavics-sdi-master/docs/source/notebooks/jupyter_extensions.ipynb .       [ 31%]
[2023-01-25T01:40:09.231Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 34%]
[2023-01-25T01:40:15.415Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb ....F       [ 36%]
[2023-01-25T01:43:20.095Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 41%]
[2023-01-25T01:44:36.990Z] .............                                                            [ 46%]
[2023-01-25T01:44:43.874Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 48%]
[2023-01-25T01:44:46.474Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 51%]
[2023-01-25T01:45:10.643Z] .................                                                        [ 57%]
[2023-01-25T01:45:16.782Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb .....           [ 59%]
[2023-01-25T01:45:18.700Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 60%]
[2023-01-25T01:45:29.185Z] .........                                                                [ 63%]
[2023-01-25T01:45:43.332Z] finch-master/docs/source/notebooks/dap_subset.ipynb ...........          [ 67%]
[2023-01-25T01:45:52.693Z] finch-master/docs/source/notebooks/finch-usage.ipynb ......              [ 69%]
[2023-01-25T01:46:23.413Z] finch-master/docs/source/notebooks/subset.ipynb ....................ss.  [ 78%]
[2023-01-25T01:46:24.800Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 79%]
[2023-01-25T01:46:28.640Z] ......                                                                   [ 81%]
[2023-01-25T01:46:50.639Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 81%]
[2023-01-25T01:47:07.278Z] .............                                                            [ 86%]
[2023-01-25T01:47:17.333Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 87%]
[2023-01-25T01:47:56.990Z] ....s.                                                                   [ 89%]
[2023-01-25T01:48:07.036Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 89%]
[2023-01-25T01:48:12.173Z] ...                                                                      [ 90%]
[2023-01-25T01:48:30.320Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 91%]
[2023-01-25T01:48:59.801Z] ......                                                                   [ 93%]
[2023-01-25T01:49:06.241Z] notebooks/hummingbird.ipynb ............                                 [ 98%]
[2023-01-25T01:52:46.752Z] notebooks/stress-tests.ipynb .....                                       [100%]
[2023-01-25T01:52:46.752Z] 
[2023-01-25T01:52:46.752Z] =================================== FAILURES ===================================
    
  

@crim-jenkins-bot
Copy link
Collaborator

E2E Test Results

DACCS-iac Pipeline Results

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

BIRDHOUSE_DEPLOY_BRANCH : restore-jupyter-terminal-and-allow-recursive-folder-deletion
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/927/

NOTEBOOK TEST RESULTS
    
[2023-01-25T01:38:20.552Z] ============================= test session starts ==============================
[2023-01-25T01:38:20.552Z] platform linux -- Python 3.8.15, pytest-7.2.0, pluggy-1.0.0
[2023-01-25T01:38:20.552Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2023-01-25T01:38:20.552Z] plugins: anyio-3.6.2, dash-2.7.0, nbval-0.9.6, tornasync-0.6.0.post2
[2023-01-25T01:38:20.552Z] collected 263 items
[2023-01-25T01:38:20.552Z] 
[2023-01-25T01:38:28.475Z] notebooks-auth/test_thredds.ipynb ...........                            [  4%]
[2023-01-25T01:38:38.009Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb .......        [  6%]
[2023-01-25T01:38:45.721Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb ......         [  9%]
[2023-01-25T01:38:52.794Z] pavics-sdi-master/docs/source/notebooks/WMS_example.ipynb ........       [ 12%]
[2023-01-25T01:38:55.569Z] pavics-sdi-master/docs/source/notebooks/WPS_example.ipynb ..........     [ 15%]
[2023-01-25T01:39:14.555Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb FFFFFFFFFFF.        [ 20%]
[2023-01-25T01:39:17.107Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 20%]
[2023-01-25T01:39:23.079Z] ...............                                                          [ 26%]
[2023-01-25T01:39:34.161Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 28%]
[2023-01-25T01:39:46.404Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb F                 [ 28%]
[2023-01-25T01:40:02.009Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 31%]
[2023-01-25T01:40:03.403Z] pavics-sdi-master/docs/source/notebooks/jupyter_extensions.ipynb .       [ 31%]
[2023-01-25T01:40:09.231Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 34%]
[2023-01-25T01:40:15.415Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb ....F       [ 36%]
[2023-01-25T01:43:20.095Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 41%]
[2023-01-25T01:44:36.990Z] .............                                                            [ 46%]
[2023-01-25T01:44:43.874Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 48%]
[2023-01-25T01:44:46.474Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 51%]
[2023-01-25T01:45:10.643Z] .................                                                        [ 57%]
[2023-01-25T01:45:16.782Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb .....           [ 59%]
[2023-01-25T01:45:18.700Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 60%]
[2023-01-25T01:45:29.185Z] .........                                                                [ 63%]
[2023-01-25T01:45:43.332Z] finch-master/docs/source/notebooks/dap_subset.ipynb ...........          [ 67%]
[2023-01-25T01:45:52.693Z] finch-master/docs/source/notebooks/finch-usage.ipynb ......              [ 69%]
[2023-01-25T01:46:23.413Z] finch-master/docs/source/notebooks/subset.ipynb ....................ss.  [ 78%]
[2023-01-25T01:46:24.800Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 79%]
[2023-01-25T01:46:28.640Z] ......                                                                   [ 81%]
[2023-01-25T01:46:50.639Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 81%]
[2023-01-25T01:47:07.278Z] .............                                                            [ 86%]
[2023-01-25T01:47:17.333Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 87%]
[2023-01-25T01:47:56.990Z] ....s.                                                                   [ 89%]
[2023-01-25T01:48:07.036Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 89%]
[2023-01-25T01:48:12.173Z] ...                                                                      [ 90%]
[2023-01-25T01:48:30.320Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 91%]
[2023-01-25T01:48:59.801Z] ......                                                                   [ 93%]
[2023-01-25T01:49:06.241Z] notebooks/hummingbird.ipynb ............                                 [ 98%]
[2023-01-25T01:52:46.752Z] notebooks/stress-tests.ipynb .....                                       [100%]
[2023-01-25T01:52:46.752Z] 
[2023-01-25T01:52:46.752Z] =================================== FAILURES ===================================
    
  

@fmigneault
Copy link
Collaborator

The changes look OK, but I wonder if it would not be better to have a separate .sh that does the full process_delayed_eval definition + . env.local + . default.env steps in the appropriate order. In other words, move the logic of sourcing ENV definitions together instead of duplicated in each script. It will be easier to maintain in case other approaches like in #272 (comment) are attempted.

Agreed. I think a further "logic grouping" is required.

Retrospectively, maybe I should not have supported delayed eval in the first place. It's a bit more complex than initially planned for not a very big gain (only 3 variables so far).

So I am not sure I want to put more effort into this feature. Let's keep it as-is for now and see how it evolves. But you are right, next time we leverage this feature again and decide to keep this feature, the "logic grouping" should be done at the same time.

I think it would be better to group them right away, but without modifying the DELAYED_VARS approach yet. If this new method is applied right away and spreads across scripts (including user-specific overrides), it will have an even bigger impact with more restrictions to modify it later.
We should take the opportunity to adjust it while it is fairly new and not widely adopted.

@tlvu
Copy link
Collaborator Author

tlvu commented Jan 25, 2023

I think it would be better to group them right away, but without modifying the DELAYED_VARS approach yet. If this new method is applied right away and spreads across scripts (including user-specific overrides), it will have an even bigger impact with more restrictions to modify it later.
We should take the opportunity to adjust it while it is fairly new and not widely adopted.

Then I'll remove the fix in this PR and open a different PR to avoid delaying this PR.

This reverts commit 6687185.

To be implemented better in a different PR.

Francis proposed to centralize all the sourcing logic of default.env and
env.local and calling process_delayed_eval in a same file so all scripts
to not have to remember the loading sequence and we have a central
location to update that loading sequence without having to edit all the
scripts in the future.
@tlvu tlvu requested a review from fmigneault January 25, 2023 15:10
@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/1143/
Result : failure

BIRDHOUSE_DEPLOY_BRANCH : restore-jupyter-terminal-and-allow-recursive-folder-deletion
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/928/

NOTEBOOK TEST RESULTS
    
[2023-01-25T15:20:07.296Z] ============================= test session starts ==============================
[2023-01-25T15:20:07.296Z] platform linux -- Python 3.8.15, pytest-7.2.0, pluggy-1.0.0
[2023-01-25T15:20:07.296Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2023-01-25T15:20:07.296Z] plugins: anyio-3.6.2, dash-2.7.0, nbval-0.9.6, tornasync-0.6.0.post2
[2023-01-25T15:20:07.296Z] collected 263 items
[2023-01-25T15:20:07.296Z] 
[2023-01-25T15:20:15.718Z] notebooks-auth/test_thredds.ipynb ...........                            [  4%]
[2023-01-25T15:20:52.384Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb .......        [  6%]
[2023-01-25T15:21:03.733Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb ......         [  9%]
[2023-01-25T15:21:12.301Z] pavics-sdi-master/docs/source/notebooks/WMS_example.ipynb ........       [ 12%]
[2023-01-25T15:21:15.169Z] pavics-sdi-master/docs/source/notebooks/WPS_example.ipynb ..........     [ 15%]
[2023-01-25T15:21:59.341Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb FFFFFFFFFFF.        [ 20%]
[2023-01-25T15:22:00.280Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 20%]
[2023-01-25T15:22:07.172Z] ...............                                                          [ 26%]
[2023-01-25T15:22:18.758Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 28%]
[2023-01-25T15:22:30.969Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb F                 [ 28%]
[2023-01-25T15:22:46.634Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 31%]
[2023-01-25T15:22:48.011Z] pavics-sdi-master/docs/source/notebooks/jupyter_extensions.ipynb .       [ 31%]
[2023-01-25T15:22:53.666Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 34%]
[2023-01-25T15:22:58.800Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb ....F       [ 36%]
[2023-01-25T15:26:10.959Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 41%]
[2023-01-25T15:27:22.875Z] .............                                                            [ 46%]
[2023-01-25T15:27:35.268Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 48%]
[2023-01-25T15:27:38.389Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 51%]
[2023-01-25T15:28:10.957Z] .................                                                        [ 57%]
[2023-01-25T15:28:16.620Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb .....           [ 59%]
[2023-01-25T15:28:18.536Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 60%]
[2023-01-25T15:28:28.723Z] .........                                                                [ 63%]
[2023-01-25T15:28:44.430Z] finch-master/docs/source/notebooks/dap_subset.ipynb ...........          [ 67%]
[2023-01-25T15:28:56.112Z] finch-master/docs/source/notebooks/finch-usage.ipynb ......              [ 69%]
[2023-01-25T15:29:26.329Z] finch-master/docs/source/notebooks/subset.ipynb ....................ss.  [ 78%]
[2023-01-25T15:29:27.709Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 79%]
[2023-01-25T15:29:31.299Z] ......                                                                   [ 81%]
[2023-01-25T15:29:57.891Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 81%]
[2023-01-25T15:30:23.859Z] .............                                                            [ 86%]
[2023-01-25T15:30:36.106Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 87%]
[2023-01-25T15:31:18.831Z] ....s.                                                                   [ 89%]
[2023-01-25T15:31:28.812Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 89%]
[2023-01-25T15:31:33.558Z] ...                                                                      [ 90%]
[2023-01-25T15:31:55.502Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 91%]
[2023-01-25T15:33:05.738Z] ......                                                                   [ 93%]
[2023-01-25T15:33:11.558Z] notebooks/hummingbird.ipynb ............                                 [ 98%]
[2023-01-25T15:36:34.884Z] notebooks/stress-tests.ipynb ...F.                                       [100%]
[2023-01-25T15:36:34.884Z] 
[2023-01-25T15:36:34.884Z] =================================== FAILURES ===================================
    
  

@crim-jenkins-bot
Copy link
Collaborator

E2E Test Results

DACCS-iac Pipeline Results

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

BIRDHOUSE_DEPLOY_BRANCH : restore-jupyter-terminal-and-allow-recursive-folder-deletion
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/929/

NOTEBOOK TEST RESULTS
    
[2023-01-25T15:20:07.302Z] ============================= test session starts ==============================
[2023-01-25T15:20:07.302Z] platform linux -- Python 3.8.15, pytest-7.2.0, pluggy-1.0.0
[2023-01-25T15:20:07.302Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master@2
[2023-01-25T15:20:07.302Z] plugins: anyio-3.6.2, dash-2.7.0, nbval-0.9.6, tornasync-0.6.0.post2
[2023-01-25T15:20:07.302Z] collected 263 items
[2023-01-25T15:20:07.302Z] 
[2023-01-25T15:20:15.704Z] notebooks-auth/test_thredds.ipynb ...........                            [  4%]
[2023-01-25T15:20:52.515Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb .......        [  6%]
[2023-01-25T15:21:03.563Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb ......         [  9%]
[2023-01-25T15:21:11.869Z] pavics-sdi-master/docs/source/notebooks/WMS_example.ipynb ........       [ 12%]
[2023-01-25T15:21:15.090Z] pavics-sdi-master/docs/source/notebooks/WPS_example.ipynb ..........     [ 15%]
[2023-01-25T15:21:57.475Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb FFFFFFFFFFF.        [ 20%]
[2023-01-25T15:21:59.998Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 20%]
[2023-01-25T15:22:07.204Z] ...............                                                          [ 26%]
[2023-01-25T15:22:18.856Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 28%]
[2023-01-25T15:22:21.383Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb E                 [ 28%]
[2023-01-25T15:22:39.680Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 31%]
[2023-01-25T15:22:41.064Z] pavics-sdi-master/docs/source/notebooks/jupyter_extensions.ipynb .       [ 31%]
[2023-01-25T15:22:46.296Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 34%]
[2023-01-25T15:22:51.846Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb ....F       [ 36%]
[2023-01-25T15:26:07.985Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 41%]
[2023-01-25T15:27:26.172Z] .............                                                            [ 46%]
[2023-01-25T15:27:35.292Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 48%]
[2023-01-25T15:27:38.406Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 51%]
[2023-01-25T15:28:08.895Z] .................                                                        [ 57%]
[2023-01-25T15:28:16.880Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb .....           [ 59%]
[2023-01-25T15:28:18.256Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 60%]
[2023-01-25T15:28:28.666Z] .........                                                                [ 63%]
[2023-01-25T15:28:42.719Z] finch-master/docs/source/notebooks/dap_subset.ipynb ...........          [ 67%]
[2023-01-25T15:28:53.596Z] finch-master/docs/source/notebooks/finch-usage.ipynb ......              [ 69%]
[2023-01-25T15:29:25.340Z] finch-master/docs/source/notebooks/subset.ipynb ....................ss.  [ 78%]
[2023-01-25T15:29:27.244Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 79%]
[2023-01-25T15:29:30.831Z] ......                                                                   [ 81%]
[2023-01-25T15:29:57.414Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 81%]
[2023-01-25T15:30:17.125Z] .............                                                            [ 86%]
[2023-01-25T15:30:29.440Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 87%]
[2023-01-25T15:31:15.977Z] ....s.                                                                   [ 89%]
[2023-01-25T15:31:25.969Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 89%]
[2023-01-25T15:31:31.955Z] ...                                                                      [ 90%]
[2023-01-25T15:31:53.894Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 91%]
[2023-01-25T15:33:04.428Z] ......                                                                   [ 93%]
[2023-01-25T15:33:11.549Z] notebooks/hummingbird.ipynb ............                                 [ 98%]
[2023-01-25T15:36:34.322Z] notebooks/stress-tests.ipynb ...F.                                       [100%]
[2023-01-25T15:36:34.324Z] 
[2023-01-25T15:36:34.324Z] ==================================== ERRORS ====================================
    
  

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.

Ok with scope change.

@huard
Copy link
Collaborator

huard commented Jan 25, 2023

Looking at the nb failures.

  • I ran climex on the Alpha instance and it runs, so not clear what is going on with this nb.
  • Also ran pavics_thredds without problem.

@tlvu
Copy link
Collaborator Author

tlvu commented Jan 25, 2023

Looking at the nb failures.

* I ran `climex` on the Alpha instance and it runs, so not clear what is going on with this nb.

I think it's because it looks for the .json file on the test server while it should look on PAVICS instead.

Must be a precommit autoformat that breaks that line on multple lines. But I don't understand, I thought we escaped all the lines with # TEST_USE_PROD_DATA already so it should not break it on multiple lines. Will ask Trevor for the escape.

 cat = intake.open_esm_datastore(
      "https://host-140-154.rdext.crim.ca/catalog/climex.json"
   cat = intake.open_esm_datastore(
10:36:34      "https://host-140-154.rdext.crim.ca/catalog/climex.json"
10:36:34  )  # TEST_USE_PROD_DATA
10:36:34  cat.df.head()
  cat.df.head()
JSONDecodeError: Expecting value: line 4 column 1 (char 3)
* Also ran `pavics_thredds` without problem.

Seems to be test env configuration problem. User authtest, passwd authtest1234 should have been already created before the test is launched. @matprov can you double check problems on your side.

  AUTH_USR = os.getenv("TEST_MAGPIE_AUTHTEST_USERNAME", "authtest")
  AUTH_PWD = os.getenv("TEST_MAGPIE_AUTHTEST_PASSWORD", "authtest1234")
HTTPError: 401 Client Error: Unauthorized for url: https://host-140-154.rdext.crim.ca/magpie/signin

@tlvu tlvu changed the title Jupyter: Restore terminal and allow recursive folder deletion, fix regression with DELAYED_EVAL Jupyter: Restore terminal and allow recursive folder deletion Jan 25, 2023
@github-actions github-actions bot added ci/operations Continuous Integration components documentation Improvements or additions to documentation labels Jan 25, 2023
@tlvu tlvu merged commit 2979c57 into master Jan 25, 2023
@tlvu tlvu deleted the restore-jupyter-terminal-and-allow-recursive-folder-deletion branch January 25, 2023 23:00
@tlvu
Copy link
Collaborator Author

tlvu commented Jan 25, 2023

Merged this PR anyways since the 2 failed notebooks are absolutely unrelated to my JupyterHub config change.

@tlvu
Copy link
Collaborator Author

tlvu commented Jan 25, 2023

I think it's because it looks for the .json file on the test server while it should look on PAVICS instead.

Must be a precommit autoformat that breaks that line on multple lines. But I don't understand, I thought we escaped all the lines with # TEST_USE_PROD_DATA already so it should not break it on multiple lines. Will ask Trevor for the escape.

The escape for the precommit autoformater to avoid wrapping the line was already done in this commit: Ouranosinc/pavics-sdi@75652fb

Now sure how this escape got lost. I'll just restore it.

@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/1144/
Result : failure

BIRDHOUSE_DEPLOY_BRANCH : restore-jupyter-terminal-and-allow-recursive-folder-deletion
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 :

NOTEBOOK TEST RESULTS
    
</code>

@crim-jenkins-bot
Copy link
Collaborator

E2E Test Results

DACCS-iac Pipeline Results

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

BIRDHOUSE_DEPLOY_BRANCH : restore-jupyter-terminal-and-allow-recursive-folder-deletion
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 :

NOTEBOOK TEST RESULTS
    
</code>

huard added a commit to Ouranosinc/pavics-sdi that referenced this pull request Jan 26, 2023
…277)

Should have used the climex link on PAVICS prod server instead of the
test server.

`TEST_USE_PROD_DATA` should be on the same line as "pavics.ouranos.ca"
to avoid it being replaced by the test server during Jenkins run.

The precommit autoformatter should not break that line.

See previous fix that was lost, not sure why

75652fb
(PR #267)

Jenkins failure found in PR
bird-house/birdhouse-deploy#280 (comment):
```
10:36:34  _________ pavics-sdi-master/docs/source/notebooks/climex.ipynb::Cell 0 _________
10:36:34  Notebook cell execution failed
10:36:34  Cell 0: Cell execution caused an exception
10:36:34  
10:36:34  Input:
10:36:34  import shutil
10:36:34  
10:36:34  import intake
10:36:34  import xarray as xr
10:36:34  import xclim
10:36:34  from clisops.core.subset import subset_gridpoint
10:36:34  from dask.diagnostics import ProgressBar
10:36:34  from dask.distributed import Client, LocalCluster
10:36:34  from IPython.display import HTML, Markdown
10:36:34  from xclim import ensembles as xens
10:36:34  
10:36:34  cat = intake.open_esm_datastore(
10:36:34      "https://host-140-154.rdext.crim.ca/catalog/climex.json"
10:36:34  )  # TEST_USE_PROD_DATA
10:36:34  cat.df.head()
10:36:34  
10:36:34  Traceback:
10:36:34  
10:36:34  ---------------------------------------------------------------------------
10:36:34  JSONDecodeError                           Traceback (most recent call last)
10:36:34  File /opt/conda/envs/birdy/lib/python3.8/site-packages/requests/models.py:971, in Response.json(self, **kwargs)
10:36:34      970 try:
10:36:34  --> 971     return complexjson.loads(self.text, **kwargs)
10:36:34      972 except JSONDecodeError as e:
10:36:34      973     # Catch JSON-related errors and raise as requests.JSONDecodeError
10:36:34      974     # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
10:36:34  
10:36:34  File /opt/conda/envs/birdy/lib/python3.8/json/__init__.py:357, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
10:36:34      354 if (cls is None and object_hook is None and
10:36:34      355         parse_int is None and parse_float is None and
10:36:34      356         parse_constant is None and object_pairs_hook is None and not kw):
10:36:34  --> 357     return _default_decoder.decode(s)
10:36:34      358 if cls is None:
10:36:34  
10:36:34  File /opt/conda/envs/birdy/lib/python3.8/json/decoder.py:337, in JSONDecoder.decode(self, s, _w)
10:36:34      333 """Return the Python representation of ``s`` (a ``str`` instance
10:36:34      334 containing a JSON document).
10:36:34      335 
10:36:34      336 """
10:36:34  --> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
10:36:34      338 end = _w(s, end).end()
10:36:34  
10:36:34  File /opt/conda/envs/birdy/lib/python3.8/json/decoder.py:355, in JSONDecoder.raw_decode(self, s, idx)
10:36:34      354 except StopIteration as err:
10:36:34  --> 355     raise JSONDecodeError("Expecting value", s, err.value) from None
10:36:34      356 return obj, end
10:36:34  
10:36:34  JSONDecodeError: Expecting value: line 4 column 1 (char 3)
10:36:34  
10:36:34  During handling of the above exception, another exception occurred:
10:36:34  
10:36:34  JSONDecodeError                           Traceback (most recent call last)
10:36:34  Cell In [1], line 12
10:36:34        9 from IPython.display import HTML, Markdown
10:36:34       10 from xclim import ensembles as xens
10:36:34  ---> 12 cat = intake.open_esm_datastore(
10:36:34       13     "https://host-140-154.rdext.crim.ca/catalog/climex.json"
10:36:34       14 )  # TEST_USE_PROD_DATA
10:36:34       15 cat.df.head()
10:36:34  
10:36:34  File /opt/conda/envs/birdy/lib/python3.8/site-packages/intake_esm/core.py:83, in esm_datastore.__init__(self, esmcol_obj, esmcol_data, progressbar, sep, csv_kwargs, **kwargs)
10:36:34       81 super(esm_datastore, self).__init__(**kwargs)
10:36:34       82 if isinstance(esmcol_obj, (str, pathlib.PurePath)):
10:36:34  ---> 83     self.esmcol_data, self.esmcol_path = _fetch_and_parse_json(esmcol_obj)
10:36:34       84     self._df, self.catalog_file = _fetch_catalog(self.esmcol_data, esmcol_obj, csv_kwargs)
10:36:34       86 elif isinstance(esmcol_obj, pd.DataFrame):
10:36:34  
10:36:34  File /opt/conda/envs/birdy/lib/python3.8/site-packages/intake_esm/utils.py:59, in _fetch_and_parse_json(input_path)
10:36:34       56             data = json.load(filein)
10:36:34       58 except Exception as exc:
10:36:34  ---> 59     raise exc
10:36:34       61 return data, input_path
10:36:34  
10:36:34  File /opt/conda/envs/birdy/lib/python3.8/site-packages/intake_esm/utils.py:52, in _fetch_and_parse_json(input_path)
10:36:34       50 if _is_valid_url(input_path):
10:36:34       51     resp = requests.get(input_path)
10:36:34  ---> 52     data = resp.json()
10:36:34       53 else:
10:36:34       54     input_path = Path(input_path).absolute().as_posix()
10:36:34  
10:36:34  File /opt/conda/envs/birdy/lib/python3.8/site-packages/requests/models.py:975, in Response.json(self, **kwargs)
10:36:34      971     return complexjson.loads(self.text, **kwargs)
10:36:34      972 except JSONDecodeError as e:
10:36:34      973     # Catch JSON-related errors and raise as requests.JSONDecodeError
10:36:34      974     # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
10:36:34  --> 975     raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
10:36:34  
10:36:34  JSONDecodeError: Expecting value: line 4 column 1 (char 3)
```
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