-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AMP Bootstrap #528
AMP Bootstrap #528
Conversation
tested: manager initialization (sudo amp-cluster bootstrap -m -c --tag cluster) on Ubuntu 16.04 and CentOS 7. |
var SwarmJoinToken string | ||
var AmpImageTag string | ||
var CreateSwarm bool | ||
var Manager bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These vars should have their first letter lowercase concidering they are only local
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, done
log.Println("Docker engine version is just fine") | ||
} | ||
if err := c.enableDockerEngine(); err != nil { | ||
log.Fatalf("Failed to enable the Docker service: %s\n", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use g.fatalc("%v\n", err) in place of log.Fatalln to have color output
globally use g.printfc(...) in place of log to have color output the same way then in the orther commands
including in bootstrap-docker.go file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, done (but now I have to background color issue...)
versionCmd := [...]string{"docker", "version", "-f", "{{ .Server.Version }}"} | ||
cmd := exec.Command(versionCmd[0], versionCmd[1:]...) | ||
cmd.Stdout = &out | ||
cmd.Stderr = &stderr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you want to see output you can also use:
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't, I don't want to output it on the console, I use the output later
|
||
func (c *clusterClient) pullAmpImage(version string) error { | ||
image := "appcelerator/amp:" + version | ||
_, err := c.dockerClient.ImagePull(c.ctx, image, types.ImagePullOptions{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't use the reader, so you don't know if pull has error or not during pull
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* add bootstrap feature to AMP cluster CLI (#306) * update vendors (huge diff)
* add bootstrap feature to AMP cluster CLI (#306) * update vendors (huge diff)
resolves #306
subcommand of amp cluster cli to bootstrap a node (Docker, Swarm, cluster agent and server services)