chia-blockchain icon indicating copy to clipboard operation
chia-blockchain copied to clipboard

cmds: Implement `chia beta`

Open xdustinface opened this issue 2 years ago • 22 comments

This PR introduces the undocumented CLI command chia beta with the following possible commands:

  • chia beta enable to enable the beta test mode (this will put the beta section with the new log root path into the config. The default is the home directory, should be work for linux/mac/windows but i only tested on mac so far.)
  • chia beta disable to disable the beta test mode (drops the beta section)
  • chia beta prepare_submission to pre-process and zip the logfiles

Enabling the beta test mode has the following impact:

beta:
  path: <the path choosen in `chia beta enable`>

will be added to the config which then leads to a different logging initialisation on the start of the daemon or any service. The logging root path will be set to the value of the config entry beta.path and the actual logging config used looks like below:

def get_beta_logging_config() -> Dict[str, Any]:
    return {
        "log_filename": f"{chia_full_version_str()}/chia-blockchain/beta.log",
        "log_level": "DEBUG",
        "log_stdout": False,
        "log_maxfilesrotation": 100,
        "log_maxbytesrotation": 50 * 1024 * 1024,
        "log_use_gzip": True,
    }
  • chia_full_version_str() translates for example to 1.4.0
  • log_maxfilesrotation is bumped to 100 here to make sure we don't miss something which though means that we will potentially end up with ~5GiB log data per version so the user should probably clean those up after submission :) We could alternatively drop the files in chia beta prepare_submission once they are zipped.
  • log_use_gzip is introduced by this PR (set to False by default) and set to True in beta mode.

Enabling beta test mode also leads to the plotting logs being written to files in the beta.path directory.

The file structure in beta.path will look like: image

Based on:

  • #12366
  • #12388

xdustinface avatar Jul 14 '22 20:07 xdustinface

This pull request introduces 12 alerts when merging e7b6d042b3c032935b9279ce0e29b4e78a7a4cf4 into 81b8dc45b51300537ff0bbbd5f8edcef80c10e38 - view on LGTM.com

new alerts:

  • 10 for Module-level cyclic import
  • 2 for Unnecessary pass

lgtm-com[bot] avatar Jul 14 '22 20:07 lgtm-com[bot]

This pull request introduces 12 alerts when merging 3658ed39aaa280f9431fae0e75f696e4c8114dff into 81b8dc45b51300537ff0bbbd5f8edcef80c10e38 - view on LGTM.com

new alerts:

  • 12 for Module-level cyclic import

lgtm-com[bot] avatar Jul 14 '22 20:07 lgtm-com[bot]

This pull request introduces 9 alerts when merging 0aa2c1707c30882c3d87ba4b3a471e4c0ed958a5 into 81b8dc45b51300537ff0bbbd5f8edcef80c10e38 - view on LGTM.com

new alerts:

  • 9 for Module-level cyclic import

lgtm-com[bot] avatar Jul 14 '22 22:07 lgtm-com[bot]

This pull request introduces 31 alerts and fixes 1 when merging 24ad742df8a52103c188126fa5ee13e063087a5e into 81b8dc45b51300537ff0bbbd5f8edcef80c10e38 - view on LGTM.com

new alerts:

  • 31 for Module-level cyclic import

fixed alerts:

  • 1 for Module-level cyclic import

lgtm-com[bot] avatar Jul 15 '22 00:07 lgtm-com[bot]

This pull request introduces 5 alerts when merging d03d33a9e830e5a8ef9f3ae4112612c5c149b380 into a801260a5e2450318b20fe5cc7edd8e112a5ab7e - view on LGTM.com

new alerts:

  • 5 for Module-level cyclic import

lgtm-com[bot] avatar Jul 15 '22 13:07 lgtm-com[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Jul 16 '22 05:07 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Jul 16 '22 06:07 github-actions[bot]

This pull request introduces 5 alerts when merging 7ba66506545051af26953c60e4d39427398819dc into 03b4bacb5c8c769f5086885f4c3a9c4fbb1fe9d3 - view on LGTM.com

new alerts:

  • 5 for Module-level cyclic import

lgtm-com[bot] avatar Jul 16 '22 06:07 lgtm-com[bot]

This pull request introduces 5 alerts when merging ec012a5cf797d72c3a60286175c241e3a3c49a49 into 52e0d430c763ad82091b62b93406c203e27ff9f4 - view on LGTM.com

new alerts:

  • 5 for Module-level cyclic import

lgtm-com[bot] avatar Jul 18 '22 11:07 lgtm-com[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Jul 22 '22 17:07 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Jul 24 '22 21:07 github-actions[bot]

This pull request introduces 5 alerts when merging 34cf4d5d045374a93387ccc9278fb393560be996 into 3e996f8be547460eefd17220dd8643d147a169fd - view on LGTM.com

new alerts:

  • 5 for Module-level cyclic import

lgtm-com[bot] avatar Jul 24 '22 21:07 lgtm-com[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Aug 04 '22 19:08 github-actions[bot]

This pull request introduces 5 alerts when merging 90929c34b862f73f2e80baff0cbc11a44d70393a into 777ffb2751a6f11a7ad7bcc131c91d3b86e177b5 - view on LGTM.com

new alerts:

  • 5 for Module-level cyclic import

lgtm-com[bot] avatar Aug 04 '22 19:08 lgtm-com[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Aug 04 '22 20:08 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Aug 05 '22 02:08 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Aug 05 '22 02:08 github-actions[bot]

This pull request introduces 5 alerts when merging d5265a9af6c2f49b8d0907abc5883af5554328a9 into 44b2568cd64556009d679d25523041220729324b - view on LGTM.com

new alerts:

  • 5 for Module-level cyclic import

lgtm-com[bot] avatar Aug 05 '22 02:08 lgtm-com[bot]

This pull request introduces 5 alerts when merging 725ce89277ef167c486344ddcc7fc7c74b044f85 into 8b70466a70388d0fff437d138192ba38faf92be8 - view on LGTM.com

new alerts:

  • 5 for Module-level cyclic import

lgtm-com[bot] avatar Aug 08 '22 17:08 lgtm-com[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Aug 10 '22 11:08 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Aug 10 '22 14:08 github-actions[bot]

This pull request introduces 5 alerts when merging 781c2938e4578b7940cdd81c195de370b195905e into 7c9fb654a3563e69c54848d137859856c8566587 - view on LGTM.com

new alerts:

  • 5 for Module-level cyclic import

lgtm-com[bot] avatar Aug 10 '22 14:08 lgtm-com[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Aug 12 '22 09:08 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Aug 12 '22 11:08 github-actions[bot]

This pull request introduces 5 alerts when merging 3c00858b507a31637ba6a2b3cfcc59e23a20fb8b into d587d99badb9d241b08d0b60cc6329edbf5bbc46 - view on LGTM.com

new alerts:

  • 5 for Module-level cyclic import

lgtm-com[bot] avatar Aug 12 '22 11:08 lgtm-com[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Aug 15 '22 08:08 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Aug 15 '22 10:08 github-actions[bot]

This pull request introduces 5 alerts when merging cf72377c011a4fd81f73b0701ce7309db230c30b into 7afbe266d2647a313bc6ab300b10110b98e616df - view on LGTM.com

new alerts:

  • 5 for Module-level cyclic import

lgtm-com[bot] avatar Aug 15 '22 10:08 lgtm-com[bot]

lgtm other then the comment on beta enabled/disabled vs in config not in config

i dont understand the benefit of multiple loggers, they would output the same thing if i understand what @altendky is suggesting and seems like this will require more code to support this feature

almogdepaz avatar Sep 01 '22 07:09 almogdepaz

lgtm other then the comment on beta enabled/disabled vs in config not in config

Im currently working on some refactoring of the code for the enabled/disabled fun.

i dont understand the benefit of multiple loggers, they would output the same thing if i understand what @altendky is suggesting and seems like this will require more code to support this feature

One reason i can think about to keep the standard logging going is for example if people use tools like chiadog where the logs are parsed to monitor the status of the farm it would need to change that config too when beta mode is enabled.. so, i will also take a look at that after the config stuff :)

Also it's not necessarily the same since the beta logging will force DEBUG log level and most people are on WARNING or INFO i guess.

xdustinface avatar Sep 01 '22 07:09 xdustinface