Skip to content
Open
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
2 changes: 2 additions & 0 deletions .github/actions/load-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ runs:
set -euo pipefail
docker load --input monitoring-image/monitoring-image.tar
cp monitoring-image/monitoring/image monitoring/image
cp monitoring-image/monitoring/image-dev monitoring/image-dev
touch monitoring/image monitoring/image-dev
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would be good to echo the creation reason in the file similar to the build scripts

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The files should contain the reasoning -- they actually exist already from the archive and are copied with their content into the local container. The touch is an extra precaution against accidentally rebuilding, but probably isn't needed and could potentially be removed.

rm -rf monitoring-image
47 changes: 25 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
branches:
- main
jobs:
build-monitoring-image:
name: Build monitoring image
build-monitoring-images:
name: Build monitoring images
permissions:
contents: read
runs-on: ubuntu-latest
Expand All @@ -28,14 +28,17 @@ jobs:
fetch-tags: true
fetch-depth: 0
filter: tree:0
- name: Build monitoring image
run: make image
- name: Build monitoring images
run: |
make image
make image-dev
- name: Save monitoring image artifact
run: |
docker save interuss/monitoring interuss/monitoring-dev -o monitoring-image.tar
mkdir -p image-artifact/monitoring
mv monitoring-image.tar image-artifact/
cp monitoring/image image-artifact/monitoring/
cp monitoring/image-dev image-artifact/monitoring/
- name: Upload monitoring image artifact
uses: actions/upload-artifact@v7
with:
Expand All @@ -45,7 +48,7 @@ jobs:
hygiene-tests:
name: Repository hygiene
needs:
- build-monitoring-image
- build-monitoring-images
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read
Expand Down Expand Up @@ -73,7 +76,7 @@ jobs:
unit-tests:
name: Unit tests
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
runs-on: ubuntu-latest
Expand All @@ -100,7 +103,7 @@ jobs:
mock_uss-test:
name: mock_uss tests
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand All @@ -113,7 +116,7 @@ jobs:
uss_qualifier-noop-test:
name: uss_qualifier configurations.dev.noop tests
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand All @@ -128,7 +131,7 @@ jobs:
uss_qualifier-geoawareness_cis-test:
name: uss_qualifier configurations.dev.geoawareness_cis tests
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand All @@ -143,7 +146,7 @@ jobs:
uss_qualifier-generate_rid_test_data-test:
name: uss_qualifier configurations.dev.generate_rid_test_data tests
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand All @@ -158,7 +161,7 @@ jobs:
uss_qualifier-geospatial_comprehension-test:
name: uss_qualifier configurations.dev.geospatial_comprehension tests
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand All @@ -173,7 +176,7 @@ jobs:
uss_qualifier-general_flight_auth-test:
name: uss_qualifier configurations.dev.general_flight_auth tests
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand All @@ -188,7 +191,7 @@ jobs:
uss_qualifier-message_signing-test:
name: uss_qualifier configurations.dev.message_signing tests
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand All @@ -203,7 +206,7 @@ jobs:
uss_qualifier-dss_probing-test:
name: uss_qualifier configurations.dev.dss_probing tests
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand All @@ -218,7 +221,7 @@ jobs:
uss_qualifier-f3548_self_contained-test:
name: uss_qualifier configurations.dev.f3548_self_contained tests
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand All @@ -233,7 +236,7 @@ jobs:
uss_qualifier-utm_implementation_us-test:
name: uss_qualifier configurations.dev.utm_implementation_us tests
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand All @@ -248,7 +251,7 @@ jobs:
uss_qualifier-netrid_v22a-test:
name: uss_qualifier configurations.dev.netrid_v22a tests
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand All @@ -263,7 +266,7 @@ jobs:
uss_qualifier-netrid_v19-test:
name: uss_qualifier configurations.dev.netrid_v19 tests
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand All @@ -278,7 +281,7 @@ jobs:
uss_qualifier-uspace-test:
name: uss_qualifier configurations.dev.uspace tests
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand All @@ -293,7 +296,7 @@ jobs:
uss_qualifier-minimal_probing_simulations-crdb-test:
name: uss_qualifier configurations.dev.minimal_probing_simulations tests with crdb
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand All @@ -313,7 +316,7 @@ jobs:
uss_qualifier-minimal_probing_simulations-ybdb-test:
name: uss_qualifier configurations.dev.minimal_probing_simulations tests with ybdb
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand All @@ -333,7 +336,7 @@ jobs:
prober-test:
name: prober tests
needs:
- build-monitoring-image
- build-monitoring-images
permissions:
contents: read
uses: ./.github/workflows/monitoring-test.yml
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ else
endif

.PHONY: format
format: image
format: image-dev
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring-dev uv run ruff format
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring-dev uv run ruff check --fix
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring-dev uv run basedpyright
Expand All @@ -23,11 +23,11 @@ lint: shell-lint python-lint
cd schemas && make lint

.PHONY: check-hygiene
check-hygiene: image lint validate-uss-qualifier-docs
check-hygiene: image-dev lint validate-uss-qualifier-docs
test/repo_hygiene/repo_hygiene.sh

