本文整理汇总了Golang中github.com/mesos/mesos-go/executor.NewMesosExecutorDriver函数的典型用法代码示例。如果您正苦于以下问题:Golang NewMesosExecutorDriver函数的具体用法?Golang NewMesosExecutorDriver怎么用?Golang NewMesosExecutorDriver使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewMesosExecutorDriver函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: main
func main() {
runtime.GOMAXPROCS(1)
log.SetLevel(log.DebugLevel)
fmt.Println("Starting Riak Executor")
signals := make(chan os.Signal, 1)
signal.Notify(signals, syscall.SIGUSR1, syscall.SIGUSR2)
executor := newExecutor()
dconfig := exec.DriverConfig{
Executor: executor,
}
driver, err := exec.NewMesosExecutorDriver(dconfig)
if err != nil {
fmt.Println("Unable to create a ExecutorDriver ", err.Error())
}
_, err = driver.Start()
if err != nil {
fmt.Println("Got error:", err)
return
}
go signalWatcher(signals, executor)
executor.Driver = driver
fmt.Println("Executor process has started and running.")
driver.Join()
}
开发者ID:glickbot,项目名称:riak-mesos,代码行数:27,代码来源:executor.go
示例2: main
func main() {
launchTimeout :=
flag.Uint("launch-timeout", 240,
"Seconds to retry launching an etcd instance for before giving up. "+
"This should be long enough for a port occupied by a killed process "+
"to be vacated.")
flag.Parse()
log.Infoln("Starting etcd Executor")
dconfig := executor.DriverConfig{
Executor: etcdexecutor.New(
time.Duration(*launchTimeout) * time.Second,
),
}
driver, err := executor.NewMesosExecutorDriver(dconfig)
if err != nil {
log.Infoln("Unable to create an ExecutorDriver ", err.Error())
}
_, err = driver.Start()
if err != nil {
log.Infoln("Got error:", err)
return
}
log.Infoln("Executor process has started and running.")
driver.Join()
}
开发者ID:puppetizeme,项目名称:etcd-mesos,代码行数:28,代码来源:app.go
示例3: main
func main() {
flag.Parse()
err := syscol.InitLogging(*logLevel)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
driverConfig := executor.DriverConfig{
Executor: new(syscol.Executor),
}
driver, err := executor.NewMesosExecutorDriver(driverConfig)
if err != nil {
syscol.Logger.Error(err)
os.Exit(1)
}
_, err = driver.Start()
if err != nil {
syscol.Logger.Error(err)
os.Exit(1)
}
driver.Join()
}
开发者ID:elodina,项目名称:syscol,代码行数:25,代码来源:executor.go
示例4: main
func main() {
flag.Parse()
err := statsd.InitLogging(*logLevel)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
driverConfig := executor.DriverConfig{
Executor: &statsd.Executor{Host: *host},
}
driver, err := executor.NewMesosExecutorDriver(driverConfig)
if err != nil {
statsd.Logger.Error(err)
os.Exit(1)
}
_, err = driver.Start()
if err != nil {
statsd.Logger.Error(err)
os.Exit(1)
}
driver.Join()
}
开发者ID:elodina,项目名称:statsd-mesos-kafka,代码行数:25,代码来源:executor.go
示例5: main
func main() {
fmt.Println(os.Args)
fmt.Println("Parsing")
flag.Parse()
fmt.Println("Init")
exec := NewNebulaExecutor()
config := mesos_exec.DriverConfig{
Executor: exec,
}
fmt.Println("Create")
driver, err := mesos_exec.NewMesosExecutorDriver(config)
if err != nil {
fmt.Println("Unable to create a ExecutorDriver ", err.Error())
}
_, err = driver.Start()
if err != nil {
fmt.Println("Got error:", err)
return
}
fmt.Println("Executor process has started and running.")
_, err = driver.Join()
if err != nil {
fmt.Println("driver failed:", err)
}
fmt.Println("executor terminating")
}
开发者ID:kellrott,项目名称:agro,代码行数:29,代码来源:executor.go
示例6: ghsNodeMain
func ghsNodeMain() {
fmt.Println("Starting GHSVIS Executor")
dconfig := exec.DriverConfig{
Executor: newVISGHSExecutor(),
}
driver, err := exec.NewMesosExecutorDriver(dconfig)
if err != nil {
fmt.Println("Unable to create a ExecutorDriver ", err.Error())
}
_, err = driver.Start()
if err != nil {
fmt.Println("Got error:", err)
return
}
fmt.Println("Executor process has started and running.")
_, err = driver.Join()
if err != nil {
fmt.Println("driver failed:", err)
}
fmt.Println("executor terminating")
}
开发者ID:tcolgate,项目名称:radia,代码行数:25,代码来源:main.go
示例7: start
func start(c *cli.Context) {
workDir := c.String("work_dir")
if workDir == "" {
log.Fatal("work_dir is not specified")
}
err := utils.PerformPreChecksAndPrepareHost(workDir)
if err != nil {
log.WithFields(log.Fields{
"err": err,
}).Fatal("Environment error, cannot run rancher-mesos-executor")
}
log.Info("Setup of env complete. Starting executor driver")
driver, err := executor.NewMesosExecutorDriver(
executor.DriverConfig{
Executor: rancher_mesos.NewRancherExecutor(
filepath.Join(workDir, "rancheros.iso"),
c.String("bridge_iface"),
c.String("bridge_cidr"),
filepath.Join(workDir, "base-img.img")),
},
)
if err != nil {
log.WithFields(log.Fields{
"err": err,
}).Fatal("Error starting executor")
}
_, err = driver.Run()
if err != nil {
log.WithFields(log.Fields{
"err": err,
}).Fatal("Error starting executor")
}
}
开发者ID:rancher,项目名称:rancher-mesos-executor,代码行数:33,代码来源:main.go
示例8: runExecutor
func (s *KubeletExecutorServer) runExecutor(
nodeInfos chan<- executor.NodeInfo,
kubeletFinished <-chan struct{},
staticPodsConfigPath string,
apiclient *clientset.Clientset,
registry executor.Registry,
) (<-chan struct{}, error) {
staticPodFilters := podutil.Filters{
// annotate the pod with BindingHostKey so that the scheduler will ignore the pod
// once it appears in the pod registry. the stock kubelet sets the pod host in order
// to accomplish the same; we do this because the k8sm scheduler works differently.
podutil.Annotator(map[string]string{
meta.BindingHostKey: s.HostnameOverride,
}),
}
if s.containerID != "" {
// tag all pod containers with the containerID so that they can be properly GC'd by Mesos
staticPodFilters = append(staticPodFilters, podutil.Environment([]api.EnvVar{
{Name: envContainerID, Value: s.containerID},
}))
}
exec := executor.New(executor.Config{
Registry: registry,
APIClient: apiclient,
Docker: dockertools.ConnectToDockerOrDie(s.DockerEndpoint),
SuicideTimeout: s.SuicideTimeout,
KubeletFinished: kubeletFinished,
ExitFunc: os.Exit,
NodeInfos: nodeInfos,
Options: []executor.Option{
executor.StaticPods(staticPodsConfigPath, staticPodFilters),
},
})
// initialize driver and initialize the executor with it
dconfig := bindings.DriverConfig{
Executor: exec,
HostnameOverride: s.HostnameOverride,
BindingAddress: net.ParseIP(s.Address),
}
driver, err := bindings.NewMesosExecutorDriver(dconfig)
if err != nil {
return nil, fmt.Errorf("failed to create executor driver: %v", err)
}
log.V(2).Infof("Initialize executor driver...")
exec.Init(driver)
// start the driver
go func() {
if _, err := driver.Run(); err != nil {
log.Fatalf("executor driver failed: %v", err)
}
log.Info("executor Run completed")
}()
return exec.Done(), nil
}
开发者ID:ethernetdan,项目名称:kubernetes,代码行数:57,代码来源:service.go
示例9: runExecutor
func runExecutor(app *stockpile.App) {
taskExecutor := stockpile.NewExecutor(app)
driverConfig := executor.DriverConfig{
Executor: taskExecutor,
}
driver, err := executor.NewMesosExecutorDriver(driverConfig)
if err != nil {
stockpile.Logger.Error(err)
panic(err)
}
_, err = driver.Start()
if err != nil {
stockpile.Logger.Error(err)
panic(err)
}
driver.Run()
}
开发者ID:elodina,项目名称:stockpile,代码行数:17,代码来源:main.go
示例10: main
func main() {
fmt.Println("Starting Task Runner (APT-MESOS)")
driverConfig := executor.DriverConfig{
Executor: NewTaskRunner(),
}
driver, err := executor.NewMesosExecutorDriver(driverConfig)
if err != nil {
fmt.Println("Unable to create a ExecutorDriver ", err.Error())
}
_, err = driver.Start()
if err != nil {
fmt.Println("Got error:", err)
return
}
fmt.Println("Executor process has started and running.")
driver.Join()
}
开发者ID:icsnju,项目名称:apt-mesos,代码行数:19,代码来源:task_runner.go
示例11: main
func main() {
fmt.Println("Starting Example Executor (Go)")
dconfig := exec.DriverConfig{
Executor: newExampleExecutor(),
}
driver, err := exec.NewMesosExecutorDriver(dconfig)
if err != nil {
fmt.Println("Unable to create a ExecutorDriver ", err.Error())
}
_, err = driver.Start()
if err != nil {
fmt.Println("Got error:", err)
return
}
fmt.Println("Executor process has started and running.")
driver.Join()
}
开发者ID:Ima8,项目名称:kubernetes,代码行数:20,代码来源:example_executor.go
示例12: runExecutor
func (s *KubeletExecutorServer) runExecutor(
nodeInfos chan<- executor.NodeInfo,
kubeletFinished <-chan struct{},
staticPodsConfigPath string,
apiclient *clientset.Clientset,
registry executor.Registry,
) (<-chan struct{}, error) {
exec := executor.New(executor.Config{
Registry: registry,
APIClient: apiclient,
Docker: dockertools.ConnectToDockerOrDie(s.DockerEndpoint),
SuicideTimeout: s.SuicideTimeout,
KubeletFinished: kubeletFinished,
ExitFunc: os.Exit,
StaticPodsConfigPath: staticPodsConfigPath,
NodeInfos: nodeInfos,
})
// initialize driver and initialize the executor with it
dconfig := bindings.DriverConfig{
Executor: exec,
HostnameOverride: s.HostnameOverride,
BindingAddress: net.ParseIP(s.Address),
}
driver, err := bindings.NewMesosExecutorDriver(dconfig)
if err != nil {
return nil, fmt.Errorf("failed to create executor driver: %v", err)
}
log.V(2).Infof("Initialize executor driver...")
exec.Init(driver)
// start the driver
go func() {
if _, err := driver.Run(); err != nil {
log.Fatalf("executor driver failed: %v", err)
}
log.Info("executor Run completed")
}()
return exec.Done(), nil
}
开发者ID:XiaoningDing,项目名称:UbernetesPOC,代码行数:41,代码来源:service.go
示例13: main
func main() {
log.Infoln("START executor")
config := exec.DriverConfig{
Executor: forbin.NewDatabaseExecutor(),
}
driver, err := exec.NewMesosExecutorDriver(config)
if err != nil {
log.Infoln("Unable to create a ExecutorDriver ", err.Error())
}
_, err = driver.Start()
if err != nil {
log.Infoln("Got error:", err)
return
}
log.Infoln("Executor process has started and running.")
driver.Join()
}
开发者ID:lionelg3,项目名称:Forbin,代码行数:21,代码来源:main.go
示例14: main
func main() {
flag.Parse()
fmt.Println("Starting Elodina Executor")
httpMirrorExecutor := framework.NewHttpMirrorExecutor(*apiKey, *apiUser, *certFile, *keyFile, *caFile, *targetUrl, *insecure)
driverConfig := executor.DriverConfig{
Executor: httpMirrorExecutor,
}
driver, err := executor.NewMesosExecutorDriver(driverConfig)
server := &ExecutorHTTPServer{httpMirrorExecutor}
go server.Start()
if err != nil {
fmt.Println("Unable to create a ExecutorDriver ", err.Error())
}
_, err = driver.Start()
if err != nil {
fmt.Println("Got error:", err)
return
}
fmt.Println("Executor process has started and running.")
driver.Join()
}
开发者ID:elodina,项目名称:syphon,代码行数:24,代码来源:executor.go
示例15: main
func main() {
flag.Parse()
err := framework.InitLogging(*logLevel)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
var taskExecutor executor.Executor
switch *executorType {
case framework.TaskTypeMirrorMaker:
taskExecutor = framework.NewMirrorMakerExecutor()
default:
{
framework.Logger.Errorf("Unknown executor type %s", *executorType)
os.Exit(1)
}
}
driverConfig := executor.DriverConfig{
Executor: taskExecutor,
}
driver, err := executor.NewMesosExecutorDriver(driverConfig)
if err != nil {
framework.Logger.Error(err)
os.Exit(1)
}
_, err = driver.Start()
if err != nil {
framework.Logger.Error(err)
os.Exit(1)
}
driver.Join()
}
开发者ID:elodina,项目名称:go-kafka-client-mesos,代码行数:36,代码来源:executor.go
示例16: createAndInitKubelet
//.........这里部分代码省略.........
gcPolicy,
pc.SeenAllSources,
kc.RegisterNode,
kc.StandaloneMode,
kc.ClusterDomain,
net.IP(kc.ClusterDNS),
kc.MasterServiceNamespace,
kc.VolumePlugins,
kc.NetworkPlugins,
kc.NetworkPluginName,
kc.StreamingConnectionIdleTimeout,
kc.Recorder,
kc.CAdvisorInterface,
kc.ImageGCPolicy,
kc.DiskSpacePolicy,
kc.Cloud,
kc.NodeStatusUpdateFrequency,
kc.ResourceContainer,
kc.OSInterface,
kc.CgroupRoot,
kc.ContainerRuntime,
kc.RktPath,
kc.RktStage1Image,
kc.Mounter,
kc.Writer,
kc.DockerDaemonContainer,
kc.SystemContainer,
kc.ConfigureCBR0,
kc.PodCIDR,
kc.MaxPods,
kc.DockerExecHandler,
kc.ResolverConfig,
kc.CPUCFSQuota,
&api.NodeDaemonEndpoints{
KubeletEndpoint: api.DaemonEndpoint{Port: int(kc.Port)},
},
kc.OOMAdjuster,
)
if err != nil {
return nil, nil, err
}
//TODO(jdef) either configure Watch here with something useful, or else
// get rid of it from executor.Config
kubeletFinished := make(chan struct{})
staticPodsConfigPath := filepath.Join(kc.RootDirectory, "static-pods")
exec := executor.New(executor.Config{
Kubelet: klet,
Updates: updates,
SourceName: MESOS_CFG_SOURCE,
APIClient: kc.KubeClient,
Docker: kc.DockerClient,
SuicideTimeout: ks.SuicideTimeout,
LaunchGracePeriod: ks.LaunchGracePeriod,
KubeletFinished: kubeletFinished,
ExitFunc: os.Exit,
PodStatusFunc: func(_ executor.KubeletInterface, pod *api.Pod) (*api.PodStatus, error) {
return klet.GetRuntime().GetPodStatus(pod)
},
StaticPodsConfigPath: staticPodsConfigPath,
PodLW: cache.NewListWatchFromClient(kc.KubeClient, "pods", api.NamespaceAll, fields.OneTermEqualSelector(client.PodHost, kc.NodeName)),
})
go exec.InitializeStaticPodsSource(func() {
// Create file source only when we are called back. Otherwise, it is never marked unseen.
fileSourceUpdates := pc.Channel(kubelet.FileSource)
kconfig.NewSourceFile(staticPodsConfigPath, kc.Hostname, kc.FileCheckFrequency, fileSourceUpdates)
})
k := &kubeletExecutor{
Kubelet: klet,
address: ks.Address,
dockerClient: kc.DockerClient,
hks: hks,
kubeletFinished: kubeletFinished,
executorDone: exec.Done(),
clientConfig: clientConfig,
}
dconfig := bindings.DriverConfig{
Executor: exec,
HostnameOverride: ks.HostnameOverride,
BindingAddress: ks.Address,
}
if driver, err := bindings.NewMesosExecutorDriver(dconfig); err != nil {
log.Fatalf("failed to create executor driver: %v", err)
} else {
k.driver = driver
}
log.V(2).Infof("Initialize executor driver...")
k.BirthCry()
exec.Init(k.driver)
k.StartGarbageCollection()
return k, pc, nil
}
开发者ID:alena1108,项目名称:kubernetes,代码行数:101,代码来源:service.go
示例17: runExecutor
func (s *KubeletExecutorServer) runExecutor(execUpdates chan<- kubetypes.PodUpdate, nodeInfos chan<- executor.NodeInfo, kubeletFinished <-chan struct{},
staticPodsConfigPath string, apiclient *client.Client) error {
exec := executor.New(executor.Config{
Updates: execUpdates,
APIClient: apiclient,
Docker: dockertools.ConnectToDockerOrDie(s.DockerEndpoint),
SuicideTimeout: s.SuicideTimeout,
KubeletFinished: kubeletFinished,
ExitFunc: os.Exit,
PodStatusFunc: func(pod *api.Pod) (*api.PodStatus, error) {
s.kletLock.Lock()
defer s.kletLock.Unlock()
if s.klet == nil {
return nil, fmt.Errorf("PodStatucFunc called before kubelet is initialized")
}
status, err := s.klet.GetRuntime().GetPodStatus(pod)
if err != nil {
return nil, err
}
status.Phase = kubelet.GetPhase(&pod.Spec, status.ContainerStatuses)
hostIP, err := s.klet.GetHostIP()
if err != nil {
log.Errorf("Cannot get host IP: %v", err)
} else {
status.HostIP = hostIP.String()
}
return status, nil
},
StaticPodsConfigPath: staticPodsConfigPath,
PodLW: cache.NewListWatchFromClient(apiclient, "pods", api.NamespaceAll,
fields.OneTermEqualSelector(client.PodHost, s.HostnameOverride),
),
NodeInfos: nodeInfos,
})
// initialize driver and initialize the executor with it
dconfig := bindings.DriverConfig{
Executor: exec,
HostnameOverride: s.HostnameOverride,
BindingAddress: s.Address,
}
driver, err := bindings.NewMesosExecutorDriver(dconfig)
if err != nil {
return fmt.Errorf("failed to create executor driver: %v", err)
}
log.V(2).Infof("Initialize executor driver...")
exec.Init(driver)
// start the driver
go func() {
if _, err := driver.Run(); err != nil {
log.Fatalf("executor driver failed: %v", err)
}
log.Info("executor Run completed")
}()
return nil
}
开发者ID:pologood,项目名称:kubernetes,代码行数:61,代码来源:service.go
示例18: createAndInitQinglet
//.........这里部分代码省略.........
pc.SeenAllSources,
kc.RegisterNode,
kc.StandaloneMode,
kc.ClusterDomain,
net.IP(kc.ClusterDNS),
kc.MasterServiceNamespace,
kc.VolumePlugins,
kc.NetworkPlugins,
kc.NetworkPluginName,
kc.StreamingConnectionIdleTimeout,
kc.Recorder,
kc.CadvisorInterface,
kc.ImageGCPolicy,
kc.DiskSpacePolicy,
kc.Cloud,
kc.NodeStatusUpdateFrequency,
kc.ResourceContainer,
kc.OSInterface,
kc.CgroupRoot,
kc.ContainerRuntime,
kc.Mounter,
kc.DockerDaemonContainer,
kc.SystemContainer,
kc.ConfigureCBR0,
kc.PodCIDR,
kc.MaxPods,
kc.DockerExecHandler,
)
if err != nil {
return nil, nil, err
}
//TODO(jdef) either configure Watch here with something useful, or else
// get rid of it from executor.Config
qingletFinished := make(chan struct{})
staticPodsConfigPath := filepath.Join(kc.RootDirectory, "static-pods")
exec := executor.New(executor.Config{
Qinglet: klet,
Updates: updates,
SourceName: MESOS_CFG_SOURCE,
APIClient: kc.QingClient,
Docker: kc.DockerClient,
SuicideTimeout: ks.SuicideTimeout,
QingletFinished: qingletFinished,
ShutdownAlert: func() {
if shutdownCloser != nil {
if e := shutdownCloser.Close(); e != nil {
log.Warningf("failed to signal shutdown to external watcher: %v", e)
}
}
},
ExitFunc: os.Exit,
PodStatusFunc: func(_ executor.QingletInterface, pod *api.Pod) (*api.PodStatus, error) {
return klet.GetRuntime().GetPodStatus(pod)
},
StaticPodsConfigPath: staticPodsConfigPath,
})
go exec.InitializeStaticPodsSource(func() {
// Create file source only when we are called back. Otherwise, it is never marked unseen.
fileSourceUpdates := pc.Channel(qinglet.FileSource)
kconfig.NewSourceFile(staticPodsConfigPath, kc.Hostname, kc.FileCheckFrequency, fileSourceUpdates)
})
k := &qingletExecutor{
Qinglet: klet,
runProxy: ks.RunProxy,
proxyLogV: ks.ProxyLogV,
proxyExec: ks.ProxyExec,
proxyLogfile: ks.ProxyLogfile,
proxyBindall: ks.ProxyBindall,
address: ks.Address,
dockerClient: kc.DockerClient,
hks: hks,
qingletFinished: qingletFinished,
executorDone: exec.Done(),
clientConfig: clientConfig,
}
dconfig := bindings.DriverConfig{
Executor: exec,
HostnameOverride: ks.HostnameOverride,
BindingAddress: net.IP(ks.Address),
}
if driver, err := bindings.NewMesosExecutorDriver(dconfig); err != nil {
log.Fatalf("failed to create executor driver: %v", err)
} else {
k.driver = driver
}
log.V(2).Infof("Initialize executor driver...")
k.BirthCry()
exec.Init(k.driver)
k.StartGarbageCollection()
return k, pc, nil
}
开发者ID:qingyuancloud,项目名称:qingyuan,代码行数:101,代码来源:service.go
注:本文中的github.com/mesos/mesos-go/executor.NewMesosExecutorDriver函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论