allow overriding worker hostname with environment variable
Signed-off-by: Clint Armstrong <clint@clintarmstrong.net>
This commit is contained in:
parent
921fda94c7
commit
5120d8481a
10
extern/sector-storage/worker_local.go
vendored
10
extern/sector-storage/worker_local.go
vendored
@ -582,9 +582,13 @@ func (l *LocalWorker) memInfo() (memPhysical, memUsed, memSwap, memSwapUsed uint
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *LocalWorker) Info(context.Context) (storiface.WorkerInfo, error) {
|
func (l *LocalWorker) Info(context.Context) (storiface.WorkerInfo, error) {
|
||||||
hostname, err := os.Hostname() // TODO: allow overriding from config
|
hostname, ok := os.LookupEnv("LOTUS_WORKER_HOSTNAME")
|
||||||
if err != nil {
|
if !ok {
|
||||||
panic(err)
|
var err error
|
||||||
|
hostname, err = os.Hostname()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gpus, err := ffi.GetGPUDevices()
|
gpus, err := ffi.GetGPUDevices()
|
||||||
|
Loading…
Reference in New Issue
Block a user