.PHONY: python-lint
python-lint: image
python-lint: image-dev

docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring-dev uv run ruff format --check || (echo "Linter didn't succeed. You can use the following command to fix python linter issues: make format" && exit 1)
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring-dev uv run ruff check || (echo "Linter didn't succeed. You can use the following command to fix python linter issues: make format" && exit 1)
Expand All @@ -52,6 +52,10 @@ unit-test:
image:
cd monitoring && make image

.PHONY: image-dev
image-dev:
cd monitoring && make image-dev

tag:
scripts/tag.sh $(UPSTREAM_OWNER)/monitoring/v$(VERSION)

Expand Down
1 change: 1 addition & 0 deletions monitoring/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ run_locally_scd_deploy_others.sh

# Make target placeholders
image
image-dev
5 changes: 4 additions & 1 deletion monitoring/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ unit-test:
cd uss_qualifier && make unit_test
cd monitorlib && make unit_test

image: ../uv.lock ../pyproject.toml $(shell find . -type f ! -path "*/output/*" ! -name image ! -name *.pyc) $(shell find ../interfaces -type f)
image: ../uv.lock ../pyproject.toml $(shell find . -type f ! -path "*/output/*" ! -path "*/.*" ! -path "*/__pycache__/*" ! -name image ! -name image-dev ! -name "*.pyc") $(shell find ../interfaces -type f)
./build.sh

image-dev: ../uv.lock ../pyproject.toml $(shell find . -type f ! -path "*/output/*" ! -path "*/.*" ! -path "*/__pycache__/*" ! -name image ! -name image-dev ! -name "*.pyc") $(shell find ../interfaces -type f)
./build_dev.sh

.PHONY: test
test:
cd mock_uss && make test
Expand Down
10 changes: 1 addition & 9 deletions monitoring/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,4 @@ docker image build \
. \
|| exit 1

docker image build \
-f monitoring/Dockerfile \
-t "${TAG}-dev" \
--build-arg version="$(scripts/git/version.sh monitoring --long)" \
--build-arg commit_hash="$(git rev-parse HEAD)" \
--target with-dev-dependencies \
. \
|| exit 1
echo "File created by monitoring/build.sh to keep track of the latest build run date time." > monitoring/image
echo "File created by monitoring/build.sh to keep track of the latest normal image build run date time." > monitoring/image
26 changes: 26 additions & 0 deletions monitoring/build_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

set -eo pipefail

# Find and change to repo root directory
OS=$(uname)
if [[ "$OS" == "Darwin" ]]; then
# OSX uses BSD readlink
BASEDIR="$(dirname "$0")"
else
BASEDIR=$(readlink -e "$(dirname "$0")")
fi
cd "${BASEDIR}/.." || exit 1

TAG="${1:-interuss/monitoring}"

docker image build \
-f monitoring/Dockerfile \
-t "${TAG}-dev" \
--build-arg version="$(scripts/git/version.sh monitoring --long)" \
--build-arg commit_hash="$(git rev-parse HEAD)" \
--target with-dev-dependencies \
. \
|| exit 1

echo "File created by monitoring/build_dev.sh to keep track of the latest dev image build run date time." > monitoring/image-dev
3 changes: 1 addition & 2 deletions monitoring/monitorlib/scripts/run_unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cd "${BASEDIR}/../../.." || exit 1

(
cd monitoring || exit 1
make image
make image-dev
)

# shellcheck disable=SC2086
Expand All @@ -26,4 +26,3 @@ docker run --name monitorlib_unit_test \
-v /var/run/docker.sock:/var/run/docker.sock \
interuss/monitoring-dev \
monitorlib/scripts/in_container/run_unit_tests.sh

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cd "${BASEDIR}/../../.." || exit 1

(
cd monitoring || exit 1
make image
make image-dev
)

# shellcheck disable=SC2086
Expand Down
2 changes: 1 addition & 1 deletion monitoring/uss_qualifier/scripts/format_test_suite_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cd "${BASEDIR}/../../.." || exit 1

(
cd monitoring || exit 1
make image
make image-dev
)

# shellcheck disable=SC2086
Expand Down
2 changes: 1 addition & 1 deletion monitoring/uss_qualifier/scripts/run_unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cd "${BASEDIR}/../../.." || exit 1

(
cd monitoring || exit 1
make image
make image-dev
)

# shellcheck disable=SC2086
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cd "${BASEDIR}/../../.." || exit 1

(
cd monitoring || exit 1
make image
make image-dev
)

# shellcheck disable=SC2086
Expand Down
4 changes: 2 additions & 2 deletions schemas/manage_type_schemas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fi
cd "${BASEDIR}/.." || exit 1

cd monitoring
make image
make image-dev
cd ..

action=${1:?The action must be specified as --check or --generate}
Expand All @@ -24,5 +24,5 @@ docker run --name type_schema_manager \
--rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/app" \
interuss/monitoring \
interuss/monitoring-dev \
uv run /app/schemas/manage_type_schemas.py "${action}"
Loading