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

[uss_qualifier] Run multiple uss_qualifier configurations #151

Conversation

BenjaminPelletier
Copy link
Member

Currently, our CI relies primarily on running one giant "local_test" uss_qualifier configuration which uses many disparate parts of the uss_qualifier codebase. It is unnecessarily difficult to pipe all the resources to the right places, and is hard to isolate just the problem problem area when issues arise. This PR addresses this problem by changing uss_qualifier's run_locally.sh to run many configurations when the specific configuration desired is not specified. local_test is deleted entirely, replaced by the sum of smaller configuration files within configurations.dev. The intent is that we should be able to add small/targeted configuration files to test isolated parts of the uss_qualifier system which will allow us to iterate faster while still maintaining the same CI coverage we have today.

Since multiple configurations are being run, a separate report name is used for each one. This will incidentally allow easier identification of problems as the volume of content to search will be smaller (as long as it is clear in which test run the problem occurred).

Also, in this effort to make the configurations in configurations.dev more accessible, this PR adds a $content_schema key to indicate what schemas objects are intending to follow. This is not used anywhere programmatic and is intended to be a fancy comment to human readers.

A few random bugs occurring in off-nominal cases are fixed in common_dictionary_evaluator.py.

@BenjaminPelletier BenjaminPelletier force-pushed the feature/multiple-configurations branch from 9bb6108 to 9433472 Compare August 4, 2023 21:37
@BenjaminPelletier BenjaminPelletier marked this pull request as ready for review August 4, 2023 22:06
Copy link
Contributor

@barroco barroco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this, it is a great improvement.

@@ -10,7 +10,7 @@ The `uss_qualifier` tool is a synchronous executable built into the `interuss/mo

The primary input accepted by uss_qualifier is the "configuration" specified with the `--config` option. This option should be a [reference to a configuration file](configurations/README.md) that the user has constructed or been provided to test the desired system for the desired characteristics. If testing a standard local system (DSS + dummy auth + mock USSs), the user can specify an alternate configuration reference as a single argument to `run_locally.sh` (the default configuration is `configurations.dev.local_test`).

When building a custom configuration file, consider starting from [`configurations.dev.self_contained_f3548`](configurations/dev/self_contained_f3548.yaml), as it contains all information necessary to run the test without the usage of sometimes-configuring `$ref`s and `allOf`s. See [configurations documentation](configurations/README.md) for more information.
When building a custom configuration file, consider starting from [`configurations.dev.self_contained_f3548`](configurations/dev/f3548_self_contained.yaml), as it contains all information necessary to run the test without the usage of sometimes-configuring `$ref`s and `allOf`s. See [configurations documentation](configurations/README.md) for more information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When building a custom configuration file, consider starting from [`configurations.dev.self_contained_f3548`](configurations/dev/f3548_self_contained.yaml), as it contains all information necessary to run the test without the usage of sometimes-configuring `$ref`s and `allOf`s. See [configurations documentation](configurations/README.md) for more information.
When building a custom configuration file, consider starting from [`configurations.dev.f3548_self_contained`](configurations/dev/f3548_self_contained.yaml), as it contains all information necessary to run the test without the usage of sometimes-configuring `$ref`s and `allOf`s. See [configurations documentation](configurations/README.md) for more information.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed

@@ -200,5 +204,6 @@ def evaluate_operational_status(
)
else:
self._test_scenario.record_note(
f"Unsupported version {self._rid_version}: skipping Operational Status evaluation"
key="skip_reason",
message=f"Unsupported version {self._rid_version}: skipping Operational Status evaluation",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning it up. It was actually going to be fixed by #150.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll be a race to see where it goes in first :)

"configurations.dev.uspace" \
)
# TODO: Add configurations.dev.netrid_v19
# TODO: Add configurations.dev.netrid_v22a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to capture the intention, may I kindly ask you to describe what are the reasons preventing to add those configurations ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TL;DR: Tracer.

Tracer must (currently) be run in F3411-19 mode OR F3411-22a mode, and the observation area is statically defined on startup. I'm actually working on a PR right now that will make tracer observation areas dynamic so that we won't have this issue.

Copy link
Contributor

@barroco barroco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a quick test, it is actually breaking on my machine. Investigating the issues.

monitoring/uss_qualifier/run_locally.sh Show resolved Hide resolved
@barroco
Copy link
Contributor

barroco commented Aug 7, 2023

After a quick test, it is actually breaking on my machine. Investigating the issues.

For reference:

uss_qualifier % ./run_locally.sh
[+] Building 0.8s (17/17) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                           0.0s
 => => transferring dockerfile: 37B                                                                                                                                                                                                                                                            0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                              0.0s
 => => transferring context: 34B                                                                                                                                                                                                                                                               0.0s
 => [internal] load metadata for docker.io/library/python:3.8-slim                                                                                                                                                                                                                             0.6s
 => [ 1/12] FROM docker.io/library/python:3.8-slim@sha256:36ebeb57d8f126c0dfd412b09bbccfb256b32faa34255be0c45da763a5ba61f0                                                                                                                                                                     0.0s
 => => resolve docker.io/library/python:3.8-slim@sha256:36ebeb57d8f126c0dfd412b09bbccfb256b32faa34255be0c45da763a5ba61f0                                                                                                                                                                       0.0s
 => [internal] load build context                                                                                                                                                                                                                                                              0.1s
 => => transferring context: 136.83kB                                                                                                                                                                                                                                                          0.1s
 => CACHED [ 2/12] RUN apt-get update && apt-get install -y openssl curl libgeos-dev gcc && apt-get install ca-certificates                                                                                                                                                                    0.0s
 => CACHED [ 3/12] RUN mkdir -p /app/monitoring                                                                                                                                                                                                                                                0.0s
 => CACHED [ 4/12] COPY ./requirements.txt /app/monitoring/requirements.txt                                                                                                                                                                                                                    0.0s
 => CACHED [ 5/12] RUN pip install -r /app/monitoring/requirements.txt                                                                                                                                                                                                                         0.0s
 => CACHED [ 6/12] RUN rm -rf __pycache__                                                                                                                                                                                                                                                      0.0s
 => CACHED [ 7/12] ADD ./interfaces /app/interfaces                                                                                                                                                                                                                                            0.0s
 => CACHED [ 8/12] ADD ./monitoring /app/monitoring                                                                                                                                                                                                                                            0.0s
 => CACHED [ 9/12] COPY ./monitoring/health_check.sh /app/health_check.sh                                                                                                                                                                                                                      0.0s
 => CACHED [10/12] RUN chmod 766 /app/health_check.sh                                                                                                                                                                                                                                          0.0s
 => CACHED [11/12] WORKDIR /app/monitoring                                                                                                                                                                                                                                                     0.0s
 => CACHED [12/12] RUN mkdir -p /app/uss-host-files                                                                                                                                                                                                                                            0.0s
 => exporting to image                                                                                                                                                                                                                                                                         0.0s
 => => exporting layers                                                                                                                                                                                                                                                                        0.0s
 => => writing image sha256:96b124a5ff3d31275c0787d641a3bfffa69cbe88bb26e879d1d6da7e083bd757                                                                                                                                                                                                   0.0s
 => => naming to docker.io/interuss/monitoring                                                                                                                                                                                                                                                 0.0s
Running configurations: configurations.dev.noop configurations.dev.geoawareness_cis configurations.dev.generate_rid_test_data configurations.dev.geospatial_comprehension configurations.dev.general_flight_auth configurations.dev.f3548 configurations.dev.f3548_self_contained configurations.dev.uspace
date: illegal time format
usage: date [-jnRu] [-I[date|hours|minutes|seconds]] [-f input_fmt]
            [-r filename|seconds] [-v[+|-]val[y|m|w|d|H|M|S]]
            [[[[mm]dd]HH]MM[[cc]yy][.SS] | new_date] [+output_fmt]

Copy link
Contributor

@barroco barroco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the latest suggestion which should fix the date issue when running locally on macos 13.3.1.

docker_args="-it"
fi

start_time=$(date +%Y-%m-%dT%H:%M:%S -d '1 second ago')
Copy link
Contributor

@barroco barroco Aug 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my mac, it looks like this syntax has been deprecated. The correct one would be:

Suggested change
start_time=$(date +%Y-%m-%dT%H:%M:%S -d '1 second ago')
start_time=$(date -v-1S +%Y-%m-%dT%H:%M:%S)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ug, apparently date is not cross-platform. The old version works in the CI, the new version does not: date: invalid option -- 'v'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon additional research, it looks like date always rounds down so I think I don't need to subtract that second; I've removed the 1-second offset.

@BenjaminPelletier BenjaminPelletier merged commit 77b126a into interuss:main Aug 7, 2023
@BenjaminPelletier BenjaminPelletier deleted the feature/multiple-configurations branch August 7, 2023 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants