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

fix: curio: base config by default #11676

Merged
merged 2 commits into from
Mar 6, 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
9 changes: 4 additions & 5 deletions cmd/lotus-provider/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

var configCmd = &cli.Command{
Name: "config",
Usage: "Manage node config by layers. The layer 'base' will always be applied. ",
Usage: "Manage node config by layers. The layer 'base' will always be applied at Curio start-up.",
Subcommands: []*cli.Command{
configDefaultCmd,
configSetCmd,
Expand Down Expand Up @@ -168,7 +168,7 @@ func getConfig(db *harmonydb.DB, layer string) (string, error) {
var configListCmd = &cli.Command{
Name: "list",
Aliases: []string{"ls"},
Usage: "List config layers you can get.",
Usage: "List config layers present in the DB.",
Flags: []cli.Flag{},
Action: func(cctx *cli.Context) error {
db, err := deps.MakeDB(cctx)
Expand Down Expand Up @@ -221,8 +221,7 @@ var configViewCmd = &cli.Command{
Flags: []cli.Flag{
&cli.StringSliceFlag{
Name: "layers",
Usage: "comma or space separated list of layers to be interpreted",
Value: cli.NewStringSlice("base"),
Usage: "comma or space separated list of layers to be interpreted (base is always applied)",
Required: true,
},
},
Expand Down Expand Up @@ -261,7 +260,7 @@ var configEditCmd = &cli.Command{
DefaultText: "<edited layer>",
},
&cli.BoolFlag{
Name: "allow-owerwrite",
Name: "allow-overwrite",
Usage: "allow overwrite of existing layer if source is a different layer",
},
&cli.BoolFlag{
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-provider/config_new.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

var configNewCmd = &cli.Command{
Name: "new-cluster",
Usage: "Create new coniguration for a new cluster",
Usage: "Create new configuration for a new cluster",
ArgsUsage: "[SP actor address...]",
Flags: []cli.Flag{
&cli.StringFlag{
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-provider/deps/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func LoadConfigWithUpgrades(text string, lp *config.LotusProviderConfig) (toml.M
func GetConfig(cctx *cli.Context, db *harmonydb.DB) (*config.LotusProviderConfig, error) {
lp := config.DefaultLotusProvider()
have := []string{}
layers := cctx.StringSlice("layers")
layers := append([]string{"base"}, cctx.StringSlice("layers")...) // Always stack on top of "base" layer
for _, layer := range layers {
text := ""
err := db.QueryRow(cctx.Context, `SELECT config FROM harmony_config WHERE title=$1`, layer).Scan(&text)
Expand Down
6 changes: 0 additions & 6 deletions cmd/lotus-provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,6 @@ func main() {
Hidden: true,
Value: "5433",
},
&cli.StringSliceFlag{
Name: "layers",
EnvVars: []string{"CURIO_LAYERS"},
Usage: "list of layers to be interpreted (atop defaults). Default: base",
Value: cli.NewStringSlice("base"),
},
&cli.StringFlag{
Name: deps.FlagRepoPath,
EnvVars: []string{"LOTUS_REPO_PATH"},
Expand Down
4 changes: 4 additions & 0 deletions cmd/lotus-provider/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ var sealStartCmd = &cli.Command{
Usage: "Use synthetic PoRep",
Value: false, // todo implement synthetic
},
&cli.StringSliceFlag{
Name: "layers",
Usage: "list of layers to be interpreted (atop defaults). Default: base",
},
},
Action: func(cctx *cli.Context) error {
if !cctx.Bool("now") {
Expand Down
5 changes: 4 additions & 1 deletion cmd/lotus-provider/proving.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ var wdPostTaskCmd = &cli.Command{
Usage: "deadline to compute WindowPoSt for ",
Value: 0,
},
&cli.StringSliceFlag{
Name: "layers",
Usage: "list of layers to be interpreted (atop defaults). Default: base",
},
},
Action: func(cctx *cli.Context) error {
ctx := context.Background()
Expand Down Expand Up @@ -140,7 +144,6 @@ It will not send any messages to the chain. Since it can compute any deadline, o
&cli.StringSliceFlag{
Name: "layers",
Usage: "list of layers to be interpreted (atop defaults). Default: base",
Value: cli.NewStringSlice("base"),
},
&cli.StringFlag{
Name: "storage-json",
Expand Down
8 changes: 8 additions & 0 deletions cmd/lotus-provider/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ var runCmd = &cli.Command{
Usage: "path to journal files",
Value: "~/.lotus-provider/",
},
&cli.StringSliceFlag{
Name: "layers",
Usage: "list of layers to be interpreted (atop defaults). Default: base",
},
},
Action: func(cctx *cli.Context) (err error) {
defer func() {
Expand Down Expand Up @@ -153,6 +157,10 @@ var webCmd = &cli.Command{
Name: "nosync",
Usage: "don't check full-node sync status",
},
&cli.StringSliceFlag{
Name: "layers",
Usage: "list of layers to be interpreted (atop defaults). Default: base",
},
},
Action: func(cctx *cli.Context) error {
db, err := deps.MakeDB(cctx)
Expand Down
75 changes: 39 additions & 36 deletions documentation/en/cli-lotus-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COMMANDS:
cli Execute cli commands
run Start a lotus provider process
stop Stop a running lotus provider
config Manage node config by layers. The layer 'base' will always be applied.
config Manage node config by layers. The layer 'base' will always be applied at Curio start-up.
test Utility functions for testing
web Start lotus provider web interface
seal Manage the sealing pipeline
Expand All @@ -26,16 +26,15 @@ COMMANDS:
fetch-params Fetch proving parameters

GLOBAL OPTIONS:
--color use color in display output (default: depends on output being a TTY)
--db-host value Command separated list of hostnames for yugabyte cluster (default: "yugabyte") [$LOTUS_DB_HOST]
--db-name value (default: "yugabyte") [$LOTUS_DB_NAME, $LOTUS_HARMONYDB_HOSTS]
--db-user value (default: "yugabyte") [$LOTUS_DB_USER, $LOTUS_HARMONYDB_USERNAME]
--db-password value (default: "yugabyte") [$LOTUS_DB_PASSWORD, $LOTUS_HARMONYDB_PASSWORD]
--layers value [ --layers value ] list of layers to be interpreted (atop defaults). Default: base (default: "base") [$CURIO_LAYERS]
--repo-path value (default: "~/.lotusprovider") [$LOTUS_REPO_PATH]
--vv enables very verbose mode, useful for debugging the CLI (default: false)
--help, -h show help
--version, -v print the version
--color use color in display output (default: depends on output being a TTY)
--db-host value Command separated list of hostnames for yugabyte cluster (default: "yugabyte") [$LOTUS_DB_HOST]
--db-name value (default: "yugabyte") [$LOTUS_DB_NAME, $LOTUS_HARMONYDB_HOSTS]
--db-user value (default: "yugabyte") [$LOTUS_DB_USER, $LOTUS_HARMONYDB_USERNAME]
--db-password value (default: "yugabyte") [$LOTUS_DB_PASSWORD, $LOTUS_HARMONYDB_PASSWORD]
--repo-path value (default: "~/.lotusprovider") [$LOTUS_REPO_PATH]
--vv enables very verbose mode, useful for debugging the CLI (default: false)
--help, -h show help
--version, -v print the version
```

## lotus-provider cli
Expand Down Expand Up @@ -68,12 +67,13 @@ USAGE:
lotus-provider run [command options] [arguments...]

OPTIONS:
--listen value host address and port the worker api will listen on (default: "0.0.0.0:12300") [$LOTUS_WORKER_LISTEN]
--nosync don't check full-node sync status (default: false)
--manage-fdlimit manage open file limit (default: true)
--storage-json value path to json file containing storage config (default: "~/.lotus-provider/storage.json")
--journal value path to journal files (default: "~/.lotus-provider/")
--help, -h show help
--listen value host address and port the worker api will listen on (default: "0.0.0.0:12300") [$LOTUS_WORKER_LISTEN]
--nosync don't check full-node sync status (default: false)
--manage-fdlimit manage open file limit (default: true)
--storage-json value path to json file containing storage config (default: "~/.lotus-provider/storage.json")
--journal value path to journal files (default: "~/.lotus-provider/")
--layers value [ --layers value ] list of layers to be interpreted (atop defaults). Default: base
--help, -h show help
```

## lotus-provider stop
Expand All @@ -91,7 +91,7 @@ OPTIONS:
## lotus-provider config
```
NAME:
lotus-provider config - Manage node config by layers. The layer 'base' will always be applied.
lotus-provider config - Manage node config by layers. The layer 'base' will always be applied at Curio start-up.

USAGE:
lotus-provider config command [command options] [arguments...]
Expand All @@ -100,12 +100,12 @@ COMMANDS:
default, defaults Print default node config
set, add, update, create Set a config layer or the base by providing a filename or stdin.
get, cat, show Get a config layer by name. You may want to pipe the output to a file, or use 'less'
list, ls List config layers you can get.
list, ls List config layers present in the DB.
interpret, view, stacked, stack Interpret stacked config layers by this version of lotus-provider, with system-generated comments.
remove, rm, del, delete Remove a named config layer.
edit edit a config layer
from-miner Express a database config (for lotus-provider) from an existing miner.
new-cluster Create new coniguration for a new cluster
new-cluster Create new configuration for a new cluster
help, h Shows a list of commands or help for one command

OPTIONS:
Expand Down Expand Up @@ -153,7 +153,7 @@ OPTIONS:
### lotus-provider config list
```
NAME:
lotus-provider config list - List config layers you can get.
lotus-provider config list - List config layers present in the DB.

USAGE:
lotus-provider config list [command options] [arguments...]
Expand All @@ -171,7 +171,7 @@ USAGE:
lotus-provider config interpret [command options] a list of layers to be interpreted as the final config

OPTIONS:
--layers value [ --layers value ] comma or space separated list of layers to be interpreted (default: "base")
--layers value [ --layers value ] comma or space separated list of layers to be interpreted (base is always applied)
--help, -h show help
```

Expand All @@ -198,7 +198,7 @@ USAGE:
OPTIONS:
--editor value editor to use (default: "vim") [$EDITOR]
--source value source config layer (default: <edited layer>)
--allow-owerwrite allow overwrite of existing layer if source is a different layer (default: false)
--allow-overwrite allow overwrite of existing layer if source is a different layer (default: false)
--no-source-diff save the whole config into the layer, not just the diff (default: false)
--no-interpret-source do not interpret source layer (default: true if --source is set)
--help, -h show help
Expand All @@ -225,7 +225,7 @@ OPTIONS:
### lotus-provider config new-cluster
```
NAME:
lotus-provider config new-cluster - Create new coniguration for a new cluster
lotus-provider config new-cluster - Create new configuration for a new cluster

USAGE:
lotus-provider config new-cluster [command options] [SP actor address...]
Expand Down Expand Up @@ -281,7 +281,7 @@ DESCRIPTION:

OPTIONS:
--deadline value deadline to compute WindowPoSt for (default: 0)
--layers value [ --layers value ] list of layers to be interpreted (atop defaults). Default: base (default: "base")
--layers value [ --layers value ] list of layers to be interpreted (atop defaults). Default: base
--storage-json value path to json file containing storage config (default: "~/.lotus-provider/storage.json")
--partition value partition to compute WindowPoSt for (default: 0)
--help, -h show help
Expand All @@ -296,8 +296,9 @@ USAGE:
lotus-provider test window-post task [command options] [arguments...]

OPTIONS:
--deadline value deadline to compute WindowPoSt for (default: 0)
--help, -h show help
--deadline value deadline to compute WindowPoSt for (default: 0)
--layers value [ --layers value ] list of layers to be interpreted (atop defaults). Default: base
--help, -h show help
```

## lotus-provider web
Expand All @@ -313,9 +314,10 @@ DESCRIPTION:
This creates the 'web' layer if it does not exist, then calls run with that layer.

OPTIONS:
--listen value Address to listen on (default: "127.0.0.1:4701")
--nosync don't check full-node sync status (default: false)
--help, -h show help
--listen value Address to listen on (default: "127.0.0.1:4701")
--nosync don't check full-node sync status (default: false)
--layers value [ --layers value ] list of layers to be interpreted (atop defaults). Default: base
--help, -h show help
```

## lotus-provider seal
Expand Down Expand Up @@ -343,12 +345,13 @@ USAGE:
lotus-provider seal start [command options] [arguments...]

OPTIONS:
--actor value Specify actor address to start sealing sectors for
--now Start sealing sectors for all actors now (not on schedule) (default: false)
--cc Start sealing new CC sectors (default: false)
--count value Number of sectors to start (default: 1)
--synthetic Use synthetic PoRep (default: false)
--help, -h show help
--actor value Specify actor address to start sealing sectors for
--now Start sealing sectors for all actors now (not on schedule) (default: false)
--cc Start sealing new CC sectors (default: false)
--count value Number of sectors to start (default: 1)
--synthetic Use synthetic PoRep (default: false)
--layers value [ --layers value ] list of layers to be interpreted (atop defaults). Default: base
--help, -h show help
```

## lotus-provider version
Expand Down