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

V7.6.0 #356

Merged
merged 5 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion CHANGELOG/7.6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ _Release Date: Month Day, Year_
* Core: Add ability to specify custom aerolab path using `export AEROLAB_HOME=/path/to/new/aerolab/dir`.
* Distros: error on `centos:stream8` as it is EOL. Support `Rocky Linux` for versions `8,9` as replacement.
* GH 340: Stop/Start/Destroy did not differenciate between AGI and Cluster for resolution purposes.
* GCP: support hyperdisks and `n4` family instances
* GCP: support hyperdisks and `n4` family instances.
* GCP: add option to specify minimum CPU platform during cluster and client creation.
* Inventory List: expose gcp/aws/docker tags/labels and metadata in json output.
* Partitioner: when configuring index on device, parse partition tree sprig configs and fix if required.
* Upgrade: added `aerolab upgrade --bugfix` - will upgrade to latest fix version, not bleeding edge version.
Expand Down
1 change: 1 addition & 0 deletions src/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type backendExtra struct {
onHostMaintenance string // gcp only
gcpMeta map[string]string
cloudDisks []*cloudDisk // gcp/aws only
gcpMinCpuPlatform *string // gcp only - min cpu platform string
}

type backendVersion struct {
Expand Down
1 change: 1 addition & 0 deletions src/backendGcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -3532,6 +3532,7 @@ func (d *backendGcp) DeployCluster(v backendVersion, name string, nodeCount int,
Project: a.opts.Config.Backend.Project,
Zone: extra.zone,
InstanceResource: &computepb.Instance{
MinCpuPlatform: extra.gcpMinCpuPlatform,
ServiceAccounts: serviceAccounts,
Metadata: &computepb.Metadata{
Items: metaItems,
Expand Down
19 changes: 19 additions & 0 deletions src/cmdAgi.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,25 @@ func (c *agiRetriggerCmd) Execute(args []string) error {
if earlyProcess(args) {
return nil
}
if c.SftpUser != nil && strings.HasPrefix(*c.SftpUser, "ENV::") {
aa := os.ExpandEnv(strings.Split(*c.SftpUser, "::")[1])
c.SftpUser = &aa
}
if c.SftpPass != nil && strings.HasPrefix(*c.SftpPass, "ENV::") {
aa := os.ExpandEnv(strings.Split(*c.SftpPass, "::")[1])
c.SftpPass = &aa
}
if c.S3KeyID != nil && strings.HasPrefix(*c.S3KeyID, "ENV::") {
aa := os.ExpandEnv(strings.Split(*c.S3KeyID, "::")[1])
c.S3KeyID = &aa
}
if c.S3Secret != nil && strings.HasPrefix(*c.S3Secret, "ENV::") {
aa := os.ExpandEnv(strings.Split(*c.S3Secret, "::")[1])
c.S3Secret = &aa
}
if c.S3Enable != nil && *c.S3Enable && c.S3path != nil && *c.S3path == "" {
return errors.New("S3 path cannot be left empty")
}
// if sftp key, local source or patterns file are specified, ensure they exist
for _, k := range []*string{(*string)(c.SftpKey), (*string)(c.PatternsFile), (*string)(c.LocalSource)} {
if k != nil && *k != "" {
Expand Down
19 changes: 19 additions & 0 deletions src/cmdAgiCreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/aerospike/aerolab/gcplabels"
"github.com/aerospike/aerolab/ingest"
"github.com/bestmethod/inslice"
"github.com/lithammer/shortuuid"
flags "github.com/rglonek/jeddevdk-goflags"
"gopkg.in/yaml.v3"
)
Expand Down Expand Up @@ -152,6 +153,24 @@ func (c *agiCreateCmd) Execute(args []string) error {
if earlyProcess(args) {
return nil
}
if strings.HasPrefix(c.SftpUser, "ENV::") {
c.SftpUser = os.ExpandEnv(strings.Split(c.SftpUser, "::")[1])
}
if strings.HasPrefix(c.SftpPass, "ENV::") {
c.SftpPass = os.ExpandEnv(strings.Split(c.SftpPass, "::")[1])
}
if strings.HasPrefix(c.S3KeyID, "ENV::") {
c.S3KeyID = os.ExpandEnv(strings.Split(c.S3KeyID, "::")[1])
}
if strings.HasPrefix(c.S3Secret, "ENV::") {
c.S3Secret = os.ExpandEnv(strings.Split(c.S3Secret, "::")[1])
}
if c.ClusterName == "" {
c.ClusterName = TypeClusterName(shortuuid.New())
}
if c.S3Enable && c.S3path == "" {
return errors.New("S3 path cannot be left empty")
}
if a.opts.Config.Backend.Type == "aws" {
if (c.Aws.Route53DomainName == "" && c.Aws.Route53ZoneId != "") || (c.Aws.Route53DomainName != "" && c.Aws.Route53ZoneId == "") {
return errors.New("either both route53-zoneid and route53-domain must be fills or both must be empty")
Expand Down
3 changes: 3 additions & 0 deletions src/cmdClientDoBase.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ func (c *clientCreateBaseCmd) createBase(args []string, nt string) (machines []i
extra.spotInstance = c.Gcp.SpotInstance
}
extra.onHostMaintenance = c.Gcp.OnHostMaintenance
if c.Gcp.MinCPUPlatform != "" {
extra.gcpMinCpuPlatform = &c.Gcp.MinCPUPlatform
}
err = b.DeployCluster(*bv, string(c.ClientName), c.ClientCount, extra)
if err != nil {
return nil, err
Expand Down
3 changes: 3 additions & 0 deletions src/cmdClientDoNone.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,9 @@ func (c *clientCreateNoneCmd) createBase(args []string, nt string) (machines []i
extra.spotInstance = c.Gcp.SpotInstance
}
extra.onHostMaintenance = c.Gcp.OnHostMaintenance
if c.Gcp.MinCPUPlatform != "" {
extra.gcpMinCpuPlatform = &c.Gcp.MinCPUPlatform
}
err = b.DeployCluster(*bv, string(c.ClientName), c.ClientCount, extra)
if err != nil {
return nil, err
Expand Down
4 changes: 4 additions & 0 deletions src/cmdClusterCreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ type clusterCreateCmdGcp struct {
VolLabels []string `long:"gcp-vol-label" description:"apply custom labels to volume; format: key=value; this parameter can be specified multiple times" simplemode:"false"`
TerminateOnPoweroff bool `long:"gcp-terminate-on-poweroff" description:"if set, when shutdown or poweroff is executed from the instance itself, it will be stopped AND terminated" simplemode:"false"`
OnHostMaintenance string `long:"on-host-maintenance-policy" description:"optionally specify a custom policy onHostMaintenance"`
MinCPUPlatform string `long:"gcp-min-cpu-platform" description:"set the minimum CPU platform; see https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform"`
}

type clusterCreateCmdDocker struct {
Expand Down Expand Up @@ -997,6 +998,9 @@ func (c *clusterCreateCmd) realExecute2(args []string, isGrow bool) error {
}
}
extra.onHostMaintenance = c.Gcp.OnHostMaintenance
if c.Gcp.MinCPUPlatform != "" {
extra.gcpMinCpuPlatform = &c.Gcp.MinCPUPlatform
}
err = b.DeployCluster(*bv, string(c.ClusterName), c.NodeCount, extra)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion src/cmdWeb.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ func (c *webCmd) Execute(args []string) error {
}
}
f.Close()
// TODO: test simpleMode has no typos by exploring it recursively
// test simpleMode has no typos by exploring it recursively
ret := make(chan apiCommand, 1)
keyField := reflect.ValueOf(a.opts).Elem()
pathStacks := []string{}
Expand Down
Loading