Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add use of monitoring/uss_qualifier for DSS probing #960

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ coverage.xml
.pytest_cache/
e2e_test_result
test_result
build/dev/probe_locally_output

# Translations
*.mo
Expand Down Expand Up @@ -128,4 +129,4 @@ test/e2e_test_result
go

# vscode files
.vscode
.vscode
45 changes: 44 additions & 1 deletion build/dev/probe_locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ RESULTFILE="$(pwd)/e2e_test_result"
touch "${RESULTFILE}"
cat /dev/null > "${RESULTFILE}"

echo "========== Running legacy DSS prober =========="
if ! docker run --link "$OAUTH_CONTAINER":oauth \
--link "$CORE_SERVICE_CONTAINER":core-service \
--network dss_sandbox-default \
Expand All @@ -53,7 +54,7 @@ if ! docker run --link "$OAUTH_CONTAINER":oauth \
--scd-api-version 1.0.0; then

if [ "$CI" == "true" ]; then
echo "=== END OF TEST RESULTS ==="
echo "=== END OF LEGACY PROBER TEST RESULTS ==="
echo "Dumping core-service logs"
docker logs "$CORE_SERVICE_CONTAINER"
fi
Expand All @@ -62,3 +63,45 @@ if ! docker run --link "$OAUTH_CONTAINER":oauth \
else
echo "Prober succeeded."
fi

# TODO: ugly non-optimized way of getting the code we need
git clone --recurse-submodules --branch uq_dss_probing [email protected]:Orbitalize/monitoring.git monitoring-repo-tmp
pushd monitoring-repo-tmp
make build-monitoring
popd
rm -rf monitoring-repo-tmp

USS_QUALIFIER_CONF="$(pwd)/build/dev/probe_locally_configuration.yaml"
OUTPUT_DIR="$(pwd)/build/dev/probe_locally_output"
mkdir -p "$OUTPUT_DIR"

echo "========== Running uss_qualifier for DSS probing =========="
# shellcheck disable=SC2086
docker run --name dss_probing \
--rm \
--link "$OAUTH_CONTAINER":oauth \
--link "$CORE_SERVICE_CONTAINER":core-service \
--network dss_sandbox-default \
-u "$(id -u):$(id -g)" \
-e PYTHONBUFFERED=1 \
-e AUTH_SPEC='DummyOAuth(http://oauth:8085/token,sub=fake_uss)' \
-e USS_QUALIFIER_STOP_FAST=true \
-v "${OUTPUT_DIR}:/app/monitoring/uss_qualifier/output" \
-v "${USS_QUALIFIER_CONF}:/app/monitoring/uss_qualifier/configurations/dev/dss_probing.yaml" \
-w /app/monitoring/uss_qualifier \
interuss/monitoring \
python main.py --config configurations.dev.dss_probing

# Set return code according to whether the test run was fully successful
successful=$(jq '.report | .[] | .successful' "${OUTPUT_DIR}/report_dss_probing.json")
if echo "${successful}" | grep -iqF true; then
echo "Full success indicated by DSS probing"
else
echo "Could not establish that the DSS probing passed"
if [ "$CI" == "true" ]; then
echo "=== END OF USS QUALIFIER TEST RESULTS ==="
echo "Dumping core-service logs"
docker logs "$CORE_SERVICE_CONTAINER"
fi
exit 1
fi
67 changes: 67 additions & 0 deletions build/dev/probe_locally_configuration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This is the configuration for the USS qualifier tool that probes the DSS, replacing the legacy prober tool.
v1:
test_run:
non_baseline_inputs:
- v1.test_run.resources.resource_declarations.utm_auth
- v1.test_run.resources.resource_declarations.netrid_dss_instance_v19
- v1.test_run.resources.resource_declarations.netrid_dss_instance_v22a
resources:
resource_declarations:
utm_auth:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
resource_type: resources.communications.AuthAdapterResource
specification:
environment_variable_containing_auth_spec: AUTH_SPEC
id_generator:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
resource_type: resources.interuss.IDGeneratorResource
dependencies:
auth_adapter: utm_auth
specification:
whoami_audience: localhost
whoami_scope: rid.display_provider
isa:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
resource_type: resources.netrid.ServiceAreaResource
specification:
base_url: https://uss_qualifier.test.utm/dummy_base_url
footprint:
lat_min: 37.1853
lng_min: -80.6140
lat_max: 37.2148
lng_max: -80.5440
altitude_min: 0
altitude_max: 3048
netrid_dss_instance_v19:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
resource_type: resources.astm.f3411.DSSInstanceResource
dependencies:
auth_adapter: utm_auth
specification:
participant_id: uss1
rid_version: F3411-19
base_url: http://core-service:8082
has_private_address: true
netrid_dss_instance_v22a:
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
resource_type: resources.astm.f3411.DSSInstanceResource
dependencies:
auth_adapter: utm_auth
specification:
participant_id: uss1
rid_version: F3411-22a
base_url: http://core-service:8082/rid/v2
has_private_address: true
action:
test_suite:
suite_type: suites.interuss.dss_probing
resources:
netrid_dss_instance_v19: netrid_dss_instance_v19
netrid_dss_instance_v22a: netrid_dss_instance_v22a
id_generator: id_generator
isa: isa
artifacts:
tested_roles:
report_path: output/tested_roles_dss_probing
report:
report_path: output/report_dss_probing.json
Loading