Skip to content

Commit

Permalink
Merge pull request #5345 from FederatedAI/feature-2.0.0-rc-component-…
Browse files Browse the repository at this point in the history
…blacklist

add components blacklist
  • Loading branch information
sagewe authored Dec 19, 2023
2 parents b5ff7cd + 4948b7e commit 4c2337b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions configs/default.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
components:
blacklist: []

safety:
serdes:
# supported types: unrestricted, restricted
Expand Down
4 changes: 4 additions & 0 deletions python/fate/arch/config/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ def federation(self):
def safety(self):
return self.config.safety

@property
def components(self):
return self.config.components

Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ def execute(
logger.debug(f"task config: {task_config}")

os.makedirs(os.path.dirname(execution_final_meta_path), exist_ok=True)

from fate.arch.config import cfg

if task_config.component in cfg.components.blacklist:
raise RuntimeError(f"component `{task_config.component}` is in blacklist, do not use it")

execute_component_from_config(task_config, execution_final_meta_path)


Expand Down

0 comments on commit 4c2337b

Please sign in to comment.