From ecae4f8b9d18f6fd5fa77714418acde8d4d393f4 Mon Sep 17 00:00:00 2001 From: smoehrle <26185187+smoehrle@users.noreply.github.com> Date: Wed, 31 Aug 2022 13:52:48 +0200 Subject: [PATCH] Add some documentation --- README.md | 33 ++++++++++++++++++++++--- galaxy_benchmarker/benchmarks/fio.py | 16 +++++++++--- galaxy_benchmarker/benchmarks/galaxy.py | 9 ++++--- 3 files changed, 48 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 696901eb..b0037128 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Galaxy Benchmarker -TODO... +A tool for benchmarking different storage types individually or in more complex setups like Galaxy in combination with iRODS. + +Link to the [original version](https://github.com/usegalaxy-eu/GalaxyBenchmarker/tree/668b9a5125541f686d00950a0e862a260ca4b787) of the GalaxyBenchmarker. ## Basic architecture @@ -14,6 +16,7 @@ state after benchmarking. ``` . ├── ansible -- Ansible playbooks and inventory +├── evaluation -- Example plot code in jupiter notebooks ├── examples -- Example configurations ├── galaxy_benchmarker -- Source code ├── logs -- Generated logs @@ -28,7 +31,9 @@ environment or as a local project. For the container env it automatically maps SSH (config, agent, ...) inside the container. With this you can use your local SSH config and keys within the inventory. -### Inside container +[Example usage described here](#example-usage) + +### Run with container ```bash @@ -52,7 +57,7 @@ make stop make stop_sudo ``` -### Local +### Run locally This project requires [Poetry](https://python-poetry.org/docs/). @@ -72,3 +77,25 @@ The targets/hosts are defined in [ansible/inventory/](./ansible/inventory/) as Here, you can also set host specific variables, if necessary. The defined hosts can then be used throughout the various benchmarker configs. + +## Example usage + +1. All examples use `irods_client` and `irods_server` as aliases for the hosts. These hosts have to be configured in [the inventory](./ansible/inventory/example.yml) +1. Run the GalaxyBenchmarker with `--cfg examples/01_verify_setup.yml` to verify the setup. + + +## Debugging + +1. Change the configuration for more detailed logging + ``` + log_ansible_output: true + results_save_raw_results: true + ``` + +1. Run GalaxyBenchmarker with the flags `--only-pre-task`, `--only-benchmark`, and `--only-post-task` to check the individual stages + +1. Have a look into the logs of the container: + ``` + irods-fuse -> /tmp + irods -> /var/lib/irods/log/ + ``` diff --git a/galaxy_benchmarker/benchmarks/fio.py b/galaxy_benchmarker/benchmarks/fio.py index 64f3eadc..2e450e2b 100644 --- a/galaxy_benchmarker/benchmarks/fio.py +++ b/galaxy_benchmarker/benchmarks/fio.py @@ -255,8 +255,16 @@ def _parse_job_result(result: dict, prefix: str) -> dict[str, Any]: f"{prefix}_iops_max": result["iops_max"], f"{prefix}_iops_mean": result["iops_mean"], f"{prefix}_iops_stddev": result["iops_stddev"], - f"{prefix}_lat_min_in_ms": result["lat_ns"]["min"] / 1_000_000 if result["bw_mean"] > 0 else 0.0, - f"{prefix}_lat_max_in_ms": result["lat_ns"]["max"] / 1_000_000 if result["bw_mean"] > 0 else 0.0, - f"{prefix}_lat_mean_in_ms": result["lat_ns"]["mean"] / 1_000_000 if result["bw_mean"] > 0 else 0.0, - f"{prefix}_lat_stddev_in_ms": result["lat_ns"]["stddev"] / 1_000_000 if result["bw_mean"] > 0 else 0.0, + f"{prefix}_lat_min_in_ms": result["lat_ns"]["min"] / 1_000_000 + if result["bw_mean"] > 0 + else 0.0, + f"{prefix}_lat_max_in_ms": result["lat_ns"]["max"] / 1_000_000 + if result["bw_mean"] > 0 + else 0.0, + f"{prefix}_lat_mean_in_ms": result["lat_ns"]["mean"] / 1_000_000 + if result["bw_mean"] > 0 + else 0.0, + f"{prefix}_lat_stddev_in_ms": result["lat_ns"]["stddev"] / 1_000_000 + if result["bw_mean"] > 0 + else 0.0, } diff --git a/galaxy_benchmarker/benchmarks/galaxy.py b/galaxy_benchmarker/benchmarks/galaxy.py index df041287..0f39199b 100644 --- a/galaxy_benchmarker/benchmarks/galaxy.py +++ b/galaxy_benchmarker/benchmarks/galaxy.py @@ -187,7 +187,8 @@ def __init__(self, name: str, config: dict, benchmarker: Benchmarker): ) self._post_tasks.append( ansible.AnsibleTask( - playbook="cleanup_galaxy_server.yml", host=self.destination.host, + playbook="cleanup_galaxy_server.yml", + host=self.destination.host, extra_vars={ "galaxy_export_volume": self.config.export_volume, }, @@ -254,7 +255,8 @@ def __init__(self, name: str, config: dict, benchmarker: Benchmarker): ) self._post_tasks.append( ansible.AnsibleTask( - playbook="cleanup_galaxy_server.yml", host=self.destination.host, + playbook="cleanup_galaxy_server.yml", + host=self.destination.host, extra_vars={ "galaxy_export_volume": self.config.export_volume, }, @@ -288,7 +290,8 @@ def __init__(self, name: str, config: dict, benchmarker: Benchmarker): ) self._post_tasks.append( ansible.AnsibleTask( - playbook="cleanup_galaxy_server.yml", host=self.destination.host, + playbook="cleanup_galaxy_server.yml", + host=self.destination.host, extra_vars={ "galaxy_export_volume": self.config.export_volume, },