def setup(program):
        from lib.config import Config
        Config.add_argument( "command",
                                help="Command to execute.",
                                metavar="COMMAND",
                                default="",
                                choices=[ "build",
                                          "show-releases", "show-builds", "show-sources",
                                          "remove-build","remove-sources",
                                          "check-this-system" ] )
        Config.add_argument( "--chronos-version",
                                dest="chronos_version",
                                help="Chronos version to build.",
                                metavar="CHRONOS_VERSION",
                                default=Utils.env_with_default("CHRONOS_VERSION","") )
        Config.add_argument( "--chronos-master-branch",
                                dest="chronos_master_branch",
                                help="Chronos master branch name.",
                                metavar="CHRONOS_MASTER_BRANCH_NAME",
                                default=Utils.env_with_default("CHRONOS_MASTER_BRANCH_NAME","master") )
        Config.add_argument( "--chronos-git-repository",
                                dest="chronos_git_repository",
                                help="Chronos git repository to use.",
                                metavar="CHRONOS_GIT_REPOSITORY",
                                default=Utils.env_with_default("CHRONOS_GIT_REPOSITORY", "https://github.com/mesos/chronos.git") )
        Config.add_argument( "--docker-templates",
                                dest="docker_templates_dir",
                                help="Docker templates base directory.",
                                metavar="DOCKER_TEMPLATES_DIR",
                                default=Utils.env_with_default("DOCKER_TEMPLATES_DIR", "{}/docker/chronos".format(
                                    os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
                                )))
        Config.add_argument( "--source-dir",
                                dest="source_dir",
                                help="Directory in which the Chronos sources are stored.",
                                metavar="SOURCE_DIR",
                                default=Utils.env_with_default("SOURCE_DIR", os.path.expanduser("~/.mesos-toolbox/chronos/sources") ) )
        Config.add_argument( "--packages-dir",
                                dest="packages_dir",
                                help="Directory in which packaged versions of Chronos are stored.",
                                metavar="PACKAGES_DIR",
                                default=Utils.env_with_default("PACKAGES_DIR", os.path.expanduser("~/.mesos-toolbox/chronos/packages") ) )
        Config.add_argument( "--work-dir",
                                dest="work_dir",
                                help="Directory in which this program does the work.",
                                metavar="WORK_DIR",
                                default=Utils.env_with_default("WORK_DIR", os.path.expanduser("~/.mesos-toolbox/chronos/temp") ) )
        Config.add_argument( "--m2-dir",
                                dest="m2_dir",
                                help="Maven dependencies directory.",
                                metavar="MVN_DIR",
                                default=Utils.env_with_default("MVN_DIR", os.path.expanduser("~/.mesos-toolbox/.m2/chronos") ) )
        Config.add_argument( "--with-tests",
                                dest="with_tests",
                                help="Run unit tests when building Chronos.",
                                action="store_true" )

        return Config.ready(program)
    def setup(program):
        from lib.config import Config
        Config.add_argument( "command",
                                help="Command to execute.",
                                metavar="COMMAND",
                                default="",
                                choices=[ "build",
                                          "show-releases", "show-builds", "show-sources",
                                          "remove-build","remove-sources" ] )
        Config.add_argument( "--marathon-version",
                                dest="marathon_version",
                                help="Marathon version to build.",
                                metavar="MARATHON_VERSION",
                                default=Utils.env_with_default("MARATHON_VERSION","") )
        Config.add_argument( "--marathon-master-branch",
                                dest="marathon_master_branch",
                                help="Marathon master branch name.",
                                metavar="MARATHON_MASTER_BRANCH_NAME",
                                default=Utils.env_with_default("MARATHON_MASTER_BRANCH_NAME","master") )
        Config.add_argument( "--marathon-git-repository",
                                dest="marathon_git_repository",
                                help="Marathon git repository to use.",
                                metavar="MARATHON_GIT_REPOSITORY",
                                default=Utils.env_with_default("MARATHON_GIT_REPOSITORY", "https://github.com/mesosphere/marathon.git") )
        Config.add_argument( "--docker-templates",
                                dest="docker_templates_dir",
                                help="Docker templates base directory.",
                                metavar="DOCKER_TEMPLATES_DIR",
                                default=Utils.env_with_default("DOCKER_TEMPLATES_DIR", "{}/docker/marathon".format(
                                    os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
                                )))
        Config.add_argument( "--source-dir",
                                dest="source_dir",
                                help="Directory in which the Marathon sources are stored.",
                                metavar="SOURCE_DIR",
                                default=Utils.env_with_default("SOURCE_DIR", os.path.expanduser("~/.mesos-toolbox/marathon/sources") ) )
        Config.add_argument( "--packages-dir",
                                dest="packages_dir",
                                help="Directory in which packaged versions of Mesos are stored.",
                                metavar="PACKAGES_DIR",
                                default=Utils.env_with_default("PACKAGES_DIR", os.path.expanduser("~/.mesos-toolbox/marathon/packages") ) )
        Config.add_argument( "--work-dir",
                                dest="work_dir",
                                help="Directory in which this program does the work.",
                                metavar="WORK_DIR",
                                default=Utils.env_with_default("WORK_DIR", os.path.expanduser("~/.mesos-toolbox/marathon/temp") ) )
        Config.add_argument( "--ivy2-dir",
                                dest="ivy2_dir",
                                help="Ivy2 dependencies directory.",
                                metavar="IVY2_DIR",
                                default=Utils.env_with_default("IVY2_DIR", os.path.expanduser("~/.mesos-toolbox/.ivy2/marathon") ) )
        Config.add_argument( "--with-tests",
                                dest="with_tests",
                                help="Run unit tests when building Marathon.",
                                action="store_true" )

        return Config.ready(program)
