Skip to content

Commit

Permalink
add memory debugging to userflow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim Fehrs committed Sep 21, 2023
1 parent 9144d3d commit 2b6cbe7
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion node-runner-cli/commands/dockercommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 2 additions & 3 deletions node-runner-cli/setup/DockerSetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 = {}
Expand Down
13 changes: 12 additions & 1 deletion node-runner-cli/tests/userflows/install-docker-all-same-host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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
24 changes: 15 additions & 9 deletions node-runner-cli/tests/userflows/install-systemd-simple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down Expand Up @@ -105,21 +108,24 @@ 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

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
./babylonnode systemd stop

df -H
docker system df

0 comments on commit 2b6cbe7

Please sign in to comment.