Skip to content

Latest commit

 

History

History
200 lines (137 loc) · 5.25 KB

File metadata and controls

200 lines (137 loc) · 5.25 KB

SCIoT Dependency Profiles

SCIoT separates its edge server, client variants, and development tools into uv extras. Install only the profile needed by the target system.

Supported Runtime

  • Python: 3.11
  • TensorFlow: 2.15.0
  • Configuration format: YAML

TensorFlow is selected automatically:

Platform Package
macOS Apple Silicon tensorflow-macos==2.15.0
macOS Intel tensorflow==2.15.0
Linux x86-64 tensorflow==2.15.0
Linux ARM tensorflow==2.15.0

Windows is not currently part of the verified runtime matrix.

See docs/TENSORFLOW_KERAS_POLICY.md for the authoritative TensorFlow/Keras policy, model-loading compatibility shim, manual platform verification matrix, and troubleshooting guidance.

Base Installation

uv sync --no-dev

The base installation contains only dependencies shared by the server and Python clients:

  • NumPy
  • Pillow
  • PyYAML

It is useful for inspecting shared modules, but a runtime extra is required to run a server or client.

Edge Server

uv sync --extra server --no-dev
uv run python src/server/edge/run_edge.py

The server profile includes FastAPI, Uvicorn, MQTT, WebSocket, NTP, and TensorFlow dependencies. It does not install camera, dashboard, plotting, or research packages.

Static-Image Client

uv sync --extra client-static --no-dev
uv run python src/client/python/http_client.py

This profile includes TensorFlow, HTTP, and profiling dependencies. It does not install server or camera packages.

Laptop Camera Client

uv sync --extra client-laptop --no-dev
uv run python src/client/python/http_clientCAMlaptop.py

For the benchmark variant:

uv run python src/client/python/benchmark.py

The profile adds OpenCV to the standard client dependencies. Camera availability and permissions are managed by the host operating system.

Raspberry Pi Camera Client

Picamera2 is installed through Raspberry Pi OS because its Linux system dependencies cannot be represented safely in a cross-platform Python lockfile.

On Raspberry Pi OS:

sudo apt update
sudo apt install python3-picamera2
uv venv --python 3.11 --system-site-packages
uv sync --extra client-raspberry-pi --no-dev
uv run python src/client/python/http_clientCAMpi.py

Alternative method

python3 -m venv --system-site-packages .venv
python3 -m ensurepip
pip3 install pillow pyyaml psutil picamera2 tensorflow

For the Raspberry Pi benchmark variant, configure benchmark.py to use http_clientCAMpiBench.py, then run:

uv run python src/client/python/benchmark.py

The Raspberry Pi profile was lockfile-validated, but camera hardware must be verified on a Raspberry Pi.

Analysis and Dashboard Tools

uv sync --extra analysis --no-dev

This profile contains Pandas, Matplotlib, Seaborn, Plotly, Streamlit, SciPy, and profiling/analysis tools.

Examples:

uv run python plot_results.py
uv run streamlit run src/server/web/webpage.py

Analysis can be combined with a runtime:

uv sync --extra server --extra analysis --no-dev

Research Dataset Tools

uv sync --extra research --no-dev

The research profile currently contains FiftyOne and its larger dependency tree. It is intentionally excluded from every runtime profile.

Tests and Development

For server-oriented tests:

uv sync --extra server --extra test
uv run pytest

For the complete local development environment:

uv sync \
  --extra server \
  --extra client-laptop \
  --extra analysis \
  --extra test \
  --extra dev

Switching Profiles

uv sync performs an exact synchronization. Packages belonging only to a previously selected extra are removed when switching profiles.

For example:

uv sync --extra server --no-dev
uv sync --extra client-static --no-dev

After the second command, the environment represents the static client rather than a combined server/client installation. Specify multiple --extra arguments when both are needed.

Running Server and Client from One Checkout

Use named project environments to keep the installations fully isolated:

# Prepare the environments once.
UV_PROJECT_ENVIRONMENT=.venv-server \
  uv sync --extra server --no-dev

UV_PROJECT_ENVIRONMENT=.venv-client \
  uv sync --extra client-static --no-dev

Then run them in separate terminals:

# Terminal 1
UV_PROJECT_ENVIRONMENT=.venv-server \
  uv run python src/server/edge/run_edge.py

# Terminal 2
UV_PROJECT_ENVIRONMENT=.venv-client \
  uv run python src/client/python/http_client.py

Alternatively, install a combined environment:

uv sync --extra server --extra client-static --no-dev

Verified Isolation

The following checks were performed in separate clean environments:

  • Server: TensorFlow, FastAPI, Uvicorn, MQTT, and WebSockets installed; OpenCV, Picamera2, Streamlit, and FiftyOne absent.
  • Static client: TensorFlow, Requests, urllib3, and psutil installed; server, camera, dashboard, and research packages absent.
  • Laptop client: static client dependencies plus OpenCV; server, Raspberry Pi camera, dashboard, and research packages absent.
  • Raspberry Pi client: dependency resolution verified; Picamera2 hardware validation remains platform-specific.