* feat(gpu): enhance DGX Spark support and update GPU type handling * feat(amdgpu): refactor AMD GPU detection and support for GB10 chip and APU * feat(connector): enhance GB10 chip detection with environment variable support * feat(gpu): enhance DGX Spark support and update GPU type handling * feat(amdgpu): refactor AMD GPU detection and support for GB10 chip and APU * feat(connector): enhance GB10 chip detection with environment variable support * feat: add nvidia device plugin for gb10 * fix(gpu): update pod selector for hami-device-plugin based on GB10 chip detection fix(deploy): bump app-service image version to 0.4.78 * feat: enable CGO for building on ARM architecture and adjust build constraints for Linux * feat: enhance multi-architecture support for ARM64 in release workflow * feat: update multi-arch setup for ARM64 in release workflow * feat: enhance ARM64 multi-architecture support in release workflow * feat: streamline ARM64 cross-compilation setup in release workflow * feat: enhance ARM64 support by adding architecture-specific package installations * feat: update ARM64 package sources in release workflow for improved compatibility * feat: amd device plugin and container toolkit install * refactor: remove GB10 chip type check from GPU info update * feat(gpu): update hami version to v2.6.10-compatible for spark * fix: remove gb10 device plugin checking * fix: update klauspost/cpuid to v2.3.0 * fix: amd gpu check (#2522) * feat: enhance storage device detection with USB serial properties * feat: update hami version to v2.6.11-compatible-arm * feat: add chip type support for AMD and NVIDIA GPUs in node label updates * feat(gpu): supports auto binding GPU to app * feat(gpu): remove chip type handling from GPU label updates * feat(gpu): remove GPU type specification from DaemonSet and values.yaml * feat(gpu): remove GB10 device plugin installation and related checks * feat(gpu): update HAMi to v2.6.11 --------- Co-authored-by: dkeven <dkvvven@gmail.com> Co-authored-by: hys <hysyeah@gmail.com>
110 lines
2.9 KiB
Go
110 lines
2.9 KiB
Go
package cluster
|
|
|
|
import (
|
|
"github.com/beclab/Olares/cli/pkg/amdgpu"
|
|
"github.com/beclab/Olares/cli/pkg/common"
|
|
"github.com/beclab/Olares/cli/pkg/core/module"
|
|
"github.com/beclab/Olares/cli/pkg/gpu"
|
|
"github.com/beclab/Olares/cli/pkg/kubesphere/plugins"
|
|
"github.com/beclab/Olares/cli/pkg/manifest"
|
|
"github.com/beclab/Olares/cli/pkg/storage"
|
|
"github.com/beclab/Olares/cli/pkg/terminus"
|
|
)
|
|
|
|
type linuxInstallPhaseBuilder struct {
|
|
runtime *common.KubeRuntime
|
|
manifestMap manifest.InstallationManifest
|
|
}
|
|
|
|
func (l *linuxInstallPhaseBuilder) base() phase {
|
|
m := []module.Module{
|
|
&plugins.CopyEmbed{},
|
|
&terminus.CheckPreparedModule{Force: true},
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
func (l *linuxInstallPhaseBuilder) storage() phase {
|
|
return []module.Module{
|
|
&storage.InstallRedisModule{
|
|
ManifestModule: manifest.ManifestModule{
|
|
Manifest: l.manifestMap,
|
|
BaseDir: l.runtime.GetBaseDir(),
|
|
},
|
|
},
|
|
&storage.InstallJuiceFsModule{
|
|
ManifestModule: manifest.ManifestModule{
|
|
Manifest: l.manifestMap,
|
|
BaseDir: l.runtime.GetBaseDir(),
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
func (l *linuxInstallPhaseBuilder) installCluster() phase {
|
|
kubeType := l.runtime.Arg.Kubetype
|
|
if kubeType == common.K3s {
|
|
return NewK3sCreateClusterPhase(l.runtime, l.manifestMap)
|
|
} else {
|
|
return NewCreateClusterPhase(l.runtime, l.manifestMap)
|
|
}
|
|
}
|
|
|
|
func (l *linuxInstallPhaseBuilder) installGpuPlugin() phase {
|
|
var skipGpuPlugin = !l.runtime.Arg.GPU.Enable
|
|
if l.runtime.GetSystemInfo().IsWsl() {
|
|
skipGpuPlugin = false
|
|
}
|
|
return []module.Module{
|
|
&gpu.RestartK3sServiceModule{Skip: !(l.runtime.Arg.Kubetype == common.K3s)},
|
|
&gpu.InstallPluginModule{Skip: skipGpuPlugin},
|
|
&amdgpu.InstallAmdPluginModule{Skip: func() bool {
|
|
if l.runtime.GetSystemInfo().IsAmdGPUOrAPU() {
|
|
return false
|
|
}
|
|
return true
|
|
}()},
|
|
}
|
|
}
|
|
|
|
func (l *linuxInstallPhaseBuilder) installTerminus() phase {
|
|
return []module.Module{
|
|
&terminus.GetNATGatewayIPModule{},
|
|
&terminus.InstallAccountModule{},
|
|
&terminus.InstallSettingsModule{},
|
|
&terminus.InstallOsSystemModule{},
|
|
&terminus.InstallLauncherModule{},
|
|
&terminus.InstallAppsModule{},
|
|
}
|
|
}
|
|
|
|
func (l *linuxInstallPhaseBuilder) installBackup() phase {
|
|
return []module.Module{
|
|
&terminus.InstallVeleroModule{
|
|
ManifestModule: manifest.ManifestModule{
|
|
Manifest: l.manifestMap,
|
|
BaseDir: l.runtime.GetBaseDir(),
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
func (l *linuxInstallPhaseBuilder) build() []module.Module {
|
|
return l.base().
|
|
addModule(fsModuleBuilder(func() []module.Module {
|
|
return l.storage()
|
|
}).withJuiceFS(l.runtime)...).
|
|
addModule(l.installCluster()...).
|
|
addModule(gpuModuleBuilder(func() []module.Module {
|
|
return l.installGpuPlugin()
|
|
}).withGPU(l.runtime)...).
|
|
addModule(l.installTerminus()...).
|
|
addModule(backupModuleBuilder(func() []module.Module {
|
|
return l.installBackup()
|
|
}).withBackup(l.runtime)...).
|
|
addModule(&terminus.InstalledModule{}).
|
|
addModule(&terminus.WriteReleaseFileModule{}).
|
|
addModule(&terminus.WelcomeModule{})
|
|
}
|