Skip to content

Commit

Permalink
build: use latest images - 2024-03-15 - of RPi as base images
Browse files Browse the repository at this point in the history
feat(core): read serial number from eeprom and add it to sentry reports
feat(core): add screenshot action (triggered with `p` key)
fix(keypad): make keypad compatible with kernel 6.6 by using gpiozero
refactor(core): add `shutdown` method for service threads and worker threads to gracefully cancel async jobs instead of immediately terminating event loops
refactor(core): remove `_run_in_executer` from async utilities
refactor: use `logger.exception` in exception handlers
ci: use latest versions of ruff and pyright
  • Loading branch information
sassanh committed Apr 10, 2024
1 parent f7c5a40 commit 5db763e
Show file tree
Hide file tree
Showing 47 changed files with 466 additions and 348 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/integration_delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:

env:
PYTHON_VERSION: '3.11'
PYTHON_VERSION: '3.11.9'

jobs:
dependencies:
Expand All @@ -23,7 +23,7 @@ jobs:
path: |
~/.cache
~/.local
key: poetry-${{ hashFiles('poetry.lock') }}
key: poetry-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_VERSION}}

- uses: actions/setup-python@v5
name: Setup Python
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
path: |
~/.cache
~/.local
key: poetry-${{ hashFiles('poetry.lock') }}
key: poetry-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_VERSION}}

- name: Create stub files
run: poetry run pyright --createstub kivy
Expand All @@ -78,8 +78,8 @@ jobs:
- uses: actions/checkout@v4
name: Checkout

- uses: actions/setup-python@v5
name: Setup Python
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
Expand All @@ -91,7 +91,7 @@ jobs:
path: |
~/.cache
~/.local
key: poetry-${{ hashFiles('poetry.lock') }}
key: poetry-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_VERSION}}

- name: Lint
run: poetry run poe lint
Expand All @@ -101,27 +101,32 @@ jobs:
needs:
- dependencies
runs-on: ubuntu-latest
environment:
name: test
url: https://app.codecov.io/gh/${{ github.repository }}/
steps:
- name: System Dependencies
run: sudo apt-get install -y libegl1 libgl1 libmtdev1 libzbar0
run: |
sudo apt-get update -y
sudo apt-get install -y libegl1 libgl1 libmtdev1 libzbar0
- uses: actions/checkout@v4
name: Checkout

- uses: actions/setup-python@v5
name: Setup Python
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64

- uses: actions/cache/restore@v4
name: Load Cached Poetry
- name: Load Cached Poetry
uses: actions/cache/restore@v4
id: cached-poetry
with:
path: |
~/.cache
~/.local
key: poetry-${{ hashFiles('poetry.lock') }}
key: poetry-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_VERSION}}

- name: Run Tests
run: |
Expand Down Expand Up @@ -183,7 +188,7 @@ jobs:
path: |
~/.cache
~/.local
key: poetry-${{ hashFiles('poetry.lock') }}
key: poetry-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_VERSION}}

- name: Extract Version
id: extract_version
Expand Down Expand Up @@ -365,7 +370,6 @@ jobs:
with:
packages-dir: dist
verbose: true
skip-existing: true

release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,5 @@ headless_kivy_pi_buffer.raw

# local development
scripts/toggle_local_dependencies.py

screenshots
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

## Version 0.12.3

- build: use latest images of RPi as base images
- build: use latest images - 2024-03-15 - of RPi as base images
- feat(core): read serial number from eeprom and add it to sentry reports
- feat(core): add screenshot action (triggered with `p` key)
- fix(keypad): make keypad compatible with kernel 6.6 by using gpiozero
- refactor(core): add `shutdown` method for service threads and worker threads to
gracefully cancel async jobs instead of immediately terminating event loops
- refactor(core): remove `_run_in_executer` from async utilities
- refactor: use `logger.exception` in exception handlers
- ci: use latest versions of ruff and pyright

## Version 0.12.2
Expand Down
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,37 @@ Example screenshots:

<img width="200" alt="Ubo ai pod photo" src="https://github.com/ubopod/ubo-app/assets/94014876/899d32e4-ef8e-4849-a967-1e21ad12297a">



## 🚧 Disclaimer

Be aware that at the moment, Ubo app sends crash reports to Sentry. Soon we will
limit this to beta versions only.

## ⚙️ Notable Features

