From 0c35df2deeba3a5e5fea83b573237e59f99bbe48 Mon Sep 17 00:00:00 2001 From: gfieni Date: Fri, 7 Apr 2017 11:50:34 +0200 Subject: [PATCH 1/2] docs(REAME): Moving VPN informations to the top --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2c5da0e..ee1d734 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,11 @@ A tool to create a Docker Swarm cluster for Docker Machine on the Grid5000 testb You need a Grid5000 account to use this tool. See [this page](https://www.grid5000.fr/mediawiki/index.php/Grid5000:Get_an_account) to create an account. +## VPN +**You need to be connected to the Grid5000 VPN to create and access your Docker nodes.** +**Do not forget to configure your DNS or use OpenVPN DNS auto-configuration.** +**Please follow the instructions from the [Grid5000 Wiki](https://www.grid5000.fr/mediawiki/index.php/VPN).** + ## Installation ## Installation from GitHub releases @@ -40,11 +45,6 @@ export PATH=$PATH:$GOPATH/bin ## How to use -### VPN -You need to be connected to the Grid5000 VPN to create and access your Docker nodes. -Do not forget to configure your DNS or use OpenVPN DNS auto-configuration. -Please follow the instructions from the [Grid5000 Wiki](https://www.grid5000.fr/mediawiki/index.php/VPN). - ### Command line flags Flags marked with `[ ]` can be given multiple times and the values will be added. From b064606dbb4777b2cc17eb14105bddd35bb5d850 Mon Sep 17 00:00:00 2001 From: gfieni Date: Thu, 13 Apr 2017 14:09:53 +0200 Subject: [PATCH 2/2] fix(weave): Fix issue with Weave Net plugin, add provisionning error message The command "launch-plugin" does not exist anymore, it is replaced by the flag "--plugin" of "launch-router" command. Some provisionning error checks were missing because they are planned with the parallelization of multi-sites nodes deployment. Now there is error messages, but they only WARN the user that a node provisionning has failed, the cluster provisionning will continue normally. --- command/create_cluster.go | 8 ++++++-- libdockerg5k/weave/weave.go | 18 ++++++------------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/command/create_cluster.go b/command/create_cluster.go index 705c833..284c8c5 100644 --- a/command/create_cluster.go +++ b/command/create_cluster.go @@ -418,7 +418,9 @@ func (c *CreateClusterCommand) provisionNodes(deployedNodes *map[string]node.Nod log.Infof("Swarm bootstrap node is '%s' ('%s')", bootstrapNode.MachineName, bootstrapNode.NodeName) // provision the node - bootstrapNode.ProvisionNode() + if err := bootstrapNode.ProvisionNode(); err != nil { + fmt.Printf("Error while provisionning bootstrap node '%s' ('%s'): '%s'\n", bootstrapNode.NodeName, bootstrapNode.MachineName, err) + } // remove the node from the list delete(*deployedNodes, k) @@ -432,7 +434,9 @@ func (c *CreateClusterCommand) provisionNodes(deployedNodes *map[string]node.Nod wg.Add(1) go func(n node.Node) { defer wg.Done() - n.ProvisionNode() + if err := n.ProvisionNode(); err != nil { + fmt.Printf("Error while provisionning node '%s' ('%s'): '%s'\n", n.NodeName, n.MachineName, err) + } }(n) } diff --git a/libdockerg5k/weave/weave.go b/libdockerg5k/weave/weave.go index 45136d4..b4e8a6b 100644 --- a/libdockerg5k/weave/weave.go +++ b/libdockerg5k/weave/weave.go @@ -4,8 +4,7 @@ package weave Procedure to deploy Weave Net and Discovery: Net: -docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /proc:/hostproc -e PROCFS=/hostproc --privileged --net=host weaveworks/weaveexec --local launch-router -docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /proc:/hostproc -e PROCFS=/hostproc --privileged --net=host weaveworks/weaveexec --local launch-plugin +docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /proc:/hostproc -e PROCFS=/hostproc --privileged --net=host weaveworks/weaveexec --local launch-router --plugin Discovery: docker run -d --name weavediscovery --net=host weaveworks/weavediscovery $SWARM_DISCOVERY @@ -22,14 +21,9 @@ import ( // RunWeaveNet run Weave Net on given host func RunWeaveNet(h *host.Host) error { - // Launch Weave Net Router - if _, err := h.RunSSHCommand("docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /proc:/hostproc -e PROCFS=/hostproc --privileged --net=host weaveworks/weaveexec --local launch-router"); err != nil { - return err - } - - // Launch Weave Net network plugin - if _, err := h.RunSSHCommand("docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /proc:/hostproc -e PROCFS=/hostproc --privileged --net=host weaveworks/weaveexec --local launch-plugin"); err != nil { - return err + // Run Weave Net router with Docker plugin + if _, err := h.RunSSHCommand("docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /proc:/hostproc -e PROCFS=/hostproc --privileged --net=host weaveworks/weaveexec --local launch-router --plugin"); err != nil { + return fmt.Errorf("Weave Net run command failed: '%s'", err) } return nil @@ -37,9 +31,9 @@ func RunWeaveNet(h *host.Host) error { // RunWeaveDiscovery run Weave Discovery on a host using the given Swarm Discovery method func RunWeaveDiscovery(h *host.Host, swarmDiscovery string) error { - // Launch Weave Discovery + // Run Weave Discovery if _, err := h.RunSSHCommand(fmt.Sprintf("docker run -d --name weavediscovery --net=host weaveworks/weavediscovery %s", swarmDiscovery)); err != nil { - return err + return fmt.Errorf("Weave Discovery run command failed: '%s'", err) } return nil