Skip to content

Commit

Permalink
upgrade tools in agi to latest by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Glonek committed Nov 22, 2023
1 parent 0a1f81f commit 7bca7b7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
12 changes: 10 additions & 2 deletions src/cmdAgiCreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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)})

Expand Down
1 change: 1 addition & 0 deletions src/cmdAgiCreate.script.cloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/cmdAgiCreate.script.docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7bca7b7

Please sign in to comment.