- Headless WiFi on-boarding with QR Code
- Headless WiFi on-boarding with QR code
- Easy headless remote access with SSH and VS Code tunnel
- Install and run Docker apps headlessly
- Access and control basic RPi utilities and settings

## 📋 Requirements

Ubo app is developed to run on Raspberry Pi 4 and 5. The experience is optimized around Ubo Pod which offers
Ubo app is developed to run on Raspberry Pi 4 and 5. The experience is optimized around Ubo Pod which offers

- a minimal LCD display and GUI with a keypad
- stereo microphone and speakers,
- camera
- LED ring
- sensors
The app functions even if some of these hardware elements are not provided, however some of the features that relay on these hardware component may not function. For example, WiFi onboarding with QRcode requires a camera onboard.

The app functions even if some of these hardware elements are not provided, however some of the features that rely on these hardware components may not function. For example, WiFi onboarding with QR code requires a camera onboard.

## 📦 Installation

### Pre-packaged image
Ubo Pod ships with a pre-flashed MicroSD card that has the app installed on it by default.

If you don't have it, or you just want to set up a fresh device, then:
Ubo Pod ships with a pre-flashed MicroSD card that has the app installed on it by default.

If you don't have it, or you just want to set up a fresh device, then:

1. download one of the images from the release section
2. Use Raspberry Pi Images and choose `custom image` to provide the download image file.
Expand Down Expand Up @@ -95,6 +94,7 @@ curl -sSL https://raw.githubusercontent.com/ubopod/ubo-app/main/ubo_app/system/i
curl -sSL https://raw.githubusercontent.com/ubopod/ubo-app/main/ubo_app/system/install.sh\
| sudo ALPHA=true WITH_DOCKER=true bash
```

Note that as part of the installation process, these debian packages are installed:

- git
Expand Down Expand Up @@ -128,6 +128,19 @@ Contributions following Python best practices are welcome.
- Use `ubo:` prefix for icon ids used in ubo core and `<service_name>:` prefix for
icon ids used in services.

### Development

#### QR code

In development environment, the camera is probably not working as it is relying,
on `picamera2`, so it may become challenging to test the flows relying on QR code
input.

To address this, the `qrcode_input` method, in not-RPi environments, will try to
get its input from `/tmp/qrcode_input.txt`. So, whenever you encounter a QR code
input, you can write the content of the QR code in that file and the application
will read it from there and continue the flow.

## 🔒 License

This project is released under the Apache-2.0 License. See the [LICENSE](./LICENSE)
Expand Down
56 changes: 28 additions & 28 deletions poetry.lock

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

18 changes: 11 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ubo-gui = [
"dev",
] },
]
python-redux = "^0.14.0"
python-redux = "^0.14.1"
pyzbar = "^0.1.9"
sdbus-networkmanager = { version = "^2.0.0", markers = "platform_machine=='aarch64'" }
rpi_ws281x = { version = "^5.0.0", markers = "platform_machine=='aarch64'" }
Expand All @@ -45,7 +45,7 @@ optional = true

[tool.poetry.group.dev.dependencies]
poethepoet = "^0.24.4"
pyright = "^1.1.356"
pyright = "^1.1.358"
pytest = "^8.0.0"
pytest-asyncio = "^0.23.5.post1"
pytest-cov = "^4.1.0"
Expand Down Expand Up @@ -84,12 +84,15 @@ args = [
cmd = "scripts/deploy.sh"

[tool.ruff]
lint.select = ["ALL"]
lint.ignore = ["INP001", "PLR0911", "D203", "D213"]
lint.fixable = ["ALL"]
lint.unfixable = []
target-version = 'py311'

[tool.ruff.lint]
select = ["ALL"]
ignore = ["INP001", "PLR0911", "D203", "D213"]
fixable = ["ALL"]
unfixable = []
logger-objects = ['ubo_app.logging.logger']

[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = ["type", "id"]

Expand All @@ -100,6 +103,7 @@ multiline-quotes = "double"

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101", "PLR0913"]
"**/reducer.py" = ["C901", "PLR0912"]
"ubo_app/services/*/ubo_handle.py" = ["TCH004"]

[tool.ruff.format]
Expand All @@ -114,7 +118,7 @@ exclude = ["typings"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
filterwarnings = "ignore:'imghdr' is deprecated:DeprecationWarning"
timeout = 30
timeout = 50

[tool.coverage.report]
exclude_also = ["if TYPE_CHECKING:"]
Loading

0 comments on commit 5db763e

Please sign in to comment.