Skip to content

Commit

Permalink
[uss_qualifier] Extract individual participant definitions in utm_imp…
Browse files Browse the repository at this point in the history
…lementation_us (#743)

Extract individual participant definitions in utm_implementation_us
  • Loading branch information
BenjaminPelletier authored Aug 6, 2024
1 parent cac1298 commit 843e69a
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 69 deletions.
12 changes: 7 additions & 5 deletions monitoring/uss_qualifier/configurations/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

// 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
// configuration.
// 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)
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
],
},
},
Expand All @@ -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
],
},
},
Expand All @@ -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
],
},
},
Expand All @@ -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
],
},
},
Expand All @@ -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
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
local env_local = import 'env.libsonnet';
local uss1 = import 'uss1.libsonnet';
local uss2 = import 'uss2.libsonnet';

env_local([uss1, uss2])
Original file line number Diff line number Diff line change
@@ -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
},
]
}
Original file line number Diff line number Diff line change
@@ -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
},
]
}
3 changes: 1 addition & 2 deletions monitoring/uss_qualifier/fileio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 843e69a

Please sign in to comment.