Skip to content

Fix E2E tests on macOS ARM64 by using multi-arch base image - #41

Closed
BKDDFS wants to merge 25 commits into
developfrom
feat/docker-macos-arm64-support
Closed

BKDDFS wants to merge 25 commits into
developfrom
feat/docker-macos-arm64-support

Conversation

@BKDDFS

@BKDDFS BKDDFS commented Jan 26, 2026

Copy link
Copy Markdown
Owner
  • Add _is_macos_arm64() helper to detect Apple Silicon
  • Conditionally apply --platform linux/amd64 flag only on non-ARM64 systems
  • Handle ConnectionResetError in service_initializer for startup timing
  • Add unit tests for ARM64 detection and conditional platform behavior

This allows native ARM64 builds on Apple Silicon while maintaining AMD64 compatibility elsewhere.

BKDDFS and others added 21 commits September 12, 2024 16:44
Standardize imports
- Add _is_macos_arm64() helper to detect Apple Silicon
- Conditionally apply --platform linux/amd64 flag only on non-ARM64 systems
- Handle ConnectionResetError in service_initializer for startup timing
- Add unit tests for ARM64 detection and conditional platform behavior

This allows native ARM64 builds on Apple Silicon while maintaining
AMD64 compatibility elsewhere.
- Remove service_manager module (Python wrapper around Docker)
- Remove config.py and start.py entry points
- Users now use docker-compose directly
- Migrate Dockerfile to uv 0.9.26 for faster builds
- Upgrade Python 3.12 → 3.13
- Upgrade TensorFlow 2.18.0 → 2.20.0
- Update documentation with new usage instructions
- Fix Docker build context for uv.lock access
…ct structure

Module changes:
- Rename extractor_service/ to perfectframe/
- Move main.py to app.py as the FastAPI entry point
- Update all internal imports to use perfectframe module

Project structure:
- Move Dockerfile from extractor_service/ to project root
- Remove extractor_service/.dockerignore (no longer needed)
- Remove extractor_service/requirements.txt (using pyproject.toml)
- Remove .github/README.pl.md (Polish README)

Test reorganization:
- Flatten test structure from tests/extractor_service/* and tests/service_manager/*
  to tests/unit/, tests/integration/, tests/e2e/
- Merge common test fixtures into tests/common.py
- Update all test imports to use perfectframe module
- Rename docker e2e tests for clarity (docker_best_frames_extractor_test.py, etc.)

Configuration updates:
- Update docker-compose.yaml to use root Dockerfile
- Update pyproject.toml with new module path
- Update .github/workflows/run_tests.yml for new test paths
- Add perfectframe/ to .gitignore patterns
- Exclude perfectframe/ from ty pre-commit check (isolated env lacks dependencies)
- Replace TensorFlow (~500MB) with ONNX Runtime (~50MB)
- Update Python to 3.14.2 and all dependencies to latest versions
- Add conversion scripts for model weights (TF -> ONNX)
- Update Dockerfile with fixed versions for production
- Reduce Docker image size by ~450MB
- Add .pre-commit-config.yaml with ruff, docformatter, detect-secrets, pytest
- Configure ruff in pyproject.toml with ALL rules and sensible ignores
- Add docstrings to all modules and public functions (Google style)
- Fix all linting issues: RET504, PLR2004, D401, D205, D404
- Migrate tests from unittest.mock to pytest-mock
- Add pytest-mock to test dependencies
- Remove obsolete scripts/ directory (ONNX conversion)
- Add .secrets.baseline for detect-secrets
- Update .gitignore with *.onnx, *.h5
Remove return type annotations from yield-based pytest fixtures that ty
incorrectly infers as generators. Exclude tests/ from ty-check since test
files use dev dependencies not available in pre-commit environment.
- Add unit tests for app.py endpoints
- Add --cov=perfectframe --cov-fail-under=100 to pytest
- Remove unused if __name__ == "__main__" block
- Change onnxruntime to onnxruntime-gpu for CUDA support (Linux/Windows)
- Keep onnxruntime for macOS (no CUDA support on Apple Silicon)
- Rename docker-compose services: extractor_service -> perfectframe
- Remove TensorFlow leftover environment variable
- Add CPU Mode and GPU Mode sections to README
- Update Built with section: Tensorflow -> ONNX Runtime
- Remove redundant Args sections from docstrings (types are self-documenting)
- Remove "Built with" section from README
- Add usage comments to dependencies in pyproject.toml
Replace type: ignore comments with proper runtime checks and add type
aliases (Image, Images, ImagesBatch, ScoresArray) for better code clarity.
Fix tuple type annotations and Generator return type.
Set _active_extractor immediately after check in start_extractor
instead of inside background task to prevent concurrent requests
from bypassing the single-extractor constraint.
Replace str | None with ExtractorName | None in ExtractorStatus
and ExtractorManager for type consistency across the codebase.
- Rename batch_size to frames_batch_size in get_next_frames
- Use Images type for frames batch return type
- Use Image type for _read_next_frame return
- Skip None frames when building batch
- Remove unused numpy import
- Fix extractor_manager to use .value when building error messages
- Update unit tests to expect enum .value in assertions
- Update integration tests to use ImageExtension/VideoExtension enums
  instead of removed config attributes
- Use ExtractorName enum instead of string in integration test
- Remove unused config fixture arguments from tests
- Remove curl from Dockerfile and healthcheck from docker-compose
Consolidate legacy class structure after TensorFlow to ONNX migration.
The InceptionResNetNIMA name was misleading as it no longer reflects
architecture-specific knowledge - it's now a generic ONNX loader.
@BKDDFS
BKDDFS deleted the branch develop January 29, 2026 11:28
@BKDDFS BKDDFS closed this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant