Пример #1
0
// NewScheduler creates a new hyperqing Server object that includes the
// description and flags.
func NewScheduler() *Server {
	s := service.NewSchedulerServer()

	hks := Server{
		SimpleUsage: "scheduler",
		Long: `Implements the QingYuan-Mesos scheduler. This will launch Mesos tasks which
results in pods assigned to qinglets based on capacity and constraints.`,
		Run: func(hks *Server, args []string) error {
			return s.Run(hks, args)
		},
	}
	s.AddHyperqingFlags(hks.Flags())
	return &hks
}
Пример #2
0
func main() {
	runtime.GOMAXPROCS(runtime.NumCPU())
	s := service.NewSchedulerServer()
	s.AddStandaloneFlags(pflag.CommandLine)

	util.InitFlags()
	util.InitLogs()
	defer util.FlushLogs()

	verflag.PrintAndExitIfRequested()

	if err := s.Run(hyperqing.Nil(), pflag.CommandLine.Args()); err != nil {
		fmt.Fprintf(os.Stderr, err.Error())
		os.Exit(1)
	}
}