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

♻️Webserver: refactor computations plugin (⚠️ devops) #4162

2 changes: 1 addition & 1 deletion .env-wb-garbage-collector
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

WEBSERVER_ACTIVITY=null
WEBSERVER_CATALOG=null
WEBSERVER_COMPUTATION=0
WEBSERVER_NOTIFICATIONS=0
WEBSERVER_DIAGNOSTICS=null
#WEBSERVER_DIRECTOR_V2 from .env
WEBSERVER_DIRECTOR=null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from .application_settings import setup_settings
from .catalog import setup_catalog
from .clusters.plugin import setup_clusters
from .computation import setup_computation
from .db import setup_db
from .diagnostics import setup_diagnostics
from .director.plugin import setup_director
Expand All @@ -26,6 +25,7 @@
from .login.plugin import setup_login
from .long_running_tasks import setup_long_running_tasks
from .meta_modeling.plugin import setup_meta_modeling
from .notifications.plugin import setup_notifications
from .products.plugin import setup_products
from .projects.plugin import setup_projects
from .publications import setup_publications
Expand Down Expand Up @@ -79,7 +79,7 @@ def create_application() -> web.Application:
# monitoring
setup_diagnostics(app)
setup_activity(app)
setup_computation(app)
setup_notifications(app)
setup_socketio(app)

# login
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):

# These plugins only require (for the moment) an entry to toggle between enabled/disabled
WEBSERVER_CLUSTERS: bool = False
WEBSERVER_COMPUTATION: bool = True
WEBSERVER_NOTIFICATIONS: bool = Field(
default=True, env=["WEBSERVER_NOTIFICATIONS", "WEBSERVER_COMPUTATION"]
)
WEBSERVER_GROUPS: bool = True
WEBSERVER_META_MODELING: bool = True
WEBSERVER_PRODUCTS: bool = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def convert_to_app_config(app_settings: ApplicationSettings) -> dict[str, Any]:
),
},
"clusters": {"enabled": app_settings.WEBSERVER_CLUSTERS},
"computation": {"enabled": app_settings.is_enabled("WEBSERVER_COMPUTATION")},
"computation": {"enabled": app_settings.is_enabled("WEBSERVER_NOTIFICATIONS")},
"diagnostics": {"enabled": app_settings.is_enabled("WEBSERVER_DIAGNOSTICS")},
"director-v2": {"enabled": app_settings.is_enabled("WEBSERVER_DIRECTOR_V2")},
"exporter": {"enabled": app_settings.WEBSERVER_EXPORTER is not None},
Expand Down Expand Up @@ -206,7 +206,6 @@ def _set_if_disabled(field_name, section):

if db := cfg.get("db"):
if section := db.get("postgres"):

envs["POSTGRES_DB"] = section.get("database")
envs["POSTGRES_HOST"] = section.get("host")
envs["POSTGRES_MAXSIZE"] = section.get("maxsize")
Expand Down Expand Up @@ -275,7 +274,7 @@ def _set_if_disabled(field_name, section):
envs["PROMETHEUS_VTAG"] = section.get("prometheus_api_version")

if section := cfg.get("computation"):
_set_if_disabled("WEBSERVER_COMPUTATION", section)
_set_if_disabled("WEBSERVER_NOTIFICATIONS", section)

if section := cfg.get("diagnostics"):
_set_if_disabled("WEBSERVER_DIAGNOSTICS", section)
Expand Down

This file was deleted.

Loading