Esempio n. 1
0
def main():
    parser = make_parser()
    args = parser.parse_args(sys.argv[1:])

    if args.model_scale < 1:
        raise ValueError('model_scale should be >= 1.')

    if args.seed != -1:
        set_seed(args.seed)

    config = tf.ConfigProto()
    config.gpu_options.allow_growth = True
    if args.ngpus > 1:
        hvd.init()
        config.gpu_options.visible_device_list = str(hvd.local_rank())
    else:
        os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
        os.environ["CUDA_VISIBLE_DEVICES"] = args.gpu

    if args.is_training:

        files = get_files(args.dataset_root_folder, args.allowed_categories,
                          args.blacklisted_categories, args.training_splits,
                          args.splits_folder_name, args.grasps_folder_name)

        random.shuffle(files)
        print('files ====>', files)
        print(len(files))

        main_train(args, files, config)
    else:
        raise NotImplementedError(
            'This is the train script. is_training should be 1')
Esempio n. 2
0
def make_parser():
    ''' Parser for input arguments '''
    arguments = [
        utils.Argument.CONDA_BUILD_CONFIG, utils.Argument.OUTPUT_FOLDER,
        utils.Argument.CHANNELS, utils.Argument.ENV_FILE,
        utils.Argument.REPOSITORY_FOLDER, utils.Argument.PYTHON_VERSIONS,
        utils.Argument.BUILD_TYPES
    ]
    parser = utils.make_parser(
        arguments,
        description='Build conda environment as part of Open-CE',
        formatter_class=argparse.ArgumentDefaultsHelpFormatter)

    parser.add_argument(
        '--git_location',
        type=str,
        default=utils.DEFAULT_GIT_LOCATION,
        help='The default location to clone git repositories from.')

    parser.add_argument(
        '--git_tag_for_env',
        type=str,
        default=None,
        help=
        'Git tag to be checked out for all of the packages in an environment.')

    parser.add_argument('--docker_build',
                        action='store_true',
                        help="""Perform a build within a docker container.
NOTE: When the --docker_build flag is used, all arguments with paths should be relative to the
directory containing open-ce. Only files within the open-ce directory and local_files will
be visible at build time.""")

    return parser
Esempio n. 3
0
def make_parser():
    ''' Parser for input arguments '''
    arguments = [
        utils.Argument.CONDA_BUILD_CONFIG, utils.Argument.OUTPUT_FOLDER,
        utils.Argument.CHANNELS, utils.Argument.ENV_FILE,
        utils.Argument.REPOSITORY_FOLDER, utils.Argument.PYTHON_VERSIONS,
        utils.Argument.BUILD_TYPES, utils.Argument.MPI_TYPES,
        utils.Argument.DOCKER_BUILD
    ]
    parser = utils.make_parser(
        arguments, description='Build conda environment as part of Open-CE')

    parser.add_argument(
        '--git_location',
        type=str,
        default=utils.DEFAULT_GIT_LOCATION,
        help='The default location to clone git repositories from.')

    parser.add_argument(
        '--git_tag_for_env',
        type=str,
        default=None,
        help=
        'Git tag to be checked out for all of the packages in an environment.')

    return parser
Esempio n. 4
0
def _make_parser():
    ''' Parser input arguments '''
    parser = utils.make_parser([
        git_utils.Argument.PUBLIC_ACCESS_TOKEN, git_utils.Argument.REPO_DIR,
        git_utils.Argument.BRANCH
    ],
                               description='Tag all repos in an organization.')

    parser.add_argument('github_org', type=str, help="""Github org to tag.""")

    parser.add_argument('--tag',
                        type=str,
                        required=True,
                        help="""Tag to create.""")

    parser.add_argument('--tag-msg',
                        type=str,
                        required=True,
                        help="""Tag message to use.""")

    parser.add_argument(
        '--skipped_repos',
        type=str,
        default="",
        help="""Comma delimitted list of repos to skip tagging.""")

    return parser
Esempio n. 5
0
def make_parser():
    ''' Parser for input arguments '''
    arguments = [utils.Argument.DOCKER_BUILD]
    parser = utils.make_parser(
        arguments, description='Run Open-CE tools within a container')

    return parser
Esempio n. 6
0
def _make_parser():
    ''' Parser input arguments '''
    parser = utils.make_parser([git_utils.Argument.PUBLIC_ACCESS_TOKEN, git_utils.Argument.REPO_DIR,
                                git_utils.Argument.BRANCH],
                               description = 'A script that can be used to cut an open-ce release.')

    parser.add_argument(
        '--github-org',
        type=str,
        default="open-ce",
        help="""Org to cut an Open-CE release in.""")

    parser.add_argument(
        '--primary-repo',
        type=str,
        default="open-ce",
        help="""Primary open-ce repo.""")

    parser.add_argument(
        '--version',
        type=str,
        required=True,
        help="""Release version to cut.""")

    parser.add_argument(
        '--code-name',
        type=str,
        default=None,
        help="""Code name for release.""")

    return parser
