Merge branch 'f8-env-patch' of github.com:Factor8Solutions/lotus into feat/f8-worker-env

This commit is contained in:
Łukasz Magiera 2022-08-05 09:44:31 +02:00
commit ee08c15b8c
2 changed files with 95 additions and 76 deletions

View File

@ -91,15 +91,16 @@ func main() {
Usage: fmt.Sprintf("Specify miner repo path. flag storagerepo and env LOTUS_STORAGE_PATH are DEPRECATION, will REMOVE SOON"), Usage: fmt.Sprintf("Specify miner repo path. flag storagerepo and env LOTUS_STORAGE_PATH are DEPRECATION, will REMOVE SOON"),
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "enable-gpu-proving", Name: "enable-gpu-proving",
Usage: "enable use of GPU for mining operations", Usage: "enable use of GPU for mining operations",
Value: true, Value: true,
EnvVars: []string{"LOTUS_WORKER_ENABLE_GPU_PROVING"},
}, },
}, },
After: func(c *cli.Context) error { After: func(c *cli.Context) error {
if r := recover(); r != nil { if r := recover(); r != nil {
// Generate report in LOTUS_PATH and re-raise panic // Generate report in LOTUS_PANIC_REPORT_PATH and re-raise panic
build.GeneratePanicReport(c.String("panic-reports"), c.String(FlagWorkerRepo), c.App.Name) build.GeneratePanicReport(c.String("panic-reports"), c.String(FlagWorkerRepo), c.App.Name)
panic(r) panic(r)
} }
@ -142,22 +143,25 @@ var runCmd = &cli.Command{
Usage: "Start lotus worker", Usage: "Start lotus worker",
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.StringFlag{ &cli.StringFlag{
Name: "listen", Name: "listen",
Usage: "host address and port the worker api will listen on", Usage: "host address and port the worker api will listen on",
Value: "0.0.0.0:3456", Value: "0.0.0.0:3456",
EnvVars: []string{"LOTUS_WORKER_LISTEN"},
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "address", Name: "address",
Hidden: true, Hidden: true,
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "no-local-storage", Name: "no-local-storage",
Usage: "don't use storageminer repo for sector storage", Usage: "don't use storageminer repo for sector storage",
EnvVars: []string{"LOTUS_WORKER_NO_LOCAL_STORAGE"},
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "no-swap", Name: "no-swap",
Usage: "don't use swap", Usage: "don't use swap",
Value: false, Value: false,
EnvVars: []string{"LOTUS_WORKER_NO_SWAP"},
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "name", Name: "name",
@ -166,79 +170,94 @@ var runCmd = &cli.Command{
DefaultText: "hostname", DefaultText: "hostname",
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "addpiece", Name: "addpiece",
Usage: "enable addpiece", Usage: "enable addpiece",
Value: true, Value: true,
EnvVars: []string{"LOTUS_WORKER_ADDPIECE"},
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "precommit1", Name: "precommit1",
Usage: "enable precommit1 (32G sectors: 1 core, 128GiB Memory)", Usage: "enable precommit1 (32G sectors: 1 core, 128GiB Memory)",
Value: true, Value: true,
EnvVars: []string{"LOTUS_WORKER_PRECOMMIT1"},
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "unseal", Name: "unseal",
Usage: "enable unsealing (32G sectors: 1 core, 128GiB Memory)", Usage: "enable unsealing (32G sectors: 1 core, 128GiB Memory)",
Value: true, Value: true,
EnvVars: []string{"LOTUS_WORKER_UNSEAL"},
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "precommit2", Name: "precommit2",
Usage: "enable precommit2 (32G sectors: all cores, 96GiB Memory)", Usage: "enable precommit2 (32G sectors: all cores, 96GiB Memory)",
Value: true, Value: true,
EnvVars: []string{"LOTUS_WORKER_PRECOMMIT2"},
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "commit", Name: "commit",
Usage: "enable commit (32G sectors: all cores or GPUs, 128GiB Memory + 64GiB swap)", Usage: "enable commit (32G sectors: all cores or GPUs, 128GiB Memory + 64GiB swap)",
Value: true, Value: true,
EnvVars: []string{"LOTUS_WORKER_COMMIT"},
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "replica-update", Name: "replica-update",
Usage: "enable replica update", Usage: "enable replica update",
Value: true, Value: true,
EnvVars: []string{"LOTUS_WORKER_REPLICA_UPDATE"},
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "prove-replica-update2", Name: "prove-replica-update2",
Usage: "enable prove replica update 2", Usage: "enable prove replica update 2",
Value: true, Value: true,
EnvVars: []string{"LOTUS_WORKER_PROVE_REPLICA_UPDATE2"},
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "regen-sector-key", Name: "regen-sector-key",
Usage: "enable regen sector key", Usage: "enable regen sector key",
Value: true, Value: true,
EnvVars: []string{"LOTUS_WORKER_REGEN_SECTOR_KEY"},
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "windowpost", Name: "windowpost",
Usage: "enable window post", Usage: "enable window post",
Value: false, Value: false,
EnvVars: []string{"LOTUS_WORKER_WINDOWPOST"},
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "winningpost", Name: "winningpost",
Usage: "enable winning post", Usage: "enable winning post",
Value: false, Value: false,
EnvVars: []string{"LOTUS_WORKER_WINNINGPOST"},
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "no-default", Name: "no-default",
Usage: "disable all default compute tasks, use the worker for storage/fetching only", Usage: "disable all default compute tasks, use the worker for storage/fetching only",
Value: false, Value: false,
EnvVars: []string{"LOTUS_WORKER_NO_DEFAULT"},
}, },
&cli.IntFlag{ &cli.IntFlag{
Name: "parallel-fetch-limit", Name: "parallel-fetch-limit",
Usage: "maximum fetch operations to run in parallel", Usage: "maximum fetch operations to run in parallel",
Value: 5, Value: 5,
EnvVars: []string{"LOTUS_WORKER_PARALLEL_FETCH_LIMIT"},
}, },
&cli.IntFlag{ &cli.IntFlag{
Name: "post-parallel-reads", Name: "post-parallel-reads",
Usage: "maximum number of parallel challenge reads (0 = no limit)", Usage: "maximum number of parallel challenge reads (0 = no limit)",
Value: 128, Value: 128,
EnvVars: []string{"LOTUS_WORKER_POST_PARALLEL_READS"},
}, },
&cli.DurationFlag{ &cli.DurationFlag{
Name: "post-read-timeout", Name: "post-read-timeout",
Usage: "time limit for reading PoSt challenges (0 = no limit)", Usage: "time limit for reading PoSt challenges (0 = no limit)",
Value: 0, Value: 0,
EnvVars: []string{"LOTUS_WORKER_POST_READ_TIMEOUT"},
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "timeout", Name: "timeout",
Usage: "used when 'listen' is unspecified. must be a valid duration recognized by golang's time.ParseDuration function", Usage: "used when 'listen' is unspecified. must be a valid duration recognized by golang's time.ParseDuration function",
Value: "30m", Value: "30m",
EnvVars: []string{"LOTUS_WORKER_TIMEOUT"},
}, },
}, },
Before: func(cctx *cli.Context) error { Before: func(cctx *cli.Context) error {

View File

@ -21,7 +21,7 @@ COMMANDS:
help, h Shows a list of commands or help for one command help, h Shows a list of commands or help for one command
GLOBAL OPTIONS: GLOBAL OPTIONS:
--enable-gpu-proving enable use of GPU for mining operations (default: true) --enable-gpu-proving enable use of GPU for mining operations (default: true) [$LOTUS_WORKER_ENABLE_GPU_PROVING]
--help, -h show help (default: false) --help, -h show help (default: false)
--miner-repo value, --storagerepo value Specify miner repo path. flag storagerepo and env LOTUS_STORAGE_PATH are DEPRECATION, will REMOVE SOON (default: "~/.lotusminer") [$LOTUS_MINER_PATH, $LOTUS_STORAGE_PATH] --miner-repo value, --storagerepo value Specify miner repo path. flag storagerepo and env LOTUS_STORAGE_PATH are DEPRECATION, will REMOVE SOON (default: "~/.lotusminer") [$LOTUS_MINER_PATH, $LOTUS_STORAGE_PATH]
--version, -v print the version (default: false) --version, -v print the version (default: false)
@ -38,25 +38,25 @@ USAGE:
lotus-worker run [command options] [arguments...] lotus-worker run [command options] [arguments...]
OPTIONS: OPTIONS:
--addpiece enable addpiece (default: true) --addpiece enable addpiece (default: true) [$LOTUS_WORKER_ADDPIECE]
--commit enable commit (32G sectors: all cores or GPUs, 128GiB Memory + 64GiB swap) (default: true) --commit enable commit (32G sectors: all cores or GPUs, 128GiB Memory + 64GiB swap) (default: true) [$LOTUS_WORKER_COMMIT]
--listen value host address and port the worker api will listen on (default: "0.0.0.0:3456") --listen value host address and port the worker api will listen on (default: "0.0.0.0:3456") [$LOTUS_WORKER_LISTEN]
--name value custom worker name (default: hostname) [$LOTUS_WORKER_NAME] --name value custom worker name (default: hostname) [$LOTUS_WORKER_NAME]
--no-default disable all default compute tasks, use the worker for storage/fetching only (default: false) --no-default disable all default compute tasks, use the worker for storage/fetching only (default: false) [$LOTUS_WORKER_NO_DEFAULT]
--no-local-storage don't use storageminer repo for sector storage (default: false) --no-local-storage don't use storageminer repo for sector storage (default: false) [$LOTUS_WORKER_NO_LOCAL_STORAGE]
--no-swap don't use swap (default: false) --no-swap don't use swap (default: false) [$LOTUS_WORKER_NO_SWAP]
--parallel-fetch-limit value maximum fetch operations to run in parallel (default: 5) --parallel-fetch-limit value maximum fetch operations to run in parallel (default: 5) [$LOTUS_WORKER_PARALLEL_FETCH_LIMIT]
--post-parallel-reads value maximum number of parallel challenge reads (0 = no limit) (default: 128) --post-parallel-reads value maximum number of parallel challenge reads (0 = no limit) (default: 128) [$LOTUS_WORKER_POST_PARALLEL_READS]
--post-read-timeout value time limit for reading PoSt challenges (0 = no limit) (default: 0s) --post-read-timeout value time limit for reading PoSt challenges (0 = no limit) (default: 0s) [$LOTUS_WORKER_POST_READ_TIMEOUT]
--precommit1 enable precommit1 (32G sectors: 1 core, 128GiB Memory) (default: true) --precommit1 enable precommit1 (32G sectors: 1 core, 128GiB Memory) (default: true) [$LOTUS_WORKER_PRECOMMIT1]
--precommit2 enable precommit2 (32G sectors: all cores, 96GiB Memory) (default: true) --precommit2 enable precommit2 (32G sectors: all cores, 96GiB Memory) (default: true) [$LOTUS_WORKER_PRECOMMIT2]
--prove-replica-update2 enable prove replica update 2 (default: true) --prove-replica-update2 enable prove replica update 2 (default: true) [$LOTUS_WORKER_PROVE_REPLICA_UPDATE2]
--regen-sector-key enable regen sector key (default: true) --regen-sector-key enable regen sector key (default: true) [$LOTUS_WORKER_REGEN_SECTOR_KEY]
--replica-update enable replica update (default: true) --replica-update enable replica update (default: true) [$LOTUS_WORKER_REPLICA_UPDATE]
--timeout value used when 'listen' is unspecified. must be a valid duration recognized by golang's time.ParseDuration function (default: "30m") --timeout value used when 'listen' is unspecified. must be a valid duration recognized by golang's time.ParseDuration function (default: "30m") [$LOTUS_WORKER_TIMEOUT]
--unseal enable unsealing (32G sectors: 1 core, 128GiB Memory) (default: true) --unseal enable unsealing (32G sectors: 1 core, 128GiB Memory) (default: true) [$LOTUS_WORKER_UNSEAL]
--windowpost enable window post (default: false) --windowpost enable window post (default: false) [$LOTUS_WORKER_WINDOWPOST]
--winningpost enable winning post (default: false) --winningpost enable winning post (default: false) [$LOTUS_WORKER_WINNINGPOST]
``` ```