本文整理汇总了Golang中github.com/deis/deis/deisctl/backend.Backend.Create方法的典型用法代码示例。如果您正苦于以下问题:Golang Backend.Create方法的具体用法?Golang Backend.Create怎么用?Golang Backend.Create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/deis/deis/deisctl/backend.Backend
的用法示例。
在下文中一共展示了Backend.Create方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Install
// Install loads the definitions of components from local unit files.
// After Install, the components will be available to Start.
func Install(targets []string, b backend.Backend, cb config.Backend, checkKeys func(config.Backend) error) error {
// if target is platform, install all services
if len(targets) == 1 {
switch targets[0] {
case PlatformCommand:
return InstallPlatform(b, cb, checkKeys, false)
case StatelessPlatformCommand:
return InstallPlatform(b, cb, checkKeys, true)
case mesos:
return InstallMesos(b)
case swarm:
return InstallSwarm(b)
case k8s:
return InstallK8s(b)
}
}
var wg sync.WaitGroup
// otherwise create the specific targets
b.Create(targets, &wg, Stdout, Stderr)
wg.Wait()
return nil
}
示例2: Install
// Install loads the definitions of components from local unit files.
// After Install, the components will be available to Start.
func Install(targets []string, b backend.Backend, checkKeys func() error) error {
// if target is platform, install all services
if len(targets) == 1 {
if targets[0] == PlatformCommand {
return InstallPlatform(b, checkKeys, false)
} else if targets[0] == StatelessPlatformCommand {
return InstallPlatform(b, checkKeys, true)
} else if targets[0] == swarm {
return InstallSwarm(b)
}
}
outchan := make(chan string)
errchan := make(chan error)
var wg sync.WaitGroup
go printState(outchan, errchan, 500*time.Millisecond)
// otherwise create the specific targets
b.Create(targets, &wg, outchan, errchan)
wg.Wait()
close(outchan)
close(errchan)
return nil
}
示例3: doUpgradeTakeOver
func doUpgradeTakeOver(stateless bool, b backend.Backend, cb config.Backend) error {
var wg sync.WaitGroup
nodes, err := listPublishedServices(cb)
if err != nil {
return err
}
b.Stop([]string{"publisher"}, &wg, Stdout, Stderr)
wg.Wait()
b.Destroy([]string{"publisher"}, &wg, Stdout, Stderr)
wg.Wait()
if err := republishServices(1800, nodes, cb); err != nil {
return err
}
b.RollingRestart("router", &wg, Stdout, Stderr)
wg.Wait()
b.Create([]string{"publisher"}, &wg, Stdout, Stderr)
wg.Wait()
b.Start([]string{"publisher"}, &wg, Stdout, Stderr)
wg.Wait()
installUpgradeServices(b, stateless, &wg, Stdout, Stderr)
wg.Wait()
startUpgradeServices(b, stateless, &wg, Stdout, Stderr)
wg.Wait()
return nil
}
示例4: InstallSwarm
//InstallSwarm Installs swarm
func InstallSwarm(b backend.Backend) error {
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Installing Swarm..."))
fmt.Fprintln(Stdout, "Swarm node and Swarm Manager...")
b.Create([]string{"swarm-node", "swarm-manager"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.\n ")
fmt.Fprintln(Stdout, "Please run `deisctl start swarm` to start swarm.")
return nil
}
示例5: InstallSwarm
//InstallSwarm Installs swarm
func InstallSwarm(b backend.Backend) error {
outchan := make(chan string)
errchan := make(chan error)
defer close(outchan)
defer close(errchan)
var wg sync.WaitGroup
go printState(outchan, errchan, 500*time.Millisecond)
outchan <- utils.DeisIfy("Installing Swarm...")
outchan <- fmt.Sprintf("Swarm node and Swarm Manager...")
b.Create([]string{"swarm-node", "swarm-manager"}, &wg, outchan, errchan)
wg.Wait()
fmt.Println("Done.")
fmt.Println()
fmt.Println("Please run `deisctl start swarm` to start swarm.")
return nil
}
示例6: installDefaultServices
func installDefaultServices(b backend.Backend, wg *sync.WaitGroup, outchan chan string, errchan chan error) {
outchan <- fmt.Sprintf("Storage subsystem...")
b.Create([]string{"store-daemon", "store-monitor", "store-metadata", "store-volume", "store-gateway"}, wg, outchan, errchan)
wg.Wait()
outchan <- fmt.Sprintf("Logging subsystem...")
b.Create([]string{"logger", "logspout"}, wg, outchan, errchan)
wg.Wait()
outchan <- fmt.Sprintf("Control plane...")
b.Create([]string{"cache", "database", "registry", "controller", "builder"}, wg, outchan, errchan)
wg.Wait()
outchan <- fmt.Sprintf("Data plane...")
b.Create([]string{"publisher"}, wg, outchan, errchan)
wg.Wait()
outchan <- fmt.Sprintf("Routing mesh...")
b.Create([]string{"[email protected]", "[email protected]", "[email protected]"}, wg, outchan, errchan)
wg.Wait()
}
示例7: Install
// Install loads the definitions of components from local unit files.
// After Install, the components will be available to Start.
func Install(argv []string, b backend.Backend) error {
usage := `Loads the definitions of components from local unit files.
After install, the components will be available to start.
"deisctl install" looks for unit files in these directories, in this order:
- the $DEISCTL_UNITS environment variable, if set
- $HOME/.deis/units
- /var/lib/deis/units
Usage:
deisctl install [<target>...] [options]
`
// parse command-line arguments
args, err := docopt.Parse(usage, argv, true, "", false)
if err != nil {
return err
}
// if target is platform, install all services
targets := args["<target>"].([]string)
if len(targets) == 1 && targets[0] == PlatformCommand {
return InstallPlatform(b)
}
outchan := make(chan string)
errchan := make(chan error)
var wg sync.WaitGroup
go printState(outchan, errchan, 500*time.Millisecond)
// otherwise create the specific targets
b.Create(targets, &wg, outchan, errchan)
wg.Wait()
close(outchan)
return nil
}
示例8: installMesosServices
func installMesosServices(b backend.Backend, wg *sync.WaitGroup, out, err io.Writer) {
fmt.Fprintln(out, "Zookeeper...")
b.Create([]string{"zookeeper"}, wg, out, err)
wg.Wait()
fmt.Fprintln(out, "Mesos Master...")
b.Create([]string{"mesos-master"}, wg, out, err)
wg.Wait()
fmt.Fprintln(out, "Mesos Slave...")
b.Create([]string{"mesos-slave"}, wg, out, err)
wg.Wait()
fmt.Fprintln(out, "Marathon Framework...")
b.Create([]string{"mesos-marathon"}, wg, out, err)
wg.Wait()
}
示例9: InstallK8s
//InstallK8s Installs K8s
func InstallK8s(b backend.Backend) error {
var wg sync.WaitGroup
io.WriteString(Stdout, prettyprint.DeisIfy("Installing K8s..."))
fmt.Fprintln(Stdout, "K8s control plane...")
b.Create([]string{"kube-apiserver"}, &wg, Stdout, Stderr)
wg.Wait()
b.Create([]string{"kube-controller-manager", "kube-scheduler"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "K8s data plane...")
b.Create([]string{"kube-kubelet"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "K8s router mesh...")
b.Create([]string{"kube-proxy"}, &wg, Stdout, Stderr)
wg.Wait()
fmt.Fprintln(Stdout, "Done.\n ")
fmt.Fprintln(Stdout, "Please run `deisctl start k8s` to start K8s.")
return nil
}
示例10: installMesosServices
func installMesosServices(b backend.Backend, wg *sync.WaitGroup, out, err io.Writer) {
fmt.Fprintln(out, "Mesos/Marathon control plane...")
b.Create([]string{"zookeeper", "mesos-master"}, wg, out, err)
wg.Wait()
b.Create([]string{"mesos-marathon"}, wg, out, err)
wg.Wait()
fmt.Fprintln(out, "Mesos/Marathon data plane...")
b.Create([]string{"mesos-slave"}, wg, out, err)
wg.Wait()
}
示例11: installDefaultServices
func installDefaultServices(b backend.Backend, stateless bool, wg *sync.WaitGroup, out, err io.Writer) {
if !stateless {
fmt.Fprintln(out, "Storage subsystem...")
b.Create([]string{"store-daemon", "store-monitor", "store-metadata", "store-volume", "[email protected]"}, wg, out, err)
wg.Wait()
}
fmt.Fprintln(out, "Logging subsystem...")
if stateless {
b.Create([]string{"logspout"}, wg, out, err)
} else {
b.Create([]string{"logger", "logspout"}, wg, out, err)
}
wg.Wait()
fmt.Fprintln(out, "Control plane...")
if stateless {
b.Create([]string{"[email protected]", "controller", "builder"}, wg, out, err)
} else {
b.Create([]string{"database", "[email protected]", "controller", "builder"}, wg, out, err)
}
wg.Wait()
fmt.Fprintln(out, "Data plane...")
b.Create([]string{"publisher"}, wg, out, err)
wg.Wait()
fmt.Fprintln(out, "Routing mesh...")
b.Create(getRouters(), wg, out, err)
wg.Wait()
}