-
Notifications
You must be signed in to change notification settings - Fork 314
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
cluster: integrate tispark #531
Changes from all commits
eece8d5
47da5b6
67a235e
50f531b
52b5111
5165119
1b5295f
09a4f7f
a046744
e2f177a
7c68253
1cbc868
5db4400
7e6c314
d303adf
aca6570
ba3b525
74484f7
3fb9ce6
75951b9
e9c9064
75f40d1
0bf52f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,6 +167,7 @@ func checkSystemInfo(s *cliutil.SSHConnectionProps, topo *spec.Specification, op | |
inst.OS(), | ||
inst.Arch(), | ||
insightVer, | ||
"", // use default srcPath | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's better to define an interface for the component source file. e.g:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should go further:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would be a huge refactor and is already out of the scope of this PR. We could discuss that in #601 |
||
inst.GetHost(), | ||
task.CheckToolsPathDir, | ||
). | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,11 @@ func confirmTopology(clusterName, version string, topo *spec.Specification, patc | |
log.Errorf(" 3. The component marked as `patched` has been replaced by previours patch command.") | ||
} | ||
|
||
if len(topo.TiSparkMasters) > 0 || len(topo.TiSparkWorkers) > 0 { | ||
log.Warnf("There are TiSpark nodes defined in the topology, please note that you'll need to manually install Java Runtime Environment (JRE) 8 on the host, other wise the TiSpark nodes will fail to start.") | ||
log.Warnf("You may read the OpenJDK doc for a reference: https://openjdk.java.net/install/") | ||
} | ||
|
||
return cliutil.PromptForConfirmOrAbortError("Do you want to continue? [y/N]: ") | ||
} | ||
|
||
|
@@ -270,37 +275,50 @@ func deploy(clusterName, clusterVersion, topoFile string, opt deployOptions) err | |
// log dir will always be with values, but might not used by the component | ||
logDir := clusterutil.Abs(globalOptions.User, inst.LogDir()) | ||
// Deploy component | ||
// prepare deployment server | ||
t := task.NewBuilder(). | ||
UserSSH(inst.GetHost(), inst.GetSSHPort(), globalOptions.User, gOpt.SSHTimeout). | ||
Mkdir(globalOptions.User, inst.GetHost(), | ||
deployDir, logDir, | ||
filepath.Join(deployDir, "bin"), | ||
filepath.Join(deployDir, "conf"), | ||
filepath.Join(deployDir, "scripts")). | ||
Mkdir(globalOptions.User, inst.GetHost(), dataDirs...). | ||
CopyComponent( | ||
Mkdir(globalOptions.User, inst.GetHost(), dataDirs...) | ||
|
||
// copy dependency component if needed | ||
switch inst.ComponentName() { | ||
case spec.ComponentTiSpark: | ||
t = t.DeploySpark(inst, version, "" /* default srcPath */, deployDir) | ||
default: | ||
t = t.CopyComponent( | ||
inst.ComponentName(), | ||
inst.OS(), | ||
inst.Arch(), | ||
version, | ||
"", // use default srcPath | ||
inst.GetHost(), | ||
deployDir, | ||
). | ||
InitConfig( | ||
clusterName, | ||
clusterVersion, | ||
inst, | ||
globalOptions.User, | ||
opt.ignoreConfigCheck, | ||
meta.DirPaths{ | ||
Deploy: deployDir, | ||
Data: dataDirs, | ||
Log: logDir, | ||
Cache: spec.ClusterPath(clusterName, spec.TempConfigPath), | ||
}, | ||
). | ||
BuildAsStep(fmt.Sprintf(" - Copy %s -> %s", inst.ComponentName(), inst.GetHost())) | ||
deployCompTasks = append(deployCompTasks, t) | ||
) | ||
} | ||
|
||
// generate configs for the component | ||
t = t.InitConfig( | ||
clusterName, | ||
clusterVersion, | ||
inst, | ||
globalOptions.User, | ||
opt.ignoreConfigCheck, | ||
meta.DirPaths{ | ||
Deploy: deployDir, | ||
Data: dataDirs, | ||
Log: logDir, | ||
Cache: spec.ClusterPath(clusterName, spec.TempConfigPath), | ||
}, | ||
) | ||
|
||
deployCompTasks = append(deployCompTasks, | ||
t.BuildAsStep(fmt.Sprintf(" - Copy %s -> %s", inst.ComponentName(), inst.GetHost())), | ||
) | ||
}) | ||
|
||
nodeInfoTask := task.NewBuilder().Func("Check status", func(ctx *task.Context) error { | ||
|
@@ -373,6 +391,11 @@ func buildMonitoredDeployTask( | |
version := spec.ComponentVersion(comp, version) | ||
|
||
for host, info := range uniqueHosts { | ||
// FIXME: as the uniqueHosts list is built with os-arch as part of the key, | ||
// for platform independent packages, it will be downloaded multiple times | ||
// and be saved with different file names in the packages dir, the tarballs | ||
// are identical and the only difference is platform in filename. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mind creating an issue for it and link the URL here? |
||
|
||
// populate unique os/arch set | ||
key := fmt.Sprintf("%s-%s-%s", comp, info.os, info.arch) | ||
if _, found := uniqueCompOSArch[key]; !found { | ||
|
@@ -404,6 +427,7 @@ func buildMonitoredDeployTask( | |
info.os, | ||
info.arch, | ||
version, | ||
"", // use default srcPath | ||
host, | ||
deployDir, | ||
). | ||
|
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.
Is this change expected? There is no target named
cmd
.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.
There is a directory
cmd
, so if runmake cmd
, it will try to make the directory. We don't have any Makefile incmd
so it's not a problem for now.