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

✨ Is2805/can disable exporter with envs (⚠️ devops) #2814

Merged

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Feb 9, 2022

What do these changes do?

We can now disable webserver's exporter plugin via env vars as WEBSERVER_EXPORTER=null.

  • @mrnicegyu11 @Surfict Please adjust configs in different deployments accordingly and set WEBSERVER_EXPORTER=null where required to disable export feature (⚠️ devops)
  • @odeimaiz since the front-end needs to disable some components as well, should I add a flag with the to check if the exporter plugin is enabled/disabled in the static data? DONE (see below)
  • @GitHK @sanderegg This is also a first (simple) test of the plugin mechanism based on the new settings that we will be using later to decouple the full exporter (and gc, etc)

Related issue/s

Until proper fix, it temporary avoids issues in

How to test

If webserver started wiht INFO it should log

INFO: simcore_service_webserver.application_settings:setup_settings(191) - Captured app settings:
{
 "API_VERSION": "0.7.0",
 "APP_NAME": "simcore_service_webserver",
 "API_VTAG": "v0",
 
  # ...

 "WEBSERVER_EXPORTER": null,

  # ... 

Checklist

  • Openapi changes? make openapi-specs, git commit ... and then make version-*)
  • Database migration script? cd packages/postgres-database, make setup-commit, sc-pg review -m "my changes"
  • Unit tests for the changes exist
  • Runs in the swarm
  • Documentation reflects the changes
  • New module? Add your github username to .github/CODEOWNERS

@pcrespov pcrespov self-assigned this Feb 9, 2022
@pcrespov pcrespov added this to the R.Schumann milestone Feb 9, 2022
@codecov
Copy link

codecov bot commented Feb 9, 2022

Codecov Report

Merging #2814 (9549694) into master (171d5f5) will increase coverage by 0.0%.
The diff coverage is 74.0%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #2814   +/-   ##
======================================
  Coverage    78.9%   78.9%           
======================================
  Files         670     670           
  Lines       27236   27257   +21     
  Branches     3141    3146    +5     
======================================
+ Hits        21495   21518   +23     
+ Misses       4985    4980    -5     
- Partials      756     759    +3     
Flag Coverage Δ
integrationtests 65.8% <40.7%> (-0.2%) ⬇️
unittests 74.4% <66.6%> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...simcore_service_webserver/exporter/module_setup.py 78.9% <42.8%> (-21.1%) ⬇️
.../simcore_service_webserver/application_settings.py 91.9% <81.2%> (-1.3%) ⬇️
...core_service_webserver/exporter/file_downloader.py 100.0% <100.0%> (ø)
...ore_service_webserver/exporter/request_handlers.py 91.4% <100.0%> (+0.1%) ⬆️
...src/simcore_service_webserver/exporter/settings.py 100.0% <100.0%> (ø)
...rvice-library/src/servicelib/common_aiopg_utils.py 88.2% <0.0%> (-8.9%) ⬇️
...ector_v2/modules/comp_scheduler/background_task.py 82.9% <0.0%> (-8.6%) ⬇️
...rector_v2/modules/comp_scheduler/base_scheduler.py 83.2% <0.0%> (-2.1%) ⬇️
.../src/simcore_service_webserver/director_v2_core.py 66.8% <0.0%> (-1.1%) ⬇️
...car/src/simcore_service_dask_sidecar/dask_utils.py 89.6% <0.0%> (-1.1%) ⬇️
... and 8 more

@pcrespov pcrespov requested a review from GitHK February 9, 2022 15:56
@pcrespov pcrespov force-pushed the is2805/can-disable-exporter-with-envs branch from 28237e8 to 28a8c70 Compare February 9, 2022 17:23
@pcrespov pcrespov added the a:webserver issue related to the webserver service label Feb 9, 2022
@KZzizzle
Copy link
Contributor

KZzizzle commented Feb 9, 2022

thanks for the notice!

@odeimaiz
Copy link
Member

odeimaiz commented Feb 9, 2022

  • @odeimaiz since the front-end needs to disable some components as well, should I add a flag with the to check if the exporter plugin is enabled/disabled in the static data?

👌

@pcrespov
Copy link
Member Author

pcrespov commented Feb 9, 2022

  • @odeimaiz since the front-end needs to disable some components as well, should I add a flag with the to check if the exporter plugin is enabled/disabled in the static data?

👌

I added pluginsDisabled that lists the name of plugins that are disabled in the backend.

{
 "apiVersion": "0.7.0",
 "appName": "simcore_service_webserver",
 "buildDate": "2022-01-09T12:26:29Z",
 "vcsRef": "dd536f998",
 "vcsUrl": "git@github.com:ITISFoundation/osparc-simcore.git",
 "stackName": "master-simcore",
 "pluginsDisabled": [
  "WEBSERVER_EXPORTER",
  "WEBSERVER_SCICRUNCH"
 ]
}

@pcrespov pcrespov changed the title Is2805/can disable exporter with envs (⚠️ devops) ✨ Is2805/can disable exporter with envs (⚠️ devops) Feb 9, 2022
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

Nice!
I'd like that all requests in the exporter to fail as fast as possible if the exporter is disabled.

Copy link
Member

@mrnicegyu11 mrnicegyu11 left a comment

Choose a reason for hiding this comment

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

lgtm thanks for this

Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

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

Thanks!

@pcrespov
Copy link
Member Author

I'd like that all requests in the exporter to fail as fast as possible if the exporter is disabled.

When the plugin is disabled, the app has no routes to export projects and therefore it responds I guess with a 404 Not Found or 405 Method Not Allowed as soon as it is requested ...

Is there any other way to use the exporter other than through the designated entrypoints?

@GitHK
Copy link
Contributor

GitHK commented Feb 10, 2022

I'd like that all requests in the exporter to fail as fast as possible if the exporter is disabled.

When the plugin is disabled, the app has no routes to export projects and therefore it responds I guess with a 404 Not Found or 405 Method Not Allowed as soon as it is requested ...

Is there any other way to use the exporter other than through the designated entrypoints?

Yes, we also discussed about it. No there are no other ways to use it.

@pcrespov pcrespov requested a review from GitHK February 10, 2022 08:40
@pcrespov pcrespov force-pushed the is2805/can-disable-exporter-with-envs branch from 70a1979 to 9549694 Compare February 10, 2022 08:42
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

👍

@pcrespov pcrespov merged commit a54c0ea into ITISFoundation:master Feb 10, 2022
@pcrespov pcrespov deleted the is2805/can-disable-exporter-with-envs branch February 10, 2022 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants