Skip to content

Commit

Permalink
Minor changes - remove IMA_ENDPOINT, merge compose_up_sync
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytrotkk committed Jan 26, 2024
1 parent 74e1028 commit ff59242
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 25 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ You should specify the following environment variables:
- `DISK_MOUNTPOINT` - disk mount point for storing sChains data
- `DOCKER_LVMPY_STREAM` - stream of `docker-lvmpy` to use
- `CONTAINER_CONFIGS_STREAM` - stream of `skale-node` to use
- `IMA_ENDPOINT` - IMA endpoint to connect
- `ENDPOINT` - RPC endpoint of the node in the network where SKALE Manager is deployed
- `MANAGER_CONTRACTS_ABI_URL` - URL to SKALE Manager contracts ABI and addresses
- `IMA_CONTRACTS_ABI_URL` - URL to IMA contracts ABI and addresses
Expand Down
1 change: 0 additions & 1 deletion node_cli/configs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
G_CONF_HOME = os.getenv('TEST_HOME_DIR') or GLOBAL_CONFIG['home_dir']

SKALE_STATE_DIR = '/var/lib/skale'
SCHAIN_STATE_DIR = os.path.join('/var/lib/skale', 'schains')
FILESTORAGE_MAPPING = os.path.join(SKALE_STATE_DIR, 'filestorage')
SNAPSHOTS_SHARED_VOLUME = 'shared-space'
SCHAINS_MNT_DIR_REGULAR = '/mnt'
Expand Down
1 change: 0 additions & 1 deletion node_cli/configs/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
ALLOWED_ENV_TYPES = ['mainnet', 'testnet', 'qanet', 'devnet']

REQUIRED_PARAMS = {
'IMA_ENDPOINT': '',
'CONTAINER_CONFIGS_STREAM': '',
'ENDPOINT': '',
'MANAGER_CONTRACTS_ABI_URL': '',
Expand Down
7 changes: 0 additions & 7 deletions node_cli/core/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@

import json

from node_cli.utils.print_formatters import print_wallet_info, TEXTS
from node_cli.utils.helper import error_exit, get_request, post_request, logger
from node_cli.utils.exit_codes import CLIExitCodes


BLUEPRINT_NAME = 'wallet'


def get_wallet_info(_format):
status, payload = get_request(BLUEPRINT_NAME, 'info')
Expand Down
5 changes: 2 additions & 3 deletions node_cli/operations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
from node_cli.utils.docker_utils import (
compose_rm,
compose_up,
compose_up_sync,
docker_cleanup,
remove_dynamic_containers
)
Expand Down Expand Up @@ -225,7 +224,7 @@ def init_sync(
)
update_resource_allocation(env_type=env['ENV_TYPE'])
update_images(env.get('CONTAINER_CONFIGS_DIR') != '', sync_node=True)
compose_up_sync(env)
compose_up(env, sync_node=True)
return True


Expand Down Expand Up @@ -266,7 +265,7 @@ def update_sync(env_filepath: str, env: Dict) -> bool:
distro.version()
)
update_images(env.get('CONTAINER_CONFIGS_DIR') != '', sync_node=True)
compose_up_sync(env)
compose_up(env, sync_node=True)
return True


Expand Down
4 changes: 2 additions & 2 deletions node_cli/operations/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
DOCKER_LVMPY_REPO_URL,
FILESTORAGE_MAPPING,
SCHAINS_MNT_DIR_REGULAR,
SCHAIN_STATE_DIR,
SCHAINS_MNT_DIR_SYNC,
SKALE_STATE_DIR
)

Expand Down Expand Up @@ -147,7 +147,7 @@ def prepare_block_device(block_device, force=False):
else:
logger.info('%s contains %s filesystem', block_device, filesystem)
format_as_btrfs(block_device)
mount_device(block_device, SCHAIN_STATE_DIR)
mount_device(block_device, SCHAINS_MNT_DIR_SYNC)


def max_resize_btrfs(path):
Expand Down
10 changes: 5 additions & 5 deletions node_cli/utils/docker_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ def get_compose_path(sync_node: bool) -> str:


def compose_up(env, sync_node=False):
if sync_node:
logger.info('Running containers for sync node')
run_cmd(cmd=get_up_compose_sync_cmd(), env=env)
return

logger.info('Running base set of containers')

if 'SGX_CERTIFICATES_DIR_NAME' not in env:
Expand All @@ -247,11 +252,6 @@ def compose_up(env, sync_node=False):
run_cmd(cmd=get_up_compose_cmd(NOTIFICATION_COMPOSE_SERVICES), env=env)


def compose_up_sync(env) -> None:
logger.info('Running containers for sync node')
run_cmd(cmd=get_up_compose_sync_cmd(), env=env)


def restart_nginx_container(dutils=None):
dutils = dutils or docker_client()
nginx_container = dutils.containers.get(NGINX_CONTAINER_NAME)
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/sync_node_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_init_sync_archive_catchup(mocked_g_config, clean_node_options):
mock.patch('node_cli.operations.base.update_meta'), \
mock.patch('node_cli.operations.base.update_resource_allocation'), \
mock.patch('node_cli.operations.base.update_images'), \
mock.patch('node_cli.operations.base.compose_up_sync'), \
mock.patch('node_cli.operations.base.compose_up'), \
mock.patch('node_cli.core.resources.get_disk_size', return_value=BIG_DISK_SIZE), \
mock.patch('node_cli.core.node.configure_firewall_rules'), \
mock.patch('node_cli.utils.decorators.is_node_inited', return_value=False):
Expand Down
4 changes: 0 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,6 @@ def clean_node_options():
pathlib.Path(NODE_OPTIONS_FILEPATH).unlink(missing_ok=True)


def clean_node_data():
pass


@pytest.fixture
def resource_alloc():
with open(RESOURCE_ALLOCATION_FILEPATH, 'w') as alloc_file:
Expand Down

0 comments on commit ff59242

Please sign in to comment.