Skip to content

Commit

Permalink
cluster.py prints cluster config in env (#887)
Browse files Browse the repository at this point in the history
  • Loading branch information
qizhou authored Apr 22, 2020
1 parent 12b15d5 commit ce12e4f
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions quarkchain/cluster/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import psutil

from quarkchain.cluster.cluster_config import ClusterConfig
from quarkchain.env import DEFAULT_ENV


PYTHON = "pypy3" if platform.python_implementation() == "PyPy" else "python3"
Expand Down Expand Up @@ -147,9 +148,7 @@ def check_db(self):
self.start_and_loop()


def main():
logging.getLogger("asyncio").setLevel(logging.ERROR)
os.chdir(os.path.dirname(os.path.abspath(__file__)))
def parse_args():
parser = argparse.ArgumentParser()
ClusterConfig.attach_arguments(parser)
parser.add_argument("--profile", default="", type=str)
Expand All @@ -158,7 +157,20 @@ def main():
parser.add_argument("--check_db_rblock_batch", default=1, type=int)
args = parser.parse_args()

config = ClusterConfig.create_from_args(args)
env = DEFAULT_ENV.copy()
env.cluster_config = ClusterConfig.create_from_args(args)
env.arguments = args

return env


def main():
logging.getLogger("asyncio").setLevel(logging.ERROR)
os.chdir(os.path.dirname(os.path.abspath(__file__)))
env = parse_args()
config = env.cluster_config
args = env.arguments

print("Cluster config file: {}".format(config.json_filepath))
print(config.to_json())

Expand Down

0 comments on commit ce12e4f

Please sign in to comment.