From 9fb05227594b479ffb77104ed39082054cdaa00e Mon Sep 17 00:00:00 2001 From: Nick Hagerty Date: Thu, 5 Sep 2024 14:32:12 -0400 Subject: [PATCH] Updating config file to allow SiteCustom section. Updated example ini files to reflect the change --- configs/example_machine.ini | 8 ++++---- configs/olcf_examples/crusher.ini | 22 ---------------------- configs/olcf_examples/frontier.ini | 11 +++++++++-- configs/olcf_examples/summit.ini | 11 +++++++++-- harness/libraries/config_file.py | 16 ++++++++-------- 5 files changed, 30 insertions(+), 38 deletions(-) delete mode 100644 configs/olcf_examples/crusher.ini diff --git a/configs/example_machine.ini b/configs/example_machine.ini index c95809e..2775dd5 100644 --- a/configs/example_machine.ini +++ b/configs/example_machine.ini @@ -5,10 +5,6 @@ scheduler_type = slurm joblauncher_type = srun cpus_per_node = 16 gpus_per_node = 1 -batch_queue = batch -project_id = abc123 -submit_args = -nccs_test_harness_module = olcf_harness [RepoDetails] type_of_repository = git @@ -20,6 +16,10 @@ git_ssh_server_url = gitlab@github.com git_https_server_url = https://github.com [TestshotDefaults] +batch_queue = batch +project_id = abc123 +submit_args = path_to_sspace = /home/a_user/other_dir system_log_tag = a_label +[SiteCustom] diff --git a/configs/olcf_examples/crusher.ini b/configs/olcf_examples/crusher.ini deleted file mode 100644 index 8c8e507..0000000 --- a/configs/olcf_examples/crusher.ini +++ /dev/null @@ -1,22 +0,0 @@ -[MachineDetails] -machine_name = crusher -machine_type = linux_x86_64 -scheduler_type = slurm -joblauncher_type = srun -cpus_per_node = 56 -gpus_per_node = 8 -batch_queue = batch -submit_args = - -# This section is optional, if you don't have a git repo to connect with. -# Without connecting to a repo, you will need to manually place your tests as needed. -[RepoDetails] -type_of_repository = git -git_reps_branch = master -git_data_transfer_protocol = ssh -git_machine_name = crusher -git_server_application_parent_dir = olcf/olcf-test-harness-examples -git_ssh_server_url = github@github.com -git_https_server_url = https://github.com - -[TestshotDefaults] diff --git a/configs/olcf_examples/frontier.ini b/configs/olcf_examples/frontier.ini index 0704f27..6ec9ff5 100644 --- a/configs/olcf_examples/frontier.ini +++ b/configs/olcf_examples/frontier.ini @@ -5,8 +5,6 @@ scheduler_type = slurm joblauncher_type = srun cpus_per_node = 56 gpus_per_node = 8 -batch_queue = batch -submit_args = # This section is optional, if you don't have a git repo to connect with. # Without connecting to a repo, you will need to manually place your tests as needed. @@ -20,3 +18,12 @@ git_ssh_server_url = github@github.com git_https_server_url = https://github.com [TestshotDefaults] +project_id = +batch_queue = batch +submit_args = +path_to_sspace = /path/to/sspace +system_log_tag = frontier_test + +[SiteCustom] +# Use this for custom environment variables that you may want to use in tests. +# This is a good place for database environment variables (ie, influxdb_uri, influxdb_token) diff --git a/configs/olcf_examples/summit.ini b/configs/olcf_examples/summit.ini index fbee378..d0aeace 100644 --- a/configs/olcf_examples/summit.ini +++ b/configs/olcf_examples/summit.ini @@ -5,8 +5,6 @@ scheduler_type = lsf joblauncher_type = jsrun cpus_per_node = 42 gpus_per_node = 6 -batch_queue = batch -submit_args = # This section is optional, if you don't have a git repo to connect with. # Without connecting to a repo, you will need to manually place your tests as needed. @@ -20,3 +18,12 @@ git_ssh_server_url = github@github.com git_https_server_url = https://github.com [TestshotDefaults] +project_id = +batch_queue = batch +submit_args = +path_to_sspace = /path/to/sspace +system_log_tag = frontier_test + +[SiteCustom] +# Use this for custom environment variables that you may want to use in tests. +# This is a good place for database environment variables (ie, influxdb_uri, influxdb_token) diff --git a/harness/libraries/config_file.py b/harness/libraries/config_file.py index 45f1b60..1fd8cf3 100644 --- a/harness/libraries/config_file.py +++ b/harness/libraries/config_file.py @@ -9,7 +9,7 @@ class rgt_config_file: # These are the named sections in the config file. machine_section = 'MachineDetails' repository_section = 'RepoDetails' - influx_section = 'InfluxDefaults' + site_section = 'SiteCustom' testshot_section = 'TestshotDefaults' def __init__(self, @@ -18,7 +18,7 @@ def __init__(self, self.__machine_vars = {} self.__repo_vars = {} - self.__influx_vars = {} + self.__site_vars = {} self.__testshot_vars = {} if machinename != None: @@ -55,10 +55,10 @@ def __read_config_file(self): self.__repo_vars = master_cfg[rgt_config_file.repository_section] set_harness_environment(self.__repo_vars) - # Make Influx section optional, since some users don't use Influx - if master_cfg.has_section(rgt_config_file.influx_section): - self.__influx_vars = master_cfg[rgt_config_file.influx_section] - set_harness_environment(self.__influx_vars) + # Site-cutom configuration section is optional + if master_cfg.has_section(rgt_config_file.site_section): + self.__site_vars = master_cfg[rgt_config_file.site_section] + set_harness_environment(self.__site_vars) self.__testshot_vars = master_cfg[rgt_config_file.testshot_section] set_harness_environment(self.__testshot_vars) @@ -74,8 +74,8 @@ def get_machine_config(self): def get_repository_config(self): return self.__repo_vars - def get_influx_config(self): - return self.__influx_vars + def get_site_config(self): + return self.__site_vars def get_testshot_config(self): return self.__testshot_vars