Skip to content
Merged
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: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: make image
- name: Save monitoring image artifact
run: |
docker save interuss/monitoring -o monitoring-image.tar
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/
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ endif

.PHONY: format
format: image
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring uv run ruff format
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring uv run ruff check --fix
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring uv run basedpyright
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
cd monitoring && make format
cd schemas && make format

Expand All @@ -29,10 +29,10 @@ check-hygiene: image lint validate-uss-qualifier-docs
.PHONY: python-lint
python-lint: image

docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring 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 uv run ruff 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 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)
shasum -b -a 256 .basedpyright/baseline.json > /tmp/baseline-before.hash
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring uv run basedpyright || (echo "Typing check didn't succeed. Please fix issue and run make format to validate changes." && exit 1)
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring-dev uv run basedpyright || (echo "Typing check didn't succeed. Please fix issue and run make format to validate changes." && exit 1)
shasum -b -a 256 .basedpyright/baseline.json > /tmp/baseline-after.hash
diff /tmp/baseline-before.hash /tmp/baseline-after.hash || (echo "Basedpyright baseline changed, probably dues to issues that have been cleanup. Use the following command to update baseline: make format" && exit 1)

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

FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS base
# 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 make openssl curl libgeos-dev gcc g++ && apt-get install ca-certificates
RUN apt-get update --fix-missing && apt-get install -y make openssl curl && apt-get install ca-certificates

# Required to build in an ARM environment
# gevent: libffi-dev libssl-dev python3-dev build-essential
Expand Down Expand Up @@ -80,3 +79,12 @@ ENV GIT_COMMIT_HASH=$commit_hash

# No entry point maximizes flexibility in the use of this image
ENTRYPOINT []

FROM base AS with-dev-dependencies

RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=./uv.lock,target=/app/uv.lock \
--mount=type=bind,source=./pyproject.toml,target=/app/pyproject.toml \
cd /app/ && \
unset UV_FROZEN && \
uv sync --locked --no-install-project --compile-bytecode --group dev
10 changes: 10 additions & 0 deletions monitoring/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ docker image build \
-t "${TAG}" \
--build-arg version="$(scripts/git/version.sh monitoring --long)" \
--build-arg commit_hash="$(git rev-parse HEAD)" \
--target base \
. \
|| 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
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 @@ -24,5 +24,5 @@ docker run --name uss_qualifier_unit_test \
-e MONITORING_GITHUB_ROOT=${MONITORING_GITHUB_ROOT:-} \
-v "$(pwd):/app" \
-v /var/run/docker.sock:/var/run/docker.sock \
interuss/monitoring \
interuss/monitoring-dev \
uss_qualifier/scripts/in_container/run_unit_tests.sh
21 changes: 12 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ requires-python = "==3.13.5"
dependencies = [
"aiohttp",
"arrow",
"basedpyright>=1.31.1",
"bc-jsonpath-ng",
"cryptography",
"deprecation",
Expand Down Expand Up @@ -38,11 +37,8 @@ dependencies = [
"pykml",
"pyopenssl",
"pyproj",
"pytest",
"pytest-mock",
"pyyaml",
"requests",
"ruff",
"s2sphere",
"scipy",
"shapely",
Expand All @@ -53,6 +49,18 @@ dependencies = [
"uuid6",
]

[dependency-groups]
dev = [
"basedpyright>=1.31.1",
"pytest",
"pytest-mock",
"ruff",
"types-lxml>=2025.8.25",
]

[tool.uv]
default-groups = []
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dev group is installed by default, but we don't want that ^^'


[tool.ruff]
target-version = "py313"

Expand Down Expand Up @@ -80,8 +88,3 @@ exclude = [
"monitoring/mock_uss/output/*",
"monitoring/uss_qualifier/output/*",
]

[dependency-groups]
dev = [
"types-lxml>=2025.8.25",
]
22 changes: 13 additions & 9 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading