-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mpc_game entity/repository migrate from fbpcp to fbpcs (#1909)
Summary: Pull Request resolved: #1909 ## Why In next couple weeks, I'm going to migrate mpc service from fbpcp to fbpcs. This is the first guard to avoid any further changes in fbpcp's mpc realted files detailed plan: https://docs.google.com/document/d/1qR1XVVCA2By95tldl2Ey9m__GKX3raodGAZ5yK9SCEw/edit?usp=sharing ## What - hg copy `mpc_game_config.py` from fbpcp to fbpcs - hg copy `mpc_game_repository.py` as as well - change import to fbpcs Reviewed By: musebc Differential Revision: D41201899 fbshipit-source-id: 8a9de4f03188febcbfece0c8d9badd2c559b4d42
- Loading branch information
1 parent
0f1ea11
commit 2a47a09
Showing
8 changed files
with
68 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
fbpcs/private_computation/service/mpc/entity/mpc_game_config.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
# pyre-strict | ||
|
||
from dataclasses import dataclass | ||
from typing import List | ||
|
||
|
||
@dataclass | ||
class MPCGameArgument: | ||
name: str | ||
required: bool | ||
|
||
|
||
@dataclass | ||
class MPCGameConfig: | ||
game_name: str | ||
onedocker_package_name: str | ||
arguments: List[MPCGameArgument] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
fbpcs/private_computation/service/mpc/repository/mpc_game_repository.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
# pyre-strict | ||
|
||
import abc | ||
|
||
from fbpcs.private_computation.service.mpc.entity.mpc_game_config import MPCGameConfig | ||
|
||
|
||
class MPCGameRepository(abc.ABC): | ||
@abc.abstractmethod | ||
def get_game(self, name: str) -> MPCGameConfig: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters