From 7bca7b7c8224f365a6fdf965ba576b8363077cd2 Mon Sep 17 00:00:00 2001 From: Robert Glonek Date: Wed, 22 Nov 2023 10:24:49 -0800 Subject: [PATCH] upgrade tools in agi to latest by default --- CHANGELOG.md | 3 +++ src/cmdAgiCreate.go | 12 ++++++++++-- src/cmdAgiCreate.script.cloud.sh | 1 + src/cmdAgiCreate.script.docker.sh | 1 + 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc1d05c3..08373b33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ * Improvement: in `aerolab conf namespace-memory`, adjust `data-size` instead if using aerospike `v7+`, and only if required. Otherwise `noop`. * Fix: aws security groups will now also open ICMP traffic in the rules. * AGI: support v7 of aerospike. +* AGI: support arm editions of centos-based operating systems. +* AGI: add `--no-dim-filesize` option to specify data storage file size for non-data-in-memory namespaces. +* AGI: override tools package by default by the latest tools. Allow `--no-tools-override` to disable. * TODO: Monitor agi instance states and react accordingly - sizing or cycling from spot to on-demand types. * TODO: Document agi instance state monitor. diff --git a/src/cmdAgiCreate.go b/src/cmdAgiCreate.go index 65d9c69f..7eb61ecc 100644 --- a/src/cmdAgiCreate.go +++ b/src/cmdAgiCreate.go @@ -56,6 +56,7 @@ type agiCreateCmd struct { PluginCpuProfile bool `long:"plugin-cpu-profiling" description:"enable CPU profiling for the grafana plugin"` PluginLogLevel int `long:"plugin-log-level" description:"1-CRITICAL,2-ERROR,3-WARN,4-INFO,5-DEBUG,6-DETAIL" default:"4"` NoConfigOverride bool `long:"no-config-override" description:"if set, existing configuration will not be overridden; useful when restarting EFS-based AGIs"` + NoToolsOverride bool `long:"no-tools-override" description:"by default agi will install the latest tools package; set this to disable tools package upgrade"` notifier.HTTPSNotify AerospikeVersion TypeAerospikeVersion `short:"v" long:"aerospike-version" description:"Custom Aerospike server version" default:"6.4.0.*"` Distro TypeDistro `short:"d" long:"distro" description:"Custom distro" default:"ubuntu"` @@ -592,10 +593,17 @@ func (c *agiCreateCmd) Execute(args []string) error { if edition == "arm64" { cedition = "aarch64" } + + // upgrade tools package + toolsUpgrade := "" + if !c.NoToolsOverride { + toolsUpgrade = fmt.Sprintf("mkdir /tmp/toolsupgrade && pushd /tmp/toolsupgrade && aerolab installer download -d %s -i %s && tar -zxvf aerospike-server* && rm -rf *tgz && cd aerospike-server* && rm -f aerospike-server* && ./asinstall && popd", a.opts.Cluster.Create.DistroName, a.opts.Cluster.Create.DistroVersion) + } + if a.opts.Config.Backend.Type == "docker" { - installScript = fmt.Sprintf(agiCreateScriptDocker, override, c.NoDIM, c.Owner, edition, edition, cedition, memSizeStr, storEngine, fileSizeInt, dimStr, rpcStr, c.ClusterName, c.ClusterName, c.AGILabel, proxyPort, proxySSL, proxyCert, proxyKey, proxyMaxInactive, proxyMaxUptime, maxDp, c.PluginLogLevel, cpuProfiling, notifierYaml) + installScript = fmt.Sprintf(agiCreateScriptDocker, override, c.NoDIM, c.Owner, edition, edition, cedition, toolsUpgrade, memSizeStr, storEngine, fileSizeInt, dimStr, rpcStr, c.ClusterName, c.ClusterName, c.AGILabel, proxyPort, proxySSL, proxyCert, proxyKey, proxyMaxInactive, proxyMaxUptime, maxDp, c.PluginLogLevel, cpuProfiling, notifierYaml) } else { - installScript = fmt.Sprintf(agiCreateScript, override, c.NoDIM, c.Owner, edition, edition, cedition, memSizeStr, storEngine, fileSizeInt, dimStr, rpcStr, c.ClusterName, c.ClusterName, c.AGILabel, proxyPort, proxySSL, proxyCert, proxyKey, proxyMaxInactive, proxyMaxUptime, maxDp, c.PluginLogLevel, cpuProfiling, notifierYaml) + installScript = fmt.Sprintf(agiCreateScript, override, c.NoDIM, c.Owner, edition, edition, cedition, toolsUpgrade, memSizeStr, storEngine, fileSizeInt, dimStr, rpcStr, c.ClusterName, c.ClusterName, c.AGILabel, proxyPort, proxySSL, proxyCert, proxyKey, proxyMaxInactive, proxyMaxUptime, maxDp, c.PluginLogLevel, cpuProfiling, notifierYaml) } flist = append(flist, fileListReader{filePath: "/root/agiinstaller.sh", fileContents: strings.NewReader(installScript), fileSize: len(installScript)}) diff --git a/src/cmdAgiCreate.script.cloud.sh b/src/cmdAgiCreate.script.cloud.sh index 2d35c16d..8c3bd08a 100644 --- a/src/cmdAgiCreate.script.cloud.sh +++ b/src/cmdAgiCreate.script.cloud.sh @@ -21,6 +21,7 @@ else fi chmod 755 /usr/local/bin/aerolab aerolab config backend -t none +%s cat <<'EOF' > /etc/aerospike/aerospike.conf service { proto-fd-max 15000 diff --git a/src/cmdAgiCreate.script.docker.sh b/src/cmdAgiCreate.script.docker.sh index 5df075e6..47dc86a3 100644 --- a/src/cmdAgiCreate.script.docker.sh +++ b/src/cmdAgiCreate.script.docker.sh @@ -22,6 +22,7 @@ fi chmod 755 /usr/local/bin/aerolab mkdir /opt/autoload aerolab config backend -t none +%s cat <<'EOF' > /etc/aerospike/aerospike.conf service { proto-fd-max 15000