예제 #1
0
def main():
    parser = optparse.OptionParser()
    parser.add_option("--build_type", dest="build_type", default="RELEASE")
    parser.add_option("--mode",
                      choices=['orca', 'codegen', 'orca_codegen', 'planner'],
                      default="orca_codegen")
    parser.add_option("--compiler", dest="compiler")
    parser.add_option("--cxxflags", dest="cxxflags")
    parser.add_option("--output_dir", dest="output_dir", default="install")
    (options, args) = parser.parse_args()
    if options.mode == 'orca':
        ciCommon = GpBuild(options.mode)
    elif options.mode == 'planner':
        ciCommon = GpBuild(options.mode)

    for dependency in args:
        status = ciCommon.install_dependency(dependency)
        if status:
            return status
    status = ciCommon.configure()
    if status:
        return status
    status = make(ciCommon.num_cpus())
    if status:
        return status
    status = unittest()
    if status:
        return status
    status = install(options.output_dir)
    if status:
        return status
    return 0
예제 #2
0
파일: test_gpdb.py 프로젝트: ielizaga/gpdb
def main():
    parser = optparse.OptionParser()
    parser.add_option("--build_type", dest="build_type", default="RELEASE")
    parser.add_option("--mode",
                      choices=['orca', 'codegen', 'orca_codegen', 'planner'])
    parser.add_option("--compiler", dest="compiler")
    parser.add_option("--cxxflags", dest="cxxflags")
    parser.add_option("--output_dir", dest="output_dir", default="install")
    parser.add_option("--gpdb_name", dest="gpdb_name")
    (options, args) = parser.parse_args()
    if options.mode == 'orca':
        ciCommon = GpBuild(options.mode)
    elif options.mode == 'planner':
        ciCommon = GpBuild(options.mode)

    for dependency in args:
        status = ciCommon.install_dependency(dependency)
        if status:
            return status
    status = install_gpdb(options.gpdb_name)
    if status:
        return status
    status = ciCommon.configure()
    if status:
        return status
    status = create_gpadmin_user()
    if status:
        return status
    if os.getenv("TEST_SUITE", "icg") == 'icw':
        status = ciCommon.install_check('world')
    else:
        status = ciCommon.install_check()
    if status:
        copy_output()
    return status
예제 #3
0
파일: build_gpdb.py 프로젝트: 50wu/gpdb
def main():
    parser = optparse.OptionParser()
    parser.add_option("--build_type", dest="build_type", default="RELEASE")
    parser.add_option("--mode", choices=['orca', 'codegen', 'orca_codegen', 'planner'], default="orca_codegen")
    parser.add_option("--compiler", dest="compiler")
    parser.add_option("--cxxflags", dest="cxxflags")
    parser.add_option("--output_dir", dest="output_dir", default="install")
    (options, args) = parser.parse_args()
    if options.mode == 'orca':
        ciCommon = GpBuild(options.mode)
    elif options.mode == 'planner':
        ciCommon = GpBuild(options.mode)

    for dependency in args:
        status = ciCommon.install_dependency(dependency)
        if status:
            return status
    status = ciCommon.configure()
    if status:
        return status
    status = make(ciCommon.num_cpus())
    if status:
        return status
    status = unittest()
    if status:
        return status
    status = install(options.output_dir)
    if status:
        return status
    return 0
예제 #4
0
파일: test_gpdb.py 프로젝트: 50wu/gpdb
def main():
    parser = optparse.OptionParser()
    parser.add_option("--build_type", dest="build_type", default="RELEASE")
    parser.add_option("--mode",  choices=['orca', 'codegen', 'orca_codegen', 'planner'])
    parser.add_option("--compiler", dest="compiler")
    parser.add_option("--cxxflags", dest="cxxflags")
    parser.add_option("--output_dir", dest="output_dir", default="install")
    parser.add_option("--gpdb_name", dest="gpdb_name")
    (options, args) = parser.parse_args()
    if options.mode == 'orca':
        ciCommon = GpBuild(options.mode)
    elif options.mode == 'planner':
        ciCommon = GpBuild(options.mode)

    for dependency in args:
        status = ciCommon.install_dependency(dependency)
        if status:
            return status
    status = install_gpdb(options.gpdb_name)
    if status:
        return status
    status = ciCommon.configure()
    if status:
        return status
    status = create_gpadmin_user()
    if status:
        return status
    status = ciCommon.icg()
    if status:
        copy_output()
    return status
