diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3078e129..7a521515 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -599,7 +599,7 @@ jobs: run: | chmod +x ./babylonnode sudo apt-get update - sudo apt-get install -y postgresql-client jq + sudo apt-get install -y postgresql-client jq docker-compose ./babylonnode docker dependencies - name: "Execute User Flow: Install Core, Gateway and Monitoring on the same host" run: | diff --git a/node-runner-cli/commands/dockercommand.py b/node-runner-cli/commands/dockercommand.py index 6f4a3390..2e64aa53 100644 --- a/node-runner-cli/commands/dockercommand.py +++ b/node-runner-cli/commands/dockercommand.py @@ -175,7 +175,7 @@ def start(args): docker_config = DockerSetup.check_set_passwords(docker_config) ########## Install dependent services DockerSetup.conditionally_start_local_postgres(docker_config) - compose = DockerSetup.get_existing_compose_file(docker_config) + compose = DockerSetup.get_existing_compose_file(docker_config.common_config.docker_compose) if compose is None: print("No docker-compose file found.") print("Execute `babylonnode docker config/install` and try again") diff --git a/node-runner-cli/setup/DockerSetup.py b/node-runner-cli/setup/DockerSetup.py index 35905215..24123db1 100644 --- a/node-runner-cli/setup/DockerSetup.py +++ b/node-runner-cli/setup/DockerSetup.py @@ -126,8 +126,7 @@ def check_post_db_local(docker_config: DockerConfig): return False @staticmethod - def get_existing_compose_file(docker_config: DockerConfig) -> dict: - compose_file = docker_config.common_config.docker_compose + def get_existing_compose_file(compose_file: str) -> dict: Helpers.section_headline("Checking if you have existing docker compose file") if os.path.exists(compose_file): return Helpers.yaml_as_dict(compose_file) @@ -311,7 +310,7 @@ def confirm_config_changes(argument_object: DockerInstallArguments, docker_confi def confirm_docker_compose_file_changes(docker_config: DockerConfig, autoapprove: bool): docker_compose_yaml: yaml = DockerSetup.render_docker_compose(docker_config) backup_time = Helpers.get_current_date_time() - compose_file_yaml = DockerSetup.get_existing_compose_file(docker_config) + compose_file_yaml = DockerSetup.get_existing_compose_file(docker_config.common_config.docker_compose) compose_file = docker_config.common_config.docker_compose if compose_file_yaml is not None: compose_file_yaml = {} diff --git a/node-runner-cli/tests/userflows/install-docker-all-same-host.sh b/node-runner-cli/tests/userflows/install-docker-all-same-host.sh index e3c32a5d..5933a8bd 100755 --- a/node-runner-cli/tests/userflows/install-docker-all-same-host.sh +++ b/node-runner-cli/tests/userflows/install-docker-all-same-host.sh @@ -3,6 +3,9 @@ set -x set -e whoami +df -H +docker system df + # enable thos in case you want to execute this locally or on a fresh node. #export KEYSTORE_PASSWORD=radix #export POSTGRES_PASSWORD=radix @@ -96,7 +99,7 @@ done set -e echo "Testing postgres is set up correctly" -systemctl status postgresql@12-main.service --no-pager +sudo systemctl status postgresql@12-main.service --no-pager PGPASSWORD=$POSTGRES_PASSWORD psql -h localhost -U postgres -d radixdlt_ledger -P pager=off -c "\dt" echo "Testing gateway endpoints available" @@ -123,5 +126,13 @@ curl -k -f -u "metrics:${NGINX_METRICS_PASSWORD}" https://localhost/gateway/metr echo "Everything seem to work just fine." echo "Cleaning up" +df -H +docker system df +PGPASSWORD=$POSTGRES_PASSWORD psql -h localhost -U postgres -d radixdlt_ledger -P pager=off -c "\l+" +PGPASSWORD=$POSTGRES_PASSWORD psql -h localhost -U postgres -d radixdlt_ledger -P pager=off -c "select pg_size_pretty(pg_database_size('radixdlt_ledger'));" +PGPASSWORD=$POSTGRES_PASSWORD psql -h localhost -U postgres -d radixdlt_ledger -P pager=off -c "select pg_size_pretty(pg_database_size('radixdlt_ledger'));" + ./babylonnode docker stop ./babylonnode monitoring stop +sudo systemctl stop postgresql@12-main.service --no-pager +sudo systemctl disable postgresql@12-main.service --no-pager \ No newline at end of file diff --git a/node-runner-cli/tests/userflows/install-systemd-simple.sh b/node-runner-cli/tests/userflows/install-systemd-simple.sh index 5ff2a3d7..9afbd729 100755 --- a/node-runner-cli/tests/userflows/install-systemd-simple.sh +++ b/node-runner-cli/tests/userflows/install-systemd-simple.sh @@ -12,6 +12,9 @@ whoami #export NETWORK_ID=14 #export NETWORK_NAME=zabanet +df -H +docker system df + export DISABLE_VERSION_CHECK=true export COMPOSE_HTTP_TIMEOUT=360 #Below PATH require when ansible is installed as part of pip @@ -36,18 +39,18 @@ cat ${HOME}/babylon-node-config/config.yaml ./babylonnode systemd install -a echo "Check radixdlt service status" -systemctl status radixdlt-node.service --no-pager +sudo systemctl status radixdlt-node.service --no-pager echo "Check nginx service status" -systemctl status nginx.service --no-pager +sudo systemctl status nginx.service --no-pager sleep 10 echo "Checking radixdlt service status again" -systemctl status radixdlt-node.service --no-pager +sudo systemctl status radixdlt-node.service --no-pager echo "Checking nginx service status again" -systemctl status nginx.service --no-pager +sudo systemctl status nginx.service --no-pager echo "Set credentials" ./babylonnode auth set-admin-password --setupmode SYSTEMD -p ${NGINX_ADMIN_PASSWORD} @@ -105,10 +108,10 @@ echo "Stopping systemd service" sleep 10 echo "Checking radixdlt service status again" -systemctl status radixdlt-node.service --no-pager | true +sudo systemctl status radixdlt-node.service --no-pager | true echo "Checking nginx service status again" -systemctl status nginx.service --no-pager| true +sudo systemctl status nginx.service --no-pager| true echo "Starting systemd service" ./babylonnode systemd start @@ -116,10 +119,13 @@ echo "Starting systemd service" sleep 10 echo "Checking radixdlt service status again" -systemctl status radixdlt-node.service --no-pager +sudo systemctl status radixdlt-node.service --no-pager echo "Checking nginx service status again" -systemctl status nginx.service --no-pager +sudo systemctl status nginx.service --no-pager echo "Stopping systemd service" -./babylonnode systemd stop \ No newline at end of file +./babylonnode systemd stop + +df -H +docker system df \ No newline at end of file