mirror of
https://github.com/ruvnet/RuView
synced 2026-07-25 17:51:48 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f8f08076eb | |||
| 55f6a74e1e | |||
| b5a91c5635 | |||
| 308d2fc89d | |||
| 5038e3c8e1 | |||
| e239af3636 | |||
| 4856afbd0c | |||
| 4d205a05c4 | |||
| bc42ae7903 |
@@ -265,23 +265,41 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install locust
|
pip install pytest # the perf suite is pytest, not locust
|
||||||
|
|
||||||
- name: Start application
|
- name: Start application
|
||||||
working-directory: archive/v1
|
working-directory: archive/v1
|
||||||
|
env:
|
||||||
|
# No CSI hardware in CI — serve mock pose data so the pose endpoints
|
||||||
|
# respond 200 under load instead of erroring "requires real CSI data".
|
||||||
|
MOCK_POSE_DATA: "true"
|
||||||
run: |
|
run: |
|
||||||
uvicorn src.api.main:app --host 0.0.0.0 --port 8000 &
|
uvicorn src.api.main:app --host 0.0.0.0 --port 8000 &
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
- name: Run performance tests
|
- name: Run performance tests
|
||||||
|
working-directory: archive/v1
|
||||||
|
env:
|
||||||
|
MOCK_POSE_DATA: "true"
|
||||||
run: |
|
run: |
|
||||||
locust -f tests/performance/locustfile.py --headless --users 50 --spawn-rate 5 --run-time 60s --host http://localhost:8000
|
# The repo's performance suite is pytest (test_api_throughput.py,
|
||||||
|
# test_frame_budget.py, test_inference_speed.py) — there is no
|
||||||
|
# locustfile.py, so the old `locust -f tests/performance/locustfile.py`
|
||||||
|
# command always failed with "Could not find ...". Run the real suite.
|
||||||
|
# -o addopts="" drops the root pyproject's --cov/--cov-fail-under=100
|
||||||
|
# flags (pytest-cov isn't installed here and 100% cov is for unit tests).
|
||||||
|
# `python -m pytest` (not the bare `pytest` script) puts the cwd
|
||||||
|
# (archive/v1) on sys.path so test_frame_budget.py's `from src.core...`
|
||||||
|
# import resolves — the bare script omits cwd and raises
|
||||||
|
# ModuleNotFoundError: No module named 'src'.
|
||||||
|
python -m pytest tests/performance/ -o addopts="" -v --junitxml=perf-junit.xml
|
||||||
|
|
||||||
- name: Upload performance results
|
- name: Upload performance results
|
||||||
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: performance-results
|
name: performance-results
|
||||||
path: locust_report.html
|
path: archive/v1/perf-junit.xml
|
||||||
|
|
||||||
# Docker Build and Test
|
# Docker Build and Test
|
||||||
# NOTE: the canonical Docker build for the sensing-server is now
|
# NOTE: the canonical Docker build for the sensing-server is now
|
||||||
@@ -367,6 +385,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [docker-build]
|
needs: [docker-build]
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
|
permissions:
|
||||||
|
contents: write # gh-pages deploy needs write (GITHUB_TOKEN is read-only by default -> 403)
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -384,6 +404,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Generate OpenAPI spec
|
- name: Generate OpenAPI spec
|
||||||
working-directory: archive/v1
|
working-directory: archive/v1
|
||||||
|
env:
|
||||||
|
MOCK_POSE_DATA: "true" # no CSI hardware in CI
|
||||||
run: |
|
run: |
|
||||||
python -c "
|
python -c "
|
||||||
from src.api.main import app
|
from src.api.main import app
|
||||||
@@ -394,6 +416,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
uses: peaceiris/actions-gh-pages@v4
|
uses: peaceiris/actions-gh-pages@v4
|
||||||
|
continue-on-error: true # openapi generation above is the real validation; deploy is best-effort (Pages may be disabled)
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: ./docs
|
publish_dir: ./docs
|
||||||
|
|||||||
@@ -107,16 +107,25 @@ class PoseService:
|
|||||||
async def _initialize_models(self):
|
async def _initialize_models(self):
|
||||||
"""Initialize neural network models."""
|
"""Initialize neural network models."""
|
||||||
try:
|
try:
|
||||||
# Initialize DensePose model
|
# Initialize DensePose model. DensePoseHead requires a config
|
||||||
|
# dict — input_channels matches the modality translator's output
|
||||||
|
# (256), with the standard DensePose 24 body parts and 2 (U,V)
|
||||||
|
# coordinates. (Previously called with no args → TypeError at
|
||||||
|
# startup, which broke the API service.)
|
||||||
|
densepose_config = {
|
||||||
|
'input_channels': 256,
|
||||||
|
'num_body_parts': 24,
|
||||||
|
'num_uv_coordinates': 2,
|
||||||
|
}
|
||||||
if self.settings.pose_model_path:
|
if self.settings.pose_model_path:
|
||||||
self.densepose_model = DensePoseHead()
|
self.densepose_model = DensePoseHead(densepose_config)
|
||||||
# Load model weights if path is provided
|
# Load model weights if path is provided
|
||||||
# model_state = torch.load(self.settings.pose_model_path)
|
# model_state = torch.load(self.settings.pose_model_path)
|
||||||
# self.densepose_model.load_state_dict(model_state)
|
# self.densepose_model.load_state_dict(model_state)
|
||||||
self.logger.info("DensePose model loaded")
|
self.logger.info("DensePose model loaded")
|
||||||
else:
|
else:
|
||||||
self.logger.warning("No pose model path provided, using default model")
|
self.logger.warning("No pose model path provided, using default model")
|
||||||
self.densepose_model = DensePoseHead()
|
self.densepose_model = DensePoseHead(densepose_config)
|
||||||
|
|
||||||
# Initialize modality translation
|
# Initialize modality translation
|
||||||
config = {
|
config = {
|
||||||
|
|||||||
@@ -36,3 +36,4 @@ scikit-learn>=1.2.0
|
|||||||
|
|
||||||
# Monitoring dependencies
|
# Monitoring dependencies
|
||||||
prometheus-client>=0.16.0
|
prometheus-client>=0.16.0
|
||||||
|
psutil>=5.9.0 # system metrics — imported by health.py / metrics.py / status.py / monitoring.py
|
||||||
|
|||||||
Reference in New Issue
Block a user