def main(): # pylint: disable=too-many-locals logging.getLogger().setLevel(logging.INFO) # pylint: disable=too-many-locals util.maybe_activate_service_account() parser = build_parser() # parse the args and call whatever function was selected args = parser.parse_args() args.func(args)
def main(): # pylint: disable=too-many-locals logging.getLogger().setLevel(logging.INFO) # pylint: disable=too-many-locals util.maybe_activate_service_account() # create the top-level parser parser = argparse.ArgumentParser(description="Setup clusters for testing.") subparsers = parser.add_subparsers() ############################################################################# # setup # parser_setup = subparsers.add_parser("setup", help="Setup a cluster for testing.") parser_setup.add_argument( "--accelerator", dest="accelerators", action="append", help= "Accelerator to add to the cluster. Should be of the form type=count.") parser_setup.set_defaults(func=setup) add_common_args(parser_setup) parser_setup.add_argument( "--test_app_dir", help="The directory containing the ksonnet app used for testing.", ) now = datetime.datetime.now() parser_setup.add_argument( "--namespace", default="kubeflow-" + now.strftime("%m%d-%H%M-") + uuid.uuid4().hex[0:4], help="The directory containing the ksonnet app used for testing.", ) parser_setup.add_argument( "--image", help="The image to use", ) ############################################################################# # teardown # parser_teardown = subparsers.add_parser("teardown", help="Teardown the cluster.") parser_teardown.set_defaults(func=teardown) add_common_args(parser_teardown) # parse the args and call whatever function was selected args = parser.parse_args() args.func(args)
def main(): # pylint: disable=too-many-locals logging.getLogger().setLevel(logging.INFO) # pylint: disable=too-many-locals util.maybe_activate_service_account() # create the top-level parser parser = argparse.ArgumentParser(description="Setup clusters for testing.") subparsers = parser.add_subparsers() ############################################################################# # setup # parser_setup = subparsers.add_parser("setup", help="Setup a cluster for testing.") parser_setup.add_argument( "--accelerator", dest="accelerators", action="append", help= "Accelerator to add to the cluster. Should be of the form type=count.") parser_setup.set_defaults(func=setup) add_common_args(parser_setup) parser_setup.add_argument("--chart", type=str, required=True, help="The path for the helm chart.") ############################################################################# # test # parser_test = subparsers.add_parser("test", help="Run the tests.") parser_test.set_defaults(func=test) add_common_args(parser_test) ############################################################################# # teardown # parser_teardown = subparsers.add_parser("teardown", help="Teardown the cluster.") parser_teardown.set_defaults(func=teardown) add_common_args(parser_teardown) # parse the args and call whatever function was selected args = parser.parse_args() args.func(args)
def main(): # pylint: disable=too-many-locals logging.getLogger().setLevel(logging.INFO) # pylint: disable=too-many-locals logging.basicConfig(level=logging.INFO, format=('%(levelname)s|%(asctime)s' '|%(pathname)s|%(lineno)d| %(message)s'), datefmt='%Y-%m-%dT%H:%M:%S', ) util.maybe_activate_service_account() parser = build_parser() # parse the args and call whatever function was selected args = parser.parse_args() args.func(args)