Skip to content

Commit

Permalink
Merge branch 'interuss:main' into cmsa_test
Browse files Browse the repository at this point in the history
  • Loading branch information
punamverma authored Dec 19, 2024
2 parents 86a8cfc + 3f6b88a commit 7b9820b
Show file tree
Hide file tree
Showing 223 changed files with 6,286 additions and 1,562 deletions.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/release_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Release request
about: I would like InterUSS to make a new `monitoring` release
labels: release-request
---

*Note: This template requests InterUSS to create a new release of the `monitoring` repository. Delete this note and replace each of the instructions below with the appropriate information before submitting.*

**What commit is it important for this release to contain?**

Find the commit of the most recent change important for you to use in a release and copy its commit hash here. [Commits to the main branch](https://github.com/interuss/monitoring/commits/main/) can be found by going to the repository root in a browser then clicking on the number of commits indicated just below the green Code button (near upper right of primary content). Commits resolving an issue should often be linked to a merged pull request associated with the issue.

**Requested timing**

Indicate when you ideally need this release by. If the request can wait 1-2 weeks, simply delete this section. If needed sooner/more quickly, include a note about the driver behind the increased urgency.

**Additional context**

Add any other useful context here, or remove this section.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ If the test scenario is long, note that the documentation does not need to be cr
### Scenario implementation

Once all necessary prerequisites (e.g., resources) are available and the test scenario documentation is complete, actually writing the code of the test scenario should be fairly straightforward. Before creating a PR, the test scenario code must at least have been successfully tested by the developer. Ideally, a test configuration included in the CI (see list of configurations tested in [uss_qualifier's run_locally.sh](monitoring/uss_qualifier/run_locally.sh)) should run the test scenario. If the test scenario is not run as part of the CI, the PR author must clearly indicate why they are sure the test scenario has been implemented correctly.

#### Fake URLs

In some tests, fake URLs must be provided (for instance, the base URL when creating an operational intent reference in a DSS instance when the details for that operational intent reference will not actually be served by any USS). In all cases when such fake URLs are provided, they should use the value obtained (or would be obtained) from `make_fake_url` in [monitorlib/testing.py](./monitoring/monitorlib/testing.py). If the fake URL is specified in a data file rather than a Python file, it should follow the format of `https://testdummy.interuss.org/interuss` followed by the path of the file (minus extension) relative to the repository root; e.g., `https://testdummy.interuss.org/interuss/monitoring/uss_qualifier/configurations/dev/f3548_self_contained` if the URL was defined in [uss_qualifier/configurations/dev/f3548_self_contained.yaml](./monitoring/uss_qualifier/configurations/dev/f3548_self_contained.yaml). One or more suffix paths can be appended if multiple different fake URLs are needed in the same originating file; e.g., `https://testdummy.interuss.org/interuss/monitoring/uss_qualifier/configurations/dev/f3548_self_contained/planning_area/original`

This convention allows a user to more easily determine where a stray resource/link (e.g., operational intent reference) originated if/when it is encountered outside its intended test.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ tag:
.PHONY: start-locally
start-locally:
build/dev/run_locally.sh up -d
build/dev/wait_for_local_infra.sh

.PHONY: probe-locally
probe-locally:
Expand Down
49 changes: 30 additions & 19 deletions build/dev/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Brings up a local interoperability ecosystem consisting of a DSS instance and dummy OAuth server.

# To bring up this system, run ./run_locally.sh then optionally ./wait_for_local_infra.sh to wait for the servers to start.
# To bring up this system, run ./run_locally.sh up -d and wait for all containers to succeed or become healthy.

version: '3.8'

Expand All @@ -18,50 +18,57 @@ services:
restart: always
networks:
- dss_internal_network
healthcheck:
test: curl -f 'http://localhost:8080/health?ready=1' || exit 1
interval: 3m
start_period: 30s
start_interval: 5s

rid_bootstrapper:
image: interuss/dss:v0.17.0
volumes:
- dss_component_coordination:/var/dss_component_coordination
- $PWD/startup:/startup:ro
entrypoint: /startup/rid_bootstrapper.sh
image: interuss/dss:v0.19.0-rc2
command: /usr/bin/db-manager migrate --schemas_dir=/db-schemas/rid --db_version "latest" --cockroach_host crdb
depends_on:
- crdb
crdb:
condition: service_healthy
networks:
- dss_internal_network

scd_bootstrapper:
image: interuss/dss:v0.17.0
volumes:
- dss_component_coordination:/var/dss_component_coordination
- $PWD/startup:/startup:ro
entrypoint: /startup/scd_bootstrapper.sh
image: interuss/dss:v0.19.0-rc2
command: /usr/bin/db-manager migrate --schemas_dir=/db-schemas/scd --db_version "latest" --cockroach_host crdb
depends_on:
- crdb
crdb:
condition: service_healthy
networks:
- dss_internal_network

dss:
hostname: dss.uss1.localutm
image: interuss/dss:v0.17.0
image: interuss/dss:v0.19.0-rc2
volumes:
- $PWD/../test-certs:/var/test-certs:ro
- dss_component_coordination:/var/dss_component_coordination
- $PWD/startup:/startup:ro
- $PWD/startup/core_service.sh:/startup/core_service.sh:ro
command: /startup/core_service.sh ${DEBUG_ON:-0}
expose:
- 8082
ports:
- "4000:4000"
- "8082:80"
depends_on:
- rid_bootstrapper
- scd_bootstrapper
rid_bootstrapper:
condition: service_completed_successfully
scd_bootstrapper:
condition: service_completed_successfully
networks:
dss_internal_network:
interop_ecosystem_network:
aliases:
- dss.uss2.localutm
healthcheck:
test: wget -O - 'http://localhost/healthy' || exit 1
interval: 3m
start_period: 30s
start_interval: 5s

oauth:
hostname: oauth.authority.localutm
Expand All @@ -73,7 +80,11 @@ services:
- "8085:8085"
networks:
- interop_ecosystem_network

healthcheck:
test: wget -O - 'http://localhost:8085/token?intended_audience=-&scope=-' || exit 1
interval: 3m
start_period: 30s
start_interval: 5s

networks:
dss_internal_network:
Expand Down
2 changes: 0 additions & 2 deletions build/dev/startup/core_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# This startup script is meant to be invoked from within a Docker container
# started by docker-compose.yaml, not on a local system.

/startup/wait_for_bootstrapping.sh

DEBUG_ON=${1:-0}

if [ "$DEBUG_ON" = "1" ]; then
Expand Down
21 changes: 0 additions & 21 deletions build/dev/startup/rid_bootstrapper.sh

This file was deleted.

21 changes: 0 additions & 21 deletions build/dev/startup/scd_bootstrapper.sh

This file was deleted.

16 changes: 0 additions & 16 deletions build/dev/startup/wait_for_bootstrapping.sh

This file was deleted.

72 changes: 0 additions & 72 deletions build/dev/wait_for_local_infra.sh

This file was deleted.

1 change: 1 addition & 0 deletions github_pages/static/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ These reports were generated during continuous integration for the most recent P

* [Sequence view](./artifacts/uss_qualifier/reports/f3548_self_contained/sequence)
* [Tested requirements](./artifacts/uss_qualifier/reports/f3548_self_contained/gate3)
* [Globally-expanded report](./artifacts/uss_qualifier/reports/f3548_self_contained/globally_expanded/report.html)

### [US UTM Implementation test configuration](https://github.com/interuss/monitoring/blob/main/monitoring/uss_qualifier/configurations/dev/utm_implementation_us.yaml)

Expand Down
11 changes: 8 additions & 3 deletions monitoring/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,26 @@
#
# This image is intended to be built from the repository root context/folder.

FROM python:3.12.4-slim
FROM python:3.12.6-slim
# Not -alpine because: https://stackoverflow.com/a/58028091/651139

# Install system tools
# openssl: Provides TLS tools
# curl: Useful debugging utility
# gcc: Required to build various packages
# ca-certificates: Needed to accurately validate TLS connections
RUN apt-get update --fix-missing && apt-get install -y openssl curl libgeos-dev gcc && apt-get install ca-certificates
RUN apt-get update --fix-missing && apt-get install -y make openssl curl libgeos-dev gcc g++ && apt-get install ca-certificates

# Deal with https://github.com/docker-library/python/pull/954
RUN pip install --no-cache-dir setuptools==74.1.2

# Required to build in an ARM environment
# gevent: libffi-dev libssl-dev python3-dev build-essential
# lxml: libxml2-dev libxslt-dev
# h5py: pkg-config libhdf5-dev
RUN apt-get install -y libffi-dev libssl-dev python3-dev build-essential libxml2-dev libxslt-dev pkg-config libhdf5-dev
RUN if [ "$(uname -m)" = "aarch64" ]; then \
apt-get install -y libffi-dev libssl-dev python3-dev build-essential libxml2-dev libxslt-dev pkg-config libhdf5-dev \
; fi

# Install the necessary Python packages from requirements.txt
RUN mkdir -p /app/monitoring
Expand Down
6 changes: 4 additions & 2 deletions monitoring/loadtest/locust_files/ISA.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from monitoring.prober.rid.v1 import common
from locust import task, between

from monitoring.monitorlib.testing import make_fake_url


class ISA(client.USS):
wait_time = between(0.01, 1)
Expand All @@ -34,7 +36,7 @@ def create_isa(self):
"time_start": time_start.strftime(rid_v1.DATE_FORMAT),
"time_end": time_end.strftime(rid_v1.DATE_FORMAT),
},
"flights_url": "https://example.interuss.org/dss",
"flights_url": make_fake_url(),
},
)
if resp.status_code == 200:
Expand Down Expand Up @@ -63,7 +65,7 @@ def update_isa(self):
"time_start": time_start.strftime(rid_v1.DATE_FORMAT),
"time_end": time_end.strftime(rid_v1.DATE_FORMAT),
},
"flights_url": "https://example.interuss.org/dss",
"flights_url": make_fake_url(),
},
)
if resp.status_code == 200:
Expand Down
10 changes: 4 additions & 6 deletions monitoring/loadtest/locust_files/Sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from monitoring.monitorlib import rid_v1
from locust import task, between

