How to use the seml.manage.mongodb_credentials_prompt function in seml

To help you get started, we’ve selected a few seml examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TUM-DAML / seml / seml / View on Github external
"Each experiment is represented as a record in the database. "
                        "See examples/ for more details.",
            'db_collection_name', type=str, nargs='?', default=None,
            help="Name of the database collection for the experiment.")
            '--verbose', '-v', action='store_true',
            help='Display more log messages.')

    subparsers = parser.add_subparsers(title="Possible operations")

    parser_configure = subparsers.add_parser(
        help="Provide your MongoDB credentials.")

    parser_queue = subparsers.add_parser(
            help="Queue the experiments as defined in the configuration.")
            'config_file', type=str, nargs='?', default=None,
            help="Path to the YAML configuration file for the experiment.")
            '-nh', '--no-hash', action='store_true',
            help="Do not use the hash of the config dictionary to filter out duplicates (by comparing all"
                 "dictionary values individually). This is much  slower, so use only if you have a good reason not to"
                 " use the hash.")
            '-nc', '--no-config-check', action='store_true',
            help="Do not check the config for missing/unused arguments. "
                 "Use this if the check fails unexpectedly when using "
github TUM-DAML / seml / seml / View on Github external
help="Scan all collections for orphaned artifacts (not just the one provided in the config).")

    args = parser.parse_args()

    # Initialize logging
    if args.verbose:
        logging_level = logging.VERBOSE
        logging_level = logging.INFO
    hdlr = logging.StreamHandler(sys.stderr)

    if args.func == mongodb_credentials_prompt:  # launch SEML configure.
        del args.db_collection_name
    else:  # otherwise remove the flag as it is not used elsewhere.
        if not args.db_collection_name:
            parser.error("the following arguments are required: db_collection_name")
            if os.path.isfile(args.db_collection_name):
                logging.warning("Loading the collection name from a config file. This has been deprecated. "
                                "Please instead provide a database collection name in the command line.")
                seml_config, _, _ = read_config(args.db_collection_name)
                if args.func == queue_experiments:
                    args.config_file = args.db_collection_name
                args.db_collection_name = seml_config['db_collection']
            elif args.func == queue_experiments and not args.config_file:
                parser_queue.error("the following arguments are required: config_file")

    f = args.func