예제 #5
0
파일: build_gpdb.py 프로젝트: zfortier/gpdb
def main():
    parser = optparse.OptionParser()
    parser.add_option("--build_type", dest="build_type", default="RELEASE")
    parser.add_option("--mode", choices=[ORCA_MODE, CODEGEN_MODE, ORCA_CODEGEN_DEFAULT_MODE, PLANNER_MODE], default=ORCA_CODEGEN_DEFAULT_MODE)
    parser.add_option("--compiler", dest="compiler")
    parser.add_option("--cxxflags", dest="cxxflags")
    parser.add_option("--output_dir", dest="output_dir", default="install")
    (options, args) = parser.parse_args()
    ci_common = GpBuild(ORCA_CODEGEN_DEFAULT_MODE)
    if options.mode == ORCA_MODE:
        ci_common = GpBuild(options.mode)
    elif options.mode == PLANNER_MODE:
        ci_common = GpBuild(options.mode)

    for dependency in args:
        status = ci_common.install_dependency(dependency)
        if status:
            return status
    print_compiler_version()
    status = ci_common.configure()
    if status:
        return status
    status = make(ci_common.num_cpus())
    if status:
        return status
    status = unittest()
    if status:
        return status
    status = install(options.output_dir)
    if status:
        return status
    return 0
예제 #6
0
def main():
    parser = optparse.OptionParser()
    parser.add_option("--mode", choices=['orca', 'planner'])
    parser.add_option("--output_dir", dest="output_dir", default=INSTALL_DIR)
    parser.add_option(
        "--configure-option",
        dest="configure_option",
        action="append",
        help=
        "Configure flags, ex --configure_option=--disable-orca --configure_option=--disable-gpcloud"
    )
    parser.add_option("--action",
                      choices=['build', 'test', 'test_explain_suite'],
                      dest="action",
                      default='build',
                      help="Build GPDB or Run Install Check")
    parser.add_option("--dbexists",
                      dest="dbexists",
                      action="store_true",
                      default=False,
                      help="create new demo cluster")
    (options, args) = parser.parse_args()

    gpBuild = GpBuild(options.mode)

    status = gpBuild.install_dependency("bin_gpdb", INSTALL_DIR)
    fail_on_error(status)

    status = create_gpadmin_user()
    fail_on_error(status)
    status = gpBuild.run_explain_test_suite(options.dbexists)
    fail_on_error(status)
    status = tar_explain_output()
    fail_on_error(status)
    return 0
예제 #7
0
def main():
    parser = optparse.OptionParser()
    parser.add_option("--build_type", dest="build_type", default="RELEASE")
    parser.add_option("--mode", choices=['orca', 'planner'])
    parser.add_option("--compiler", dest="compiler")
    parser.add_option("--cxxflags", dest="cxxflags")
    parser.add_option("--output_dir", dest="output_dir", default=INSTALL_DIR)
    parser.add_option("--configure-option", dest="configure_option", action="append",
                      help="Configure flags, ex --configure_option=--disable-orca --configure_option=--disable-gpcloud")
    parser.add_option("--gcc-env-file", dest="gcc_env_file", help="GCC env file to be sourced")
    parser.add_option("--orca-in-gpdb-install-location", dest="orca_in_gpdb_install_location", action="store_true",
                      help="Install ORCA header and library files in GPDB install directory")
    parser.add_option("--action", choices=['build', 'test'], dest="action", default='build',
                      help="Build GPDB or Run Install Check")
    parser.add_option("--gpdb_name", dest="gpdb_name")
    (options, args) = parser.parse_args()

    gpBuild = GpBuild(options.mode)
    status = print_compiler_version()
    fail_on_error(status)

    # optional gcc env file to be source before executing configure, make, make install commands
    gpBuild.set_gcc_env_file(options.gcc_env_file)

    install_dir = INSTALL_DIR if options.orca_in_gpdb_install_location else DEPENDENCY_INSTALL_DIR
    if options.action == 'test':
        # if required, install orca and xerces library & header
        # in the install directory of gpdb to avoid packaging from multiple directories
        status = gpBuild.install_dependency(options.gpdb_name, INSTALL_DIR)
        fail_on_error(status)

    # install any dependencies specified on the command line
    status = install_dependencies(gpBuild, args, install_dir)
    fail_on_error(status)

    configure_option = []
    if options.configure_option:
        configure_option.extend(options.configure_option)

    # add DEPENDENCY_INSTALL_LOC and INSTALL_DIR paths to configure options
    configure_option.append(
        '"--with-libs={0} {1}"'.format(os.path.join(DEPENDENCY_INSTALL_DIR, "lib"), os.path.join(INSTALL_DIR, "lib")))
    configure_option.append('"--with-includes={0} {1}"'.format(os.path.join(DEPENDENCY_INSTALL_DIR, "include"),
                                                               os.path.join(INSTALL_DIR, "include")))
    gpBuild.append_configure_options(configure_option)

    status = gpBuild.configure()
    fail_on_error(status)

    # compile and install gpdb
    if options.action == 'build':
        status = gpBuild.make()
        fail_on_error(status)

        status = gpBuild.make_install()
        fail_on_error(status)

        status = gpBuild.unittest()
        fail_on_error(status)

        status = copy_installed(options.output_dir)
        fail_on_error(status)
    # run install-check tests
    elif options.action == 'test':
        status = create_gpadmin_user()
        fail_on_error(status)
        if os.getenv("TEST_SUITE", "icg") == 'icw':
            status = gpBuild.install_check('world')
        else:
            status = gpBuild.install_check()
        if status:
            copy_output()
        return status

    return 0