from monitoring.monitorlib.testing import make_fake_url


class Sub(client.USS):
wait_time = between(0.01, 1)
Expand Down Expand Up @@ -42,9 +44,7 @@ def create_sub(self):
"time_start": time_start.strftime(rid_v1.DATE_FORMAT),
"time_end": time_end.strftime(rid_v1.DATE_FORMAT),
},
"callbacks": {
"identification_service_area_url": "https://example.interuss.org/foo"
},
"callbacks": {"identification_service_area_url": make_fake_url()},
},
)
if resp.status_code == 200:
Expand Down Expand Up @@ -83,9 +83,7 @@ def update_sub(self):
"time_start": time_start.strftime(rid_v1.DATE_FORMAT),
"time_end": time_end.strftime(rid_v1.DATE_FORMAT),
},
"callbacks": {
"identification_service_area_url": "https://example.interuss.org/foo"
},
"callbacks": {"identification_service_area_url": make_fake_url()},
},
)
if resp.status_code == 200:
Expand Down
1 change: 1 addition & 0 deletions monitoring/mock_uss/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def require_config_value(config_key: str) -> None:

from monitoring.mock_uss import config
from monitoring.mock_uss import routes as basic_routes
from monitoring.mock_uss import logging

if SERVICE_GEOAWARENESS in webapp.config[config.KEY_SERVICES]:
enabled_services.add(SERVICE_GEOAWARENESS)
Expand Down
Loading

0 comments on commit 7b9820b

Please sign in to comment.