示例#3
0
    def setup(program):
        from lib.config import Config
        Config.add_argument( "command",
                                help="Command to execute.",
                                metavar="COMMAND",
                                default="",
                                choices=[ "build", "docker",
                                          "show-releases", "show-builds", "show-mesos-sources", "show-packaging-sources",
                                          "remove-build","remove-mesos-sources", "remove-packaging-sources",
                                          "check-this-system" ] )
        Config.add_argument( "--mesos-version",
                                dest="mesos_version",
                                help="Mesos version to build.",
                                metavar="MESOS_VERSION",
                                default=Utils.env_with_default("MESOS_VERSION","") )
        Config.add_argument( "--mesos-master-branch",
                                dest="mesos_master_branch",
                                help="Mesos master branch name.",
                                metavar="MESOS_MASTER_BRANCH_NAME",
                                default=Utils.env_with_default("MESOS_MASTER_BRANCH_NAME","master") )
        Config.add_argument( "--os",
                                dest="operating_system",
                                help="Operating system to build mesos for.",
                                metavar="OPERATING_SYSTEM",
                                default=Utils.env_with_default("OPERATING_SYSTEM","") )
        Config.add_argument( "--mesos-deb-packaging",
                                dest="deb_packaging_repository",
                                help="mesos-deb-packaging git repository to use.",
                                metavar="MESOS_DEB_PACKAGING_REPOSITORY",
                                default=Utils.env_with_default("MESOS_DEB_PACKAGING_REPOSITORY", "https://github.com/mesosphere/mesos-deb-packaging.git") )
        Config.add_argument( "--mesos-deb-packaging-sha",
                                dest="deb_packaging_sha",
                                help="mesos-deb-packaging sha to use.",
                                metavar="MESOS_DEB_PACKAGING_SHA",
                                default=Utils.env_with_default("MESOS_DEB_PACKAGING_SHA", "b929d6b84bcc080b490a7ee79c0115e82984a648") )
        Config.add_argument( "--mesos-git-repository",
                                dest="mesos_git_repository",
                                help="Mesos git repository to use.",
                                metavar="MESOS_GIT_REPOSITORY",
                                default=Utils.env_with_default("MESOS_GIT_REPOSITORY", "https://github.com/apache/mesos.git") )
        Config.add_argument( "--mesos-build-version",
                                dest="mesos_build_version",
                                help="Mesos build version.",
                                metavar="MESOS_BUILD_VERSION",
                                default=Utils.env_with_default("MESOS_BUILD_VERSION", "0.1.{}".format( str(int(time.time())) ) ) )
        Config.add_argument( "--docker-templates",
                                dest="docker_templates_dir",
                                help="Docker templates base directory.",
                                metavar="DOCKER_TEMPLATES_DIR",
                                default=Utils.env_with_default("DOCKER_TEMPLATES_DIR", "{}/docker".format(
                                    os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
                                )))
        Config.add_argument( "--packaging-patches",
                                dest="packages_patches_dir",
                                help="mesos-deb-packaging patches directory.",
                                metavar="PACKAGES_PATCHES_DIR",
                                default=Utils.env_with_default("PACKAGES_PATCHES_DIR", "{}/patches/mesos-packaging".format(
                                    os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
                                )))
        Config.add_argument( "--source-dir",
                                dest="source_dir",
                                help="Directory in which the Mesos sources are stored.",
                                metavar="SOURCE_DIR",
                                default=Utils.env_with_default("SOURCE_DIR", os.path.expanduser("~/.mesos/sources") ) )
        Config.add_argument( "--packages-dir",
                                dest="packages_dir",
                                help="Directory in which packaged versions of Mesos are stored.",
                                metavar="PACKAGES_DIR",
                                default=Utils.env_with_default("PACKAGES_DIR", os.path.expanduser("~/.mesos/packages") ) )
        Config.add_argument( "--work-dir",
                                dest="work_dir",
                                help="Directory in which this program does the work.",
                                metavar="WORK_DIR",
                                default=Utils.env_with_default("WORK_DIR", os.path.expanduser("~/.mesos/temp") ) )

        return Config.ready(program)
 def setup(program):
     from lib.config import Config
     Config.add_argument( "command",
                             help="Command to execute.",
                             metavar="COMMAND",
                             default="",
                             choices=[ "destroy-f", "halt", "provision",
                                       "resume", "ssh", "status", "suspend", "up",
                                       "check-this-system" ] )
     Config.add_argument( "--mesos-build",
                             dest="mesos_build",
                             help="Mesos build to use for Vagrant cluster.",
                             metavar="MESOS_BUILD",
                             default=Utils.env_with_default("MESOS_BUILD","") )
     Config.add_argument( "--marathon-build",
                             dest="marathon_build",
                             help="Marathon build to use for Vagrant cluster.",
                             metavar="MARATHON_BUILD",
                             default=Utils.env_with_default("MARATHON_BUILD","") )
     Config.add_argument( "--mesos-packages-dir",
                             dest="mesos_packages_dir",
                             help="Directory in which packaged versions of Mesos are stored.",
                             metavar="MESOS_PACKAGES_DIR",
                             default=Utils.env_with_default("MESOS_PACKAGES_DIR", Defaults.mesos_packages_dir() ) )
     Config.add_argument( "--marathon-packages-dir",
                             dest="marathon_packages_dir",
                             help="Directory in which packaged versions of Mesos are stored.",
                             metavar="MARATHON_PACKAGES_DIR",
                             default=Utils.env_with_default("MARATHON_PACKAGES_DIR", Defaults.marathon_packages_dir() ) )
     Config.add_argument( "--os",
                             dest="operating_system",
                             help="Operating system to build mesos for.",
                             metavar="OPERATING_SYSTEM",
                             default=Utils.env_with_default("OPERATING_SYSTEM","") )
     Config.add_argument( "--docker-templates",
                             dest="docker_templates_dir",
                             help="Docker templates base directory.",
                             metavar="DOCKER_TEMPLATES_DIR",
                             default=Utils.env_with_default("DOCKER_TEMPLATES_DIR", "{}/docker/mesos".format(
                                 os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
                             )))
     Config.add_argument( "--machine",
                             dest="machine",
                             help="Optional machine for the Vagrant command.",
                             metavar="MACHINE",
                             default=Utils.env_with_default("MACHINE","") )
     Config.add_argument( "--deployment-name",
                             dest="deployment_name",
                             help="Deployment name.",
                             metavar="DEPLOYMENT_NAME",
                             default=Utils.env_with_default("DEPLOYMENT_NAME","vagrant") )
     Config.add_argument( "--consensus-ips",
                             dest="consensus_ips",
                             help="Consensus servers IP addresses. Comma delimited list of addresses to give to consensus servers.",
                             metavar="CONSENSUS_IPS",
                             default=Utils.env_with_default("CONSENSUS_IPS","192.168.33.99") )
     Config.add_argument( "--master-ips",
                             dest="master_ips",
                             help="Master IP addresses. Comma delimited list of addresses to give to masters.",
                             metavar="MASTER_IPS",
                             default=Utils.env_with_default("MASTER_IPS","192.168.33.100") )
     Config.add_argument( "--agent-ips",
                             dest="agent_ips",
                             help="Agent IP addresses. Comma delimited list of addresses to give to agents.",
                             metavar="AGENT_IPSS",
                             default=Utils.env_with_default("AGENT_IPS","192.168.33.101,192.168.33.102") )
     Config.add_argument( "--consensus-memory",
                             dest="consensus_memory",
                             help="Consensus machine RAM amount.",
                             metavar="CONSENSUS_MEMORY",
                             default=Utils.env_with_default("CONSENSUS_MEMORY","512") )
     Config.add_argument( "--master-memory",
                             dest="master_memory",
                             help="Master RAM amount.",
                             metavar="MASTER_MEMORY",
                             default=Utils.env_with_default("MASTER_MEMORY","1024") )
     Config.add_argument( "--agent-memory",
                             dest="agent_memory",
                             help="Agent RAM amount.",
                             metavar="AGENT_MEMORY",
                             default=Utils.env_with_default("AGENT_MEMORY","2048") )
     return Config.ready(program)