Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Manager class for applications using Task API #4657

Merged
merged 1 commit into from
Aug 29, 2019
Merged

Manager class for applications using Task API #4657

merged 1 commit into from
Aug 29, 2019

Conversation

Wiezzel
Copy link

@Wiezzel Wiezzel commented Aug 28, 2019

Stores application definitions and state (enabled/disabled). Uses EnvironmentManager to enforce that the appropriate environment is available and enabled before enabling an application. Definitions can be loaded from JSON files.

@Wiezzel Wiezzel added the clay label Aug 28, 2019
@Wiezzel Wiezzel self-assigned this Aug 28, 2019
golem/app_manager.py Outdated Show resolved Hide resolved
golem/app_manager.py Outdated Show resolved Hide resolved
Stores application definitions and state (enabled/disabled). Uses
EnvironmentManager to enforce that the appropriate environment is
available and enabled before enabling an application. Definitions can be
loaded from JSON files.

Signed-off-by: Adam Wierzbicki <awierzbicki@golem.network>
@codecov
Copy link

codecov bot commented Aug 29, 2019

Codecov Report

Merging #4657 into develop will increase coverage by 1.14%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #4657      +/-   ##
===========================================
+ Coverage    89.15%   90.29%   +1.14%     
===========================================
  Files          224      225       +1     
  Lines        20208    20264      +56     
===========================================
+ Hits         18016    18298     +282     
+ Misses        2192     1966     -226

@Wiezzel Wiezzel merged commit 18257a5 into develop Aug 29, 2019
@Wiezzel Wiezzel deleted the app_manager branch August 29, 2019 12:30
if app_name not in self._apps:
raise ValueError(f"Application '{app_name}' not registered.")
env_id = self._apps[app_name].requestor_env
if not self._env_manager.enabled(env_id):
Copy link
Contributor

Choose a reason for hiding this comment

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

EnvManager is only required for this single sanity check, I wonder if it's justified to make it a dependency. Especially that you can disable the environment just after enabling the app, thus introducing "invalid" state anyway. Maybe just performing these checks in the RequestedTaskManager when necessary is better.

Copy link
Contributor

Choose a reason for hiding this comment

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

My reasoning is basically that if you don't allow to enable an app when the env is disabled you should disable all the apps when disabling the env as well - which we're not doing. It'd be circular dependency meaning that these classes should be merged, which doesn't make sense. Thus removing this check makes sense to me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants