Skip to content

Commit

Permalink
local playground with disks; up cli
Browse files Browse the repository at this point in the history
* introduce `AIS_LOCAL_PLAYGROUND` env
* revert commit a53d3b0 (ais/utils)

Signed-off-by: Alex Aizman <[email protected]>
  • Loading branch information
alex-aizman committed Jul 6, 2024
1 parent b86102e commit 7b9faaf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
23 changes: 7 additions & 16 deletions ais/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ func getLocalIPv4s(config *cmn.Config) (addrlist []*localIPv4Info, err error) {
return
}

var skip, warned bool
for _, addr := range addrs {
curr := &localIPv4Info{}
if ipnet, ok := addr.(*net.IPNet); ok {
Expand All @@ -79,10 +78,9 @@ func getLocalIPv4s(config *cmn.Config) (addrlist []*localIPv4Info, err error) {
if k8s.IsK8s() {
continue
}
// non K8s and fspaths: skip?
// non K8s and fspaths:
if !config.TestingEnv() {
skip, warned = haveFspathsSkipLoopback(config, warned)
if skip {
if excludeLoopbackIP() {
continue
}
}
Expand Down Expand Up @@ -117,19 +115,12 @@ func getLocalIPv4s(config *cmn.Config) (addrlist []*localIPv4Info, err error) {
return addrlist, nil
}

func haveFspathsSkipLoopback(config *cmn.Config, warned bool) (bool, bool) { //nolint:unparam // be warned
const haveFspaths = "deployment type is not K8s and not dev"
if config.HostNet.Hostname != "" {
if !warned {
nlog.Warningln(haveFspaths+", pub host is configured:", config.HostNet.Hostname)
nlog.Warningln("- not including loopback in the list of local unicast IPv4")
}
return true /*skip*/, true
}
if !warned {
nlog.Warningln(haveFspaths + " but still including loopback in the list of local unicast IPv4")
// HACK, to accommodate non-K8s docker deployments and non-containerized
func excludeLoopbackIP() bool {
if _, present := os.LookupEnv("AIS_LOCAL_PLAYGROUND"); present {
return false
}
return false /*skip*/, true
return true
}

// given configured list of hostnames, return the first one matching local unicast IPv4
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/NVIDIA/aistore/cmd/cli
go 1.22.3

require (
github.com/NVIDIA/aistore v1.3.24-0.20240705184615-bd9898def366
github.com/NVIDIA/aistore v1.3.24-0.20240705191222-ccef8082e957
github.com/fatih/color v1.17.0
github.com/json-iterator/go v1.1.12
github.com/onsi/ginkgo/v2 v2.19.0
Expand Down
4 changes: 2 additions & 2 deletions cmd/cli/go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/NVIDIA/aistore v1.3.24-0.20240705184615-bd9898def366 h1:s10f+lFGNHWA4kRrKdhWwBt9CDGY+lQ+ES6+m0q1ZwU=
github.com/NVIDIA/aistore v1.3.24-0.20240705184615-bd9898def366/go.mod h1:rzuE/hzSFxylpF5sfawzy1DPnkmWchiW11nb1omitq8=
github.com/NVIDIA/aistore v1.3.24-0.20240705191222-ccef8082e957 h1:jt/nmpnTLOCpuZgcXe4p8nXuz38t/lqRR7BcnvIl+/8=
github.com/NVIDIA/aistore v1.3.24-0.20240705191222-ccef8082e957/go.mod h1:rzuE/hzSFxylpF5sfawzy1DPnkmWchiW11nb1omitq8=
github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8=
github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
Expand Down

0 comments on commit 7b9faaf

Please sign in to comment.