Skip to content
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: Update supported OS versions #2476

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 31 additions & 12 deletions pkg/cluster/operation/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ func checkSysInfo(opt *CheckOptions, sysInfo *sysinfo.SysInfo) []*CheckResult {
return results
}

// Try to keep this in sync with
// https://docs.pingcap.com/tidb/stable/hardware-and-software-requirements#os-and-platform-requirements
//
// This information is in most cases based on the `ID` (Vendor) and `VERSION_ID` (Release) of /etc/os-release
// See https://github.com/AstroProfundis/sysinfo/blob/tiup/os.go for details.
func checkOSInfo(opt *CheckOptions, osInfo *sysinfo.OS) *CheckResult {
result := &CheckResult{
Name: CheckNameOSVer,
Expand All @@ -175,17 +180,31 @@ func checkOSInfo(opt *CheckOptions, osInfo *sysinfo.OS) *CheckResult {
return result
}
case "amzn":
// https://aws.amazon.com/linux/amazon-linux-2023/
if osInfo.Version == "2023" {
return result
}

// Amazon Linux 2 is based on CentOS 7 and is recommended for
// AWS Graviton 2 (ARM64) deployments.
// https://aws.amazon.com/amazon-linux-2/
if ver, _ := strconv.ParseFloat(osInfo.Version, 64); ver < 2 || ver >= 3 {
result.Err = fmt.Errorf("%s %s not supported, use version 2 please",
result.Err = fmt.Errorf("%s %s not supported, use Amazon Linux 2 or Amazon Linux 2023 please",
osInfo.Name, osInfo.Release)
return result
}
case "centos", "redhat", "rhel", "ol":
// check version
if ver, _ := strconv.ParseFloat(osInfo.Version, 64); ver < 7 {
result.Err = fmt.Errorf("%s %s not supported, use version 8 please",
case "centos":
// CentOS Linux is EOL
// CentOS Stream 9 and newer is still fine
if ver, _ := strconv.ParseFloat(osInfo.Version, 64); ver < 9 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks a little newer to me, maybe 7.3 or so? Or mark result.warn?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You think we should still list CentOS Linux 7.3 as supported?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You think we should still list CentOS Linux 7.3 as supported?

I just worry existed tiup deployed on CentOS7 will error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CentOS Linux 7.3 and CentOS Stream 8 don't have upstream support anymore as they are EOL.

TiDB will end support for CentOS 7 in v8.5.

This is just a check and it won't prevent deployment.

I'm ok with listing 7.x as supported for now and then add a warning about deprecation.

result.Err = fmt.Errorf("%s %s not supported, use version 9 or higher",
osInfo.Name, osInfo.Release)
return result
}
case "redhat", "rhel", "ol":
// RHEL 8.4 or newer 8.x versions are supported
if ver, _ := strconv.ParseFloat(osInfo.Version, 64); ver < 8.4 || ver >= 9 {
result.Err = fmt.Errorf("%s %s not supported, use version 8.4 or a later 8.x version please",
osInfo.Name, osInfo.Release)
return result
}
Expand All @@ -198,30 +217,30 @@ func checkOSInfo(opt *CheckOptions, osInfo *sysinfo.OS) *CheckResult {
}
case "debian":
// debian support is not fully tested, but we suppose it should work
msg := "debian support is not fully tested, be careful"
msg := "Debian support is not fully tested, be careful"
result.Err = fmt.Errorf("%s (%s)", result.Msg, msg)
result.Warn = true
if ver, _ := strconv.ParseFloat(osInfo.Version, 64); ver < 9 {
result.Err = fmt.Errorf("%s %s not supported, use version 9 or higher (%s)",
if ver, _ := strconv.ParseFloat(osInfo.Version, 64); ver < 10 {
result.Err = fmt.Errorf("%s %s not supported, use version 10 or higher (%s)",
osInfo.Name, osInfo.Release, msg)
result.Warn = false
return result
}
case "ubuntu":
// ubuntu support is not fully tested, but we suppose it should work
msg := "ubuntu support is not fully tested, be careful"
msg := "Ubuntu support is not fully tested, be careful"
result.Err = fmt.Errorf("%s (%s)", result.Msg, msg)
result.Warn = true
if ver, _ := strconv.ParseFloat(osInfo.Version, 64); ver < 18.04 {
result.Err = fmt.Errorf("%s %s not supported, use version 18.04 or higher (%s)",
if ver, _ := strconv.ParseFloat(osInfo.Version, 64); ver < 20.04 {
result.Err = fmt.Errorf("%s %s not supported, use version 20.04 or higher (%s)",
osInfo.Name, osInfo.Release, msg)
result.Warn = false
return result
}
case "openEuler":
return result
default:
result.Err = fmt.Errorf("os vendor %s not supported", osInfo.Vendor)
result.Err = fmt.Errorf("OS vendor %s not supported", osInfo.Vendor)
return result
}

Expand Down
Loading