Esempio n. 7
0
def make_parser():
    ''' Parser for input arguments '''
    arguments = [
        utils.Argument.ENV_FILE, utils.Argument.PYTHON_VERSIONS,
        utils.Argument.BUILD_TYPES
    ]
    parser = utils.make_parser(arguments, description='Lint Environment Files')
    return parser
Esempio n. 8
0
def make_parser():
    ''' Parser input arguments '''
    arguments = [utils.Argument.CONDA_BUILD_CONFIG, utils.Argument.ENV_FILE,
                 utils.Argument.REPOSITORY_FOLDER, utils.Argument.PYTHON_VERSIONS,
                 utils.Argument.BUILD_TYPES, utils.Argument.MPI_TYPES]
    parser = utils.make_parser(arguments,
                               description = 'Perform validation on a conda_build_config.yaml file.')
    return parser
Esempio n. 9
0
def make_parser():
    ''' Parser for input arguments '''
    arguments = [
        utils.Argument.ENV_FILE, utils.Argument.PYTHON_VERSIONS,
        utils.Argument.BUILD_TYPES
    ]
    parser = utils.make_parser(
        arguments,
        description='Lint Environment Files',
        formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    return parser
Esempio n. 10
0
def make_parser():
    ''' Parser for input arguments '''
    arguments = [
        utils.Argument.PYTHON_VERSIONS, utils.Argument.BUILD_TYPES,
        utils.Argument.MPI_TYPES
    ]
    parser = utils.make_parser(
        arguments,
        description='PR Test for Feedstocks',
        formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    return parser
Esempio n. 11
0
def make_parser():
    ''' Parser input arguments '''
    arguments = [
        utils.Argument.CONDA_BUILD_CONFIG, utils.Argument.ENV_FILE,
        utils.Argument.REPOSITORY_FOLDER, utils.Argument.PYTHON_VERSIONS,
        utils.Argument.BUILD_TYPES
    ]
    parser = utils.make_parser(
        arguments,
        description='Perform validation on a cond_build_config.yaml file.',
        formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    return parser
Esempio n. 12
0
def make_parser():
    ''' Parser input arguments '''
    arguments = [
        utils.Argument.CONDA_BUILD_CONFIG, utils.Argument.OUTPUT_FOLDER,
        utils.Argument.CHANNELS, utils.Argument.PYTHON_VERSIONS,
        utils.Argument.BUILD_TYPES
    ]
    parser = utils.make_parser(
        arguments,
        description='Build conda packages as part of Open-CE',
        formatter_class=argparse.ArgumentDefaultsHelpFormatter)

    parser.add_argument(
        '--recipe-config-file',
        type=str,
        default=None,
        help="""Path to the recipe configuration YAML file. The configuration
file lists paths to recipes to be built within a feedstock.

Below is an example stating that there are two recipes to build,
one named my_project and one named my_variant.

recipes:
  - name : my_project
    path : recipe

  - name : my_variant
    path: variants

If no path is given, the default value is build-config.yaml.
If build-config.yaml does not exist, and no value is provided,
it will be assumed there is a single recipe with the
path of \"recipe\".""")

    parser.add_argument('--recipes',
                        dest='recipe_list',
                        action='store',
                        default=None,
                        help='Comma separated list of recipe names to build.')

    parser.add_argument('--working_directory',
                        type=str,
                        help='Directory to run the script in.')

    parser.add_argument(
        '--local_src_dir',
        type=str,
        required=False,
        help=
        'Path where package source is downloaded in the form of RPM/Debians/Tar.'
    )

    return parser
Esempio n. 13
0
import argparse
import json
import logging
from utils import (HostNameValueError, basic_test_webaddr_ssl,
                   test_crl_distribution_list, make_parser)

args = make_parser().parse_args()
if args.noCRLMeansInvalid and not args.verifyCrl:
    parser.error(
        'The --noCRLMeansInvalid argument requires the --verifyCrl flag')

INPUT_FILE = args.inputfile
OUTPUT_FILE = args.outfile
NO_CRL_MEANS_INVALID = args.noCRLMeansInvalid
USE_CRL = args.verifyCrl

#grap lines from INPUT_FILE
with open(INPUT_FILE, 'r') as list_file_reader:
    raw_website_list = list_file_reader.readlines()
    #strip all the lines and skip empty lines
    raw_website_list = [
        line for line in map(lambda x: x.strip(), raw_website_list)
        if line != ''
    ]
"""
Loop through each website, extract the host,
Then verify it with an ssl handshake. and downlod
the cert details. add two fields to the cert data:
IS_VALID and WEB_ADDRESS  throug the function
basic_test_webaddr_ssl
"""