示例#1
0
文件: main.go 项目: kellrott/agro
func main() {
	mongo := flag.String("mongo", "localhost", "Mongo Server")
	mesos_master := flag.String("mesos", "localhost:5050", "Mesos Server")

	flag.Parse()
	log.Println("Starting DB Connection")
	dbi, _ := agro_db.NewMongo(*mongo)
	var manager agro_engine.JobManager = nil
	manager, _ = agro_mesos.NewMesosManager(*mesos_master)

	engine, _ := agro_engine.NewEngine(dbi, manager, 4)

	server := agro.NewAgroServer()
	server.RegisterEngine(engine)
	server.RegisterFileStore(dbi)
	engine.Start()
	server.Run()
}
示例#2
0
文件: main.go 项目: kellrott/agro
func main() {
	flag.Parse()
	log.Println("Starting DB Connection")
	dbi, _ := agro_db.NewMongo("localhost")
	var manager agro_engine.JobManager = nil
	manager, _ = agro_drmaa.NewDrmaaManager()

	engine, _ := agro_engine.NewEngine(dbi, manager, 4)
	server := AgroServer{
		dbi:    dbi,
		engine: engine,
	}
	engine.Start()
	lis, err := net.Listen("tcp", ":9713")
	if err != nil {
		panic("Cannot open port")
	}
	grpcServer := grpc.NewServer()
	agro_pb.RegisterTasksServer(grpcServer, server)
	log.Println("Starting Server")
	grpcServer.Serve(lis)

}