diff --git a/monitoring/uss_qualifier/configurations/dev/README.md b/monitoring/uss_qualifier/configurations/dev/README.md index 86eb26f425..0409783fd1 100644 --- a/monitoring/uss_qualifier/configurations/dev/README.md +++ b/monitoring/uss_qualifier/configurations/dev/README.md @@ -55,7 +55,7 @@ Same configuration as [uspace](#uspace), except only the portions related to AST Intended to be an InterUSS interpretation of how to verify the requirements of the [US Shared Airspace group](https://github.com/utmimplementationus/getstarted) verified via automated testing as documented in their [Requirements Traceability Matrix for Strategic Coordination](https://github.com/utmimplementationus/getstarted/blob/main/docs/Strategic_Coordination_Compliance_Matrix_v1.0.xlsx). Note that this is merely InterUSS's interpretation of the publicly-available information for that project and this test configuration may not exactly match the test configuration actually in use by that group (which is not organizationally affiliated with InterUSS). InterUSS welcomes contributions to change this test configuration to better align with the intent of that group. -The baseline portion of the test configuration is found in [utm_implementation_us_baseline.libsonnet](utm_implementation_us_baseline.libsonnet) and the environmental portion of the test configuration is found in [utm_implementation_us_env_local.libsonnet](utm_implementation_us_env_local.libsonnet). The top-level test configuration [utm_implementation_us.jsonnet](utm_implementation_us.jsonnet) combines the test baseline with the test environment to form a full test configuration. +The baseline portion of the test configuration is found in [baseline.libsonnet](utm_implementation_us_lib/baseline.libsonnet) and the environmental portion of the test configuration is found in [env_all.libsonnet](utm_implementation_us_lib/local/env_all.libsonnet). The top-level test configuration [utm_implementation_us.jsonnet](utm_implementation_us.jsonnet) combines the test baseline with the test environment to form a full test configuration. ### Environment characteristics @@ -74,9 +74,11 @@ To adapt this configuration to target a non-local ecosystem and USS: * Make appropriately-named copies of the environmental and top-level configurations. * For instance, if testing in a pre-qualification environment, appropriate renaming might be: * utm_implementation_us.jsonnet -> utm_implementation_us_prequal.jsonnet - * utm_implementation_us_env_local.jsonnet -> utm_implementation_us_env_prequal.jsonnet + * local (folder) -> prequal (folder) * These appropriately-named copies may be put into the [personal](../personal) folder to make modifications without affecting git-tracked files. * Edit the new top-level configuration (e.g., utm_implementation_us_prequal.jsonnet) to point to the appropriate test baseline and test environment - * The relative path of utm_implementation_us_baseline.libsonnet may need to be adjusted. For instance, if the top-level configuration is now in the personal folder, `import 'utm_implementation_us_baseline.libsonnet'` must be changed to `import '../dev/utm_implementation_us_baseline.libsonnet'` - * The imported filename for `env` must be updated to the new environment filename (e.g., utm_implementation_us_env_prequal.jsonnet) -* Edit the new environmental configuration (e.g., utm_implementation_us_env_prequal.libsonnet) to accurately describe the environment in which the new test is being conducted. + * The relative path of baseline.libsonnet may need to be adjusted. For instance, if the top-level configuration is now in the personal folder, `import 'utm_implementation_us_lib/baseline.libsonnet'` must be changed to `import '../dev/utm_implementation_us_lib/baseline.libsonnet'` + * The imported filename for the environment must be updated to the new environment filename (e.g., prequal/env_all.jsonnet) +* Edit the new participant-agnostic environmental configuration (e.g., prequal/env.libsonnet) to accurately describe the environment in which the new test is being conducted. +* Edit and rename environmental configurations for participants (e.g., uss1.libsonnet, uss2.libsonnet) to accurately describe these participants and their systems under test. +* Edit the new participant-specific environmental configuration (e.g., prequal/env_all.libsonnet) to accurately describe the participants in the new environment. diff --git a/monitoring/uss_qualifier/configurations/dev/utm_implementation_us.jsonnet b/monitoring/uss_qualifier/configurations/dev/utm_implementation_us.jsonnet index b4be3b7f9e..80e6785dc2 100644 --- a/monitoring/uss_qualifier/configurations/dev/utm_implementation_us.jsonnet +++ b/monitoring/uss_qualifier/configurations/dev/utm_implementation_us.jsonnet @@ -2,7 +2,7 @@ // Regardless of environment (which systems are tested and where they are), this baseline defines the overall behavior // of the test. -local baseline = import 'utm_implementation_us_baseline.libsonnet'; +local baseline = import 'utm_implementation_us_lib/baseline.libsonnet'; // This environmental information will be provided to the underlying test baseline to form the full test configuration. // To test a system in a different environment with the same baseline, simply import and provide a different environment @@ -10,7 +10,7 @@ local baseline = import 'utm_implementation_us_baseline.libsonnet'; // Note that the environment does not need to be defined in a separate file (utm_implementation_us_env_local.libsonnet). // If a particular environment specification was not going to be used to create multiple test configurations from // multiple test baselines, it could be defined directly in this file instead of a separate file. -local env = import 'utm_implementation_us_env_local.libsonnet'; +local env = import 'utm_implementation_us_lib/local/env_all.libsonnet'; // The full test configuration is the baseline template/function applied/evaluated with our particular environment. baseline(env) diff --git a/monitoring/uss_qualifier/configurations/dev/utm_implementation_us_baseline.libsonnet b/monitoring/uss_qualifier/configurations/dev/utm_implementation_us_lib/baseline.libsonnet similarity index 100% rename from monitoring/uss_qualifier/configurations/dev/utm_implementation_us_baseline.libsonnet rename to monitoring/uss_qualifier/configurations/dev/utm_implementation_us_lib/baseline.libsonnet diff --git a/monitoring/uss_qualifier/configurations/dev/utm_implementation_us_env_local.libsonnet b/monitoring/uss_qualifier/configurations/dev/utm_implementation_us_lib/local/env.libsonnet similarity index 65% rename from monitoring/uss_qualifier/configurations/dev/utm_implementation_us_env_local.libsonnet rename to monitoring/uss_qualifier/configurations/dev/utm_implementation_us_lib/local/env.libsonnet index c2869a0b28..454178862f 100644 --- a/monitoring/uss_qualifier/configurations/dev/utm_implementation_us_env_local.libsonnet +++ b/monitoring/uss_qualifier/configurations/dev/utm_implementation_us_lib/local/env.libsonnet @@ -1,5 +1,6 @@ -{ +function(participants) { // This file contains environmental (non-baseline) parameters for the utm_implementation_us.jsonnet test configuration for the standard local CI environment. + // It is parameterized on which participants to include in the test. // Top-level keys are used in utm_implementation_us_baseline.jsonnet when this content is provided as `env`. resource_declarations: { // Means by which uss_qualifier can obtain authorization to make requests in an ASTM USS ecosystem @@ -41,18 +42,9 @@ }, specification: { instances: [ - { - participant_id: 'uss1_core', - interuss: { - base_url: 'http://scdsc.uss1.localutm/versioning', - }, - }, - { - participant_id: 'uss2_core', - interuss: { - base_url: 'http://scdsc.uss2.localutm/versioning', - }, - }, + participant.test_env_version_provider + for participant in participants + if 'test_env_version_provider' in participant ], }, }, @@ -65,18 +57,9 @@ }, specification: { instances: [ - { - participant_id: 'uss1_core', - interuss: { - base_url: 'http://scdsc.uss1.localutm/versioning', - }, - }, - { - participant_id: 'uss2_core', - interuss: { - base_url: 'http://scdsc.uss2.localutm/versioning', - }, - }, + participant.prod_env_version_provider + for participant in participants + if 'prod_env_version_provider' in participant ], }, }, @@ -89,17 +72,9 @@ }, specification: { flight_planners: [ - // uss1 is the mock_uss directly exposing flight planning functionality - { - participant_id: 'uss1_core', - v1_base_url: 'http://scdsc.uss1.localutm/flight_planning/v1', - }, - - // uss2 is another mock_uss directly exposing flight planning functionality - { - participant_id: 'uss2_core', - v1_base_url: 'http://scdsc.uss2.localutm/flight_planning/v1', - }, + participant.flight_planner + for participant in participants + if 'flight_planner' in participant ], }, }, @@ -124,20 +99,10 @@ }, specification: { dss_instances: [ - { - participant_id: 'uss1_dss', - user_participant_ids: [ - // Participants using a DSS instance they do not provide should be listed as users of that DSS (so that they can take credit for USS requirements enforced by the DSS) - 'mock_uss', // mock_uss uses this DSS instance; it does not provide its own instance - ], - base_url: 'http://dss.uss1.localutm', - has_private_address: true, // This should be removed for production systems - }, - { - participant_id: 'uss2_dss', - base_url: 'http://dss.uss2.localutm', - has_private_address: true, // This should be removed for production systems - }, + instance + for participant in participants + if 'dss_instances' in participant + for instance in participant.dss_instances ], }, }, @@ -156,18 +121,13 @@ }, aggregate_participants: { - uss1: [ - 'uss1_core', - 'uss1_dss', - ], - uss2: [ - 'uss2_core', - 'uss2_dss', - ], + [participant.participant_id]: participant.aggregate_participant_ids + for participant in participants + if 'aggregate_participant_ids' in participant }, participant_requirements: { - uss1: 'Basic SCD with DSS provision', - uss2: 'Basic SCD without DSS provision', + [participant.participant_id]: participant.participant_requirements + for participant in participants }, } diff --git a/monitoring/uss_qualifier/configurations/dev/utm_implementation_us_lib/local/env_all.libsonnet b/monitoring/uss_qualifier/configurations/dev/utm_implementation_us_lib/local/env_all.libsonnet new file mode 100644 index 0000000000..b2edb2d83a --- /dev/null +++ b/monitoring/uss_qualifier/configurations/dev/utm_implementation_us_lib/local/env_all.libsonnet @@ -0,0 +1,5 @@ +local env_local = import 'env.libsonnet'; +local uss1 = import 'uss1.libsonnet'; +local uss2 = import 'uss2.libsonnet'; + +env_local([uss1, uss2]) diff --git a/monitoring/uss_qualifier/configurations/dev/utm_implementation_us_lib/local/uss1.libsonnet b/monitoring/uss_qualifier/configurations/dev/utm_implementation_us_lib/local/uss1.libsonnet new file mode 100644 index 0000000000..3adfd77184 --- /dev/null +++ b/monitoring/uss_qualifier/configurations/dev/utm_implementation_us_lib/local/uss1.libsonnet @@ -0,0 +1,48 @@ +{ + // ID of participant + participant_id: 'uss1', + + // Set of requirements this participant must satisfy + participant_requirements: 'Basic SCD with DSS provision', + + // (optional) IDs of subcomponents that make up this participant + aggregate_participant_ids: [ + 'uss1_core', + 'uss1_dss', + ], + + // (optional) Means by which to interact with the participant as a flight planner + flight_planner: { + participant_id: 'uss1_core', + v1_base_url: 'http://scdsc.uss1.localutm/flight_planning/v1', + }, + + // (optional) Means by which to obtain this participant's software version in the test environment + test_env_version_provider: { + participant_id: 'uss1_core', + interuss: { + base_url: 'http://scdsc.uss1.localutm/versioning', + }, + }, + + // (optional) Means by which to obtain this participant's software version in the prod environment + prod_env_version_provider: { + participant_id: 'uss1_core', + interuss: { + base_url: 'http://scdsc.uss1.localutm/versioning', + }, + }, + + // (optional) List of DSS instances hosted by this participant + dss_instances: [ + { + participant_id: 'uss1_dss', + user_participant_ids: [ + // Participants using a DSS instance they do not provide should be listed as users of that DSS (so that they can take credit for USS requirements enforced by the DSS) + 'mock_uss', // mock_uss uses this DSS instance; it does not provide its own instance + ], + base_url: 'http://dss.uss1.localutm', + has_private_address: true, // This should be removed for production systems + }, + ] +} diff --git a/monitoring/uss_qualifier/configurations/dev/utm_implementation_us_lib/local/uss2.libsonnet b/monitoring/uss_qualifier/configurations/dev/utm_implementation_us_lib/local/uss2.libsonnet new file mode 100644 index 0000000000..500cac6b06 --- /dev/null +++ b/monitoring/uss_qualifier/configurations/dev/utm_implementation_us_lib/local/uss2.libsonnet @@ -0,0 +1,44 @@ +{ + // ID of participant + participant_id: 'uss2', + + // Set of requirements this participant must satisfy + participant_requirements: 'Basic SCD without DSS provision', + + // (optional) IDs of subcomponents that make up this participant + aggregate_participant_ids: [ + 'uss2_core', + 'uss2_dss', + ], + + // (optional) Means by which to interact with the participant as a flight planner + flight_planner: { + participant_id: 'uss2_core', + v1_base_url: 'http://scdsc.uss2.localutm/flight_planning/v1', + }, + + // (optional) Means by which to obtain this participant's software version in the test environment + test_env_version_provider: { + participant_id: 'uss2_core', + interuss: { + base_url: 'http://scdsc.uss2.localutm/versioning', + }, + }, + + // (optional) Means by which to obtain this participant's software version in the prod environment + prod_env_version_provider: { + participant_id: 'uss2_core', + interuss: { + base_url: 'http://scdsc.uss2.localutm/versioning', + }, + }, + + // (optional) List of DSS instances hosted by this participant + dss_instances: [ + { + participant_id: 'uss2_dss', + base_url: 'http://dss.uss2.localutm', + has_private_address: true, // This should be removed for production systems + }, + ] +} diff --git a/monitoring/uss_qualifier/fileio.py b/monitoring/uss_qualifier/fileio.py index 71fcbc2c4d..67613c0a69 100644 --- a/monitoring/uss_qualifier/fileio.py +++ b/monitoring/uss_qualifier/fileio.py @@ -176,8 +176,7 @@ def _jsonnet_import_callback( if rel.endswith(".libsonnet"): # Do not attempt to parse libsonnet content (e.g., resolve $refs); # it will be parsed after loading the full top-level Jsonnet. - root_path = os.path.dirname(base_file_name) - file_name = os.path.join(root_path, rel) + file_name = os.path.join(folder, rel) file_content = _load_content_from_file_name(file_name) return file_name, file_content.encode() else: