Skip to content

Add mirage cleanup command - #870

Merged
dmytrotkk merged 35 commits into
miragefrom
add-mirage-cleanup
Jul 2, 2025
Merged

Add mirage cleanup command#870
dmytrotkk merged 35 commits into
miragefrom
add-mirage-cleanup

Conversation

@badrogger

@badrogger badrogger commented Jun 24, 2025

Copy link
Copy Markdown
Contributor

This pull request introduces significant refactoring and enhancements to the node_cli codebase, focusing on improving configuration management, streamlining functionality for Mirage nodes, and introducing cleanup mechanisms for Docker configurations. The most notable changes include replacing the legacy environment configuration system with a user configuration system, adding new commands for Mirage node management, and implementing Docker cleanup utilities.

Configuration Management Refactor:

  • Legacy Environment Configuration Replacement: The node_cli/configs/env.py file has been removed, and its functionality has been replaced with a new user configuration system in node_cli/configs/user.py. This introduces structured classes (BaseUserConfig, MirageUserConfig, etc.) for configuration validation and management, improving clarity and extensibility. [1] [2]
  • Updated Imports: All references to env.py have been replaced with user.py, ensuring the new user configuration system is utilized across the codebase. [1] [2] [3]

Mirage Node Enhancements:

  • New Commands for Mirage Nodes: Added the migrate and cleanup commands to node_cli/cli/mirage_node.py, enabling users to switch from boot to regular Mirage nodes and clean up Mirage-specific configurations.
  • Removed Legacy Mirage Boot Migration: The migrate command in node_cli/cli/mirage_boot.py has been removed, consolidating migration functionality into mirage_node.py.

Docker Configuration Cleanup:

  • Docker Cleanup Utilities: Introduced new functions in node_cli/core/docker_config.py to remove Skale-specific Docker configurations, reset the Docker daemon configuration, and clean up related directories. These utilities are part of the broader effort to simplify Docker management.

Miscellaneous Updates:

  • Meta Information Management: Replaced get_meta_info with CliMetaManager for retrieving meta information, standardizing the approach across multiple files. [1] [2] [3]
  • Function Renaming: Renamed validate_env_alias_or_address to validate_alias_or_address in node_cli/configs/alias_address_validation.py for better readability.

@badrogger badrogger linked an issue Jun 24, 2025 that may be closed by this pull request
@dmytrotkk
dmytrotkk marked this pull request as ready for review June 24, 2025 17:12
Comment thread node_cli/core/docker_config.py Outdated


def reset_docker_daemon_config() -> None:
if os.path.isfile(DOCKER_DEAMON_CONFIG_PATH):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in a word DEAMON -> DAEMON

Comment thread node_cli/core/docker_config.py Outdated
with open(DOCKER_DEAMON_CONFIG_PATH, 'r') as daemon_config:
config = json.load(daemon_config)

# Remove the keys we added

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need comments here?

Comment thread node_cli/core/schains.py Outdated
class NoDataDirForChainError(Exception):
"""Raised when no data directory is found"""

pass

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pass can be removed

@dmytrotkk
dmytrotkk merged commit 6c4945b into mirage Jul 2, 2025
2 checks passed
@dmytrotkk
dmytrotkk deleted the add-mirage-cleanup branch July 2, 2025 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cleanup command for FAIR node

2 participants