Skip to content

Commit

Permalink
[uss_qualifier] Replace has_private_address by new resource TestExclu…
Browse files Browse the repository at this point in the history
…sionResource (#753)

[uss_qualifier] Replace has_private_adress by new resource TestExclusionResource
  • Loading branch information
mickmis authored Aug 15, 2024
1 parent 8b760a6 commit 8d9526c
Show file tree
Hide file tree
Showing 37 changed files with 199 additions and 85 deletions.
3 changes: 3 additions & 0 deletions monitoring/uss_qualifier/configurations/dev/dss_probing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ v1:
netrid_dss_instances_v22a: { $ref: 'library/environment.yaml#/netrid_dss_instances_v22a' }
netrid_dss_instances_v19: { $ref: 'library/environment.yaml#/netrid_dss_instances_v19' }
che_non_conflicting_flights: {$ref: 'library/resources.yaml#/che_non_conflicting_flights'}

test_exclusions: { $ref: 'library/resources.yaml#/test_exclusions' }
non_baseline_inputs:
- v1.test_run.resources.resource_declarations.utm_auth
- v1.test_run.resources.resource_declarations.second_utm_auth
Expand All @@ -35,6 +37,7 @@ v1:
problematically_big_area: kentland_problematically_big_area
second_utm_auth: second_utm_auth
flight_intents: che_non_conflicting_flights
test_exclusions: test_exclusions
execution:
stop_fast: true
artifacts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ v1:
second_utm_auth: second_utm_auth
planning_area: planning_area
problematically_big_area: problematically_big_area
test_exclusions: test_exclusions

# When a test run is executed, a "baseline signature" is computed uniquely identifying the "baseline" of the test,
# usually excluding exactly what systems are participating in the test (the "environment"). This is a list of
Expand Down Expand Up @@ -145,10 +146,8 @@ v1:
# 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
- participant_id: uss2_dss
base_url: http://dss.uss2.localutm
has_private_address: true

# Mock USS that can be used in tests for flight planning, modifying data sharing behavior and recording interactions
mock_uss:
Expand All @@ -163,6 +162,14 @@ v1:
# ========== Environment ==========
# =================================

# Controls tests behavior
test_exclusions:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
resource_type: resources.dev.TestExclusionsResource
specification:
# Tests should allow private addresses that are not publicly addressable since this configuration runs locally
allow_private_addresses: true

# Means by which uss_qualifier can discover which subscription ('sub' claim of its tokes) it is described by
utm_client_identity:
resource_type: resources.communications.ClientIdentityResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ netrid_dss_instances_v19:
- participant_id: uss1
rid_version: F3411-19
base_url: http://dss.uss1.localutm
has_private_address: true
has_private_address: true # TODO monitoring#739: not used on its own anymore, to be removed alongside local_debug
- participant_id: uss2
rid_version: F3411-19
base_url: http://dss.uss2.localutm
has_private_address: true
has_private_address: true # TODO monitoring#739: not used on its own anymore, to be removed alongside local_debug

netrid_dss_instances_v22a:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
Expand All @@ -124,11 +124,11 @@ netrid_dss_instances_v22a:
- participant_id: uss1
rid_version: F3411-22a
base_url: http://dss.uss1.localutm/rid/v2
has_private_address: true
has_private_address: true # TODO monitoring#739: not used on its own anymore, to be removed alongside local_debug
- participant_id: uss2
rid_version: F3411-22a
base_url: http://dss.uss2.localutm/rid/v2
has_private_address: true
has_private_address: true # TODO monitoring#739: not used on its own anymore, to be removed alongside local_debug

netrid_dss_instance_v19:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
Expand All @@ -139,7 +139,7 @@ netrid_dss_instance_v19:
participant_id: uss1
rid_version: F3411-19
base_url: http://dss.uss1.localutm
has_private_address: true
has_private_address: true # TODO monitoring#739: not used on its own anymore, to be removed alongside local_debug

netrid_dss_instance_v22a:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
Expand All @@ -150,7 +150,7 @@ netrid_dss_instance_v22a:
participant_id: uss1
rid_version: F3411-22a
base_url: http://dss.uss1.localutm/rid/v2
has_private_address: true
has_private_address: true # TODO monitoring#739: not used on its own anymore, to be removed alongside local_debug

# ===== Flight planning =====

Expand Down Expand Up @@ -201,7 +201,6 @@ scd_dss:
specification:
participant_id: uss1
base_url: http://dss.uss1.localutm
has_private_address: true

scd_dss_instances:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
Expand All @@ -214,10 +213,8 @@ scd_dss_instances:
user_participant_ids:
- mock_uss
base_url: http://dss.uss1.localutm
has_private_address: true
- participant_id: uss2
base_url: http://dss.uss2.localutm
has_private_address: true

# ===== DSS CockroachDB nodes =====

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ netrid_dss_instances_v19:
- participant_id: uss1
rid_version: F3411-19
base_url: http://localhost:8082
has_private_address: true
has_private_address: true # TODO monitoring#739: not used on its own anymore, to be removed alongside local_debug
- participant_id: uss2
rid_version: F3411-19
base_url: http://localhost:8082
has_private_address: true
has_private_address: true # TODO monitoring#739: not used on its own anymore, to be removed alongside local_debug

netrid_dss_instances_v22a:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
Expand All @@ -123,11 +123,11 @@ netrid_dss_instances_v22a:
- participant_id: uss1
rid_version: F3411-22a
base_url: http://localhost:8082/rid/v2
has_private_address: true
has_private_address: true # TODO monitoring#739: not used on its own anymore, to be removed alongside local_debug
- participant_id: uss2
rid_version: F3411-22a
base_url: http://localhost:8082/rid/v2
has_private_address: true
has_private_address: true # TODO monitoring#739: not used on its own anymore, to be removed alongside local_debug

netrid_dss_instance_v19:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
Expand All @@ -138,7 +138,7 @@ netrid_dss_instance_v19:
participant_id: uss1
rid_version: F3411-19
base_url: http://localhost:8082
has_private_address: true
has_private_address: true # TODO monitoring#739: not used on its own anymore, to be removed alongside local_debug

netrid_dss_instance_v22a:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
Expand All @@ -149,7 +149,7 @@ netrid_dss_instance_v22a:
participant_id: uss1
rid_version: F3411-22a
base_url: http://localhost:8082/rid/v2
has_private_address: true
has_private_address: true # TODO monitoring#739: not used on its own anymore, to be removed alongside local_debug

# ===== Flight planning =====

Expand Down Expand Up @@ -200,7 +200,6 @@ scd_dss:
specification:
participant_id: uss1
base_url: http://localhost:8082
has_private_address: true

scd_dss_instances:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
Expand All @@ -213,10 +212,8 @@ scd_dss_instances:
user_participant_ids:
- mock_uss
base_url: http://localhost:8082
has_private_address: true
- participant_id: uss2
base_url: http://localhost:8082
has_private_address: true

# ===== DSS CockroachDB nodes =====

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,3 +386,11 @@ locality_che:
resource_type: resources.interuss.mock_uss.locality.LocalityResource
specification:
locality_code: CHE

# ===== Test Exclusions =====

test_exclusions:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
resource_type: resources.dev.TestExclusionsResource
specification:
allow_private_addresses: true
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ v1:
specification:
participant_id: mock_uss
mock_uss_base_url: http://host.docker.internal:8074
test_exclusions: { $ref: 'library/resources.yaml#/test_exclusions' }
non_baseline_inputs:
- v1.test_run.resources.resource_declarations.utm_auth
- v1.test_run.resources.resource_declarations.all_flight_planners
Expand All @@ -63,6 +64,7 @@ v1:
second_utm_auth: second_utm_auth
planning_area: che_planning_area
problematically_big_area: che_problematically_big_area
test_exclusions: test_exclusions
execution:
stop_fast: true

Expand Down
3 changes: 3 additions & 0 deletions monitoring/uss_qualifier/configurations/dev/netrid_v19.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ v1:
netrid_service_providers_v19: {$ref: 'library/environment.yaml#/netrid_service_providers_v19'}
netrid_observers_v19: {$ref: 'library/environment.yaml#/netrid_observers_v19'}
netrid_dss_instances_v19: {$ref: 'library/environment.yaml#/netrid_dss_instances_v19'}

test_exclusions: { $ref: 'library/resources.yaml#/test_exclusions' }
non_baseline_inputs:
- v1.test_run.resources.resource_declarations.utm_auth
- v1.test_run.resources.resource_declarations.netrid_service_providers_v19
Expand All @@ -32,6 +34,7 @@ v1:
id_generator: id_generator
service_area: kentland_service_area
problematically_big_area: au_problematically_big_area
test_exclusions: test_exclusions
execution:
stop_fast: true
artifacts:
Expand Down
3 changes: 3 additions & 0 deletions monitoring/uss_qualifier/configurations/dev/netrid_v22a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ v1:
netrid_service_providers_v22a: {$ref: 'library/environment.yaml#/netrid_service_providers_v22a'}
netrid_observers_v22a: {$ref: 'library/environment.yaml#/netrid_observers_v22a'}
netrid_dss_instances_v22a: {$ref: 'library/environment.yaml#/netrid_dss_instances_v22a'}

test_exclusions: { $ref: 'library/resources.yaml#/test_exclusions' }
non_baseline_inputs:
- v1.test_run.resources.resource_declarations.utm_auth
- v1.test_run.resources.resource_declarations.netrid_service_providers_v22a
Expand All @@ -32,6 +34,7 @@ v1:
id_generator: id_generator
service_area: kentland_service_area
problematically_big_area: au_problematically_big_area
test_exclusions: test_exclusions
execution:
stop_fast: true
artifacts:
Expand Down
6 changes: 6 additions & 0 deletions monitoring/uss_qualifier/configurations/dev/uspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ v1:
netrid_service_providers_v22a: {$ref: 'library/environment.yaml#/netrid_service_providers_v22a'}
netrid_observers_v22a: {$ref: 'library/environment.yaml#/netrid_observers_v22a'}
netrid_dss_instances_v22a: {$ref: 'library/environment.yaml#/netrid_dss_instances_v22a'}

test_exclusions: { $ref: 'library/resources.yaml#/test_exclusions' }
non_baseline_inputs:
- v1.test_run.resources.resource_declarations.utm_auth
- v1.test_run.resources.resource_declarations.mock_uss_instances_scdsc
Expand Down Expand Up @@ -71,6 +73,8 @@ v1:
service_area: kentland_service_area
planning_area: che_planning_area
problematically_big_area: au_problematically_big_area

test_exclusions: test_exclusions
specification:
mock_uss_instances_source: mock_uss_instances
locality_source: locality
Expand Down Expand Up @@ -102,6 +106,8 @@ v1:
service_area: service_area
planning_area: planning_area
problematically_big_area: problematically_big_area

test_exclusions: test_exclusions
execution:
stop_fast: true
artifacts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function(env) {
problematically_big_area: 'problematically_big_area',
system_identity: 'system_identity',
// dss_crdb_cluster: dss_crdb_cluster # TODO: Provide once local DSS uses a multi-node cluster
test_exclusions: 'test_exclusions',
},
},
},
Expand Down Expand Up @@ -59,6 +60,15 @@ function(env) {
resources: {
resource_declarations: env.resource_declarations + {

// Controls tests behavior
test_exclusions: {
resource_type: 'resources.dev.TestExclusionsResource',
specification: {
// Tests should allow private addresses that are not publicly addressable since this configuration runs locally
allow_private_addresses: true,
},
},

// Means by which uss_qualifier can discover which subscription ('sub' claim of its tokes) it is described by
utm_client_identity: {
resource_type: 'resources.communications.ClientIdentityResource',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
'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
},
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
{
participant_id: 'uss2_dss',
base_url: 'http://dss.uss2.localutm',
has_private_address: true, // This should be removed for production systems
},
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ netrid_dss_instances_v19:
- participant_id: uss1
rid_version: F3411-19
base_url: https://dss.ci.google-interuss.uspace.dev
has_private_address: false
- participant_id: uss2
rid_version: F3411-19
base_url: https://dss.ci.aws-interuss.uspace.dev
has_private_address: false

netrid_dss_instances_v22a:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
Expand All @@ -75,11 +73,9 @@ netrid_dss_instances_v22a:
- participant_id: uss1
rid_version: F3411-22a
base_url: https://dss.ci.google-interuss.uspace.dev/rid/v2
has_private_address: false
- participant_id: uss2
rid_version: F3411-22a
base_url: https://dss.ci.aws-interuss.uspace.dev/rid/v2
has_private_address: false

# ===== F3548 =====

Expand All @@ -91,7 +87,6 @@ scd_dss:
specification:
participant_id: uss1
base_url: https://dss.ci.google-interuss.uspace.dev
has_private_address: false

scd_dss_instances:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
Expand All @@ -102,10 +97,8 @@ scd_dss_instances:
dss_instances:
- participant_id: uss1
base_url: https://dss.ci.google-interuss.uspace.dev
has_private_address: false
- participant_id: uss2
base_url: https://dss.ci.aws-interuss.uspace.dev
has_private_address: false

dss_crdb_cluster:
$content_schema: monitoring/uss_qualifier/resources/interuss/crdb/crdb/CockroachDBClusterResource.json
Expand Down
11 changes: 6 additions & 5 deletions monitoring/uss_qualifier/resources/astm/f3411/dss.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ class DSSInstanceSpecification(ImplicitDict):
base_url: str
"""Base URL for the DSS instance according to the ASTM F3411 API appropriate to the specified rid_version"""

has_private_address: Optional[bool]
has_private_address: Optional[
bool
] # TODO monitoring#739: not used on its own anymore, to be removed alongside local_debug
"""Whether this DSS instance is expected to have a private address that is not publicly addressable."""

local_debug: Optional[bool]
Expand Down Expand Up @@ -50,15 +52,16 @@ class DSSInstance(object):
participant_id: ParticipantID
rid_version: RIDVersion
base_url: str
has_private_address: bool = False
local_debug: bool = False
client: infrastructure.UTMClientSession

def __init__(
self,
participant_id: ParticipantID,
base_url: str,
has_private_address: Optional[bool],
has_private_address: Optional[
bool
], # TODO monitoring#739: not used on its own anymore, to be removed alongside local_debug
local_debug: Optional[bool],
rid_version: RIDVersion,
auth_adapter: infrastructure.AuthAdapter,
Expand All @@ -69,7 +72,6 @@ def __init__(
self.client = infrastructure.UTMClientSession(base_url, auth_adapter)

if has_private_address is not None:
self.has_private_address = has_private_address
self.local_debug = True
if local_debug is not None:
self.local_debug = local_debug
Expand All @@ -79,7 +81,6 @@ def is_same_as(self, other: DSSInstance) -> bool:
self.participant_id == other.participant_id
and self.rid_version == other.rid_version
and self.base_url == other.base_url
and self.has_private_address == other.has_private_address
and self.local_debug == other.local_debug
)

Expand Down
Loading

0 comments on commit 8d9526c

Please sign in to comment.