Skip to content

Commit

Permalink
Merge branch 'master' into nicomiguelino/fix-balena-image-build-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
nicomiguelino committed Sep 20, 2024
2 parents 7c24392 + 8f6d8b0 commit e316eab
Show file tree
Hide file tree
Showing 56 changed files with 1,251 additions and 603 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
- '!docs/**'
- '!bin/install.sh'
- '!bin/upgrade_containers.sh'
- '!tests/**'

jobs:
run-tests:
Expand All @@ -26,7 +27,7 @@ jobs:
needs: run-tests
strategy:
matrix:
board: ['pi1', 'pi2', 'pi3', 'pi4']
board: ['pi1', 'pi2', 'pi3', 'pi4', 'x86']
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -60,6 +61,7 @@ jobs:
run: |
export BUILD_TARGET=${{ matrix.board }}
export PUSH=1
export SKIP_TEST=1
./bin/build_containers.sh
balena:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
shell: 'script -q -e -c "bash {0}"'
run: |
docker compose -f docker-compose.test.yml exec anthias-test bash ./bin/prepare_test_environment.sh -s
docker compose -f docker-compose.test.yml exec anthias-test nose2 -v -A '!fixme'
docker compose -f docker-compose.test.yml exec anthias-test nose2 -v
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/python-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ on:
- 'master'
paths:
- '**/*.py'
- '.github/workflows/python-lint.yaml'
pull_request:
branches:
- master
- experimental
paths:
- '**/*.py'
- '.github/workflows/python-lint.yaml'

jobs:
run-python-linter:
Expand All @@ -27,13 +29,21 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.3
virtualenvs-create: true
virtualenvs-in-project: false
virtualenvs-path: ~/.venv
installer-parallel: true

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/requirements.linter.txt
poetry install --only=dev-host
- name: Analyzing the code with flake8
run: |
if [ -n "$(git ls-files '*.py')" ]; then
flake8 $(git ls-files '*.py')
poetry run flake8 $(git ls-files '*.py')
fi
69 changes: 51 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ We've tested Anthias and is known to work on the following Raspberry Pi models:

* Raspberry Pi 4 Model B - 32-bt and 64-bit Bullseye, 64-bit Bookworm
* Raspberry Pi 3 Model B+ - 32-bit and 64-bit Bullseye, 64-bit Bookworm
* Raspberry Pi 3 Model B - 64-bit Bookworm
* Raspberry Pi 3 Model B - 64-bit Bookworm and Bullseye
* Raspberry Pi 2 Model B - 32-bit Bookworm and Bullseye
* x86 Devices - 64-bit Bullseye
* These devices can be something similar to a NUC.

We're still fixing the installer so that it'll work with Raspberry Pi Zero and Raspberry Pi 2.

We're still fixing the installer so that it'll work with Raspberry Pi Zero and Raspberry Pi 1.
Should you encounter any issues, please file an issue either in this repository or in the
[forums](https://forums.screenly.io).

Expand Down Expand Up @@ -67,20 +71,31 @@ The image file looks something like `<yyyy>-<mm>-<dd>-raspberry<version>.zip`. T

If you'd like more control over your digital signage instance, try installing it on Raspberry Pi OS Lite.

Before you start, make sure that you have `curl` installed. If not, you can install it by running:

```bash
$ sudo apt update
$ sudo apt install -y curl
```

The tl;dr for on [Raspberry Pi OS](https://www.raspberrypi.com/software/) is:

```
$ bash <(curl -sL https://install-anthias.srly.io)
```

You'll be prompted with the following yes-no questions:
You'll be prompted with the following questions:

* Do you still want to continue?
* Do you want Anthias to manage your network? This is recommended for most users because it adds features to manage your network.
* Would you like to install the experimental version of Anthias instead?
* Would you like Anthias to manage the network for you?
* Which version of Anthias would you like to install?
* Would you like to perform a full system upgrade as well?

Answer the questions with only `y` or `N`. You don't need to press Enter for each of your inputs.
You can either use the arrow keys to select your choice and then press Enter or type `y` or `n`
(for yes-no questions). The installer will display your responses before proceeding with the
installation.

![install-anthias-gif](./docs/images/install-anthias.gif)

**This installation will take 15 minutes to several hours**, depending on variables such as:

Expand All @@ -94,34 +109,52 @@ During ideal conditions (Raspberry Pi 3 Model B+, class 10 SD card and fast inte

Opting for network management will enable and configure the [NetworkManager](https://wiki.debian.org/NetworkManager) service on your device.

#### Prompt: Experimental Version
#### Prompt: Version Selection

You can choose between the following choices &mdash; `latest`, `experimental`, and `tag`.

* Selecting `latest` will install the version from the `master` branch.
* Selecting `experimental` will install the version from the `experimental` branch.
* Selecting `tag` will prompt you to enter a specific tag to install.
* Do take note the `latest` and `experimental` versions are rolling releases, so you'll always get the latest changes.

##### Experimental Features

We have decided to roll out an `experimental` branch for new features that can break Anthias, especially
if you already have Anthias installed and wish to upgrade.

Before you proceed, make sure to download a
backup by going to the **_Settings_** page and clicking **_Get Backup_**. You can load the backup file later by going to **_Settings_** and clicking **_Upload and Recover_**.

If you wish to opt for experimental features, select `y`. Select `N` otherwise.

Here's a current list of experimental features:

* Migration from Flask to Django &ndash; The database still uses `sqlite3`. We will transition to using ORM in the future.
* Revamped API docs &ndash; we changed the structure and overall look and feel of the documentation for easier reference.

##### Installing from a Specific Tag

Select this option if you want to install a pinned version of Anthias. You'll be prompted to enter
a specific tag to install. You can find the tags in the
[releases](https://github.com/Screenly/Anthias/releases) page.

The script will check if the tag specified is valid and can be installed.
If it's not, you need to run the script again and enter a valid tag.

#### Prompt: Full System Upgrade

If you've selected **_y_** when prompted for an upgrade &ndash; i.e., "Would you like to perform a full system upgrade as well? (y/N)"
If you've selected **Yes** when prompted for an upgrade &ndash; i.e., "Would you like to perform a full system upgrade as well?"
&ndash; you'll get the following message when the installer is almost done executing:

```
"Please reboot and run /home/$USER/screenly/bin/upgrade_containers.sh to complete the installation. Would you like to reboot now? (y/N)"
Please reboot and run `/home/$USER/screenly/bin/upgrade_containers.sh` to complete the installation.
Would you like to reboot now?
```

You have the option to reboot now or later. On the next boot, make sure to run
`upgrade_containers.sh`, as mentioned above.

Otherwise, if you've selected **_N_** for the system upgrade, then you don't need to do a reboot for the containers to be started. However, it's still recommended to do a reboot.
Otherwise, if you've selected **No** for the system upgrade, then you don't need to do a reboot for the containers to be started. However, it's still recommended to do a reboot.

### Installing with Balena

Expand All @@ -137,26 +170,26 @@ This feature is only available in devices running Raspberry Pi OS at the moment.
To get started, SSH to your Raspberry Pi running Anthias. For instance:

```bash
ssh pi@raspberrypi
$ ssh pi@raspberrypi
```

Go to the project root directory and create a Python virtual environment, if you haven't created one.

```bash
cd ~/screenly
python -m venv venv/
$ cd ~/screenly
$ python -m venv venv/
```

Activate the virtual environment. You need to do this everytime right before you run the script.

```bash
source ./venv/bin/activate
$ source ./venv/bin/activate
```

Install the dependencies required by the assets migration script.

```bash
pip install -r requirements/requirements.local.txt
$ pip install -r requirements/requirements.local.txt
```

Before running the script, you should prepare the following:
Expand All @@ -166,7 +199,7 @@ Before running the script, you should prepare the following:
Run the assets migration script. Follow through the instructions & prompts carefully.

```bash
python tools/migrate-assets-to-screenly.py
$ python tools/migrate-assets-to-screenly.py
```

## Issues and bugs
Expand Down
5 changes: 4 additions & 1 deletion ansible/roles/network/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@
register: nm_pkla_path

- name: Copy org.freedesktop.NetworkManager.pkla to 50-local.d
ansible.builtin.command: cp -f /var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla /etc/polkit-1/localauthority/50-local.d
ansible.builtin.shell: |
mkdir -p /etc/polkit-1/localauthority/50-local.d
cp -f /var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla \
/etc/polkit-1/localauthority/50-local.d
when: manage_network|bool
changed_when: not nm_pkla_path.stat.exists

Expand Down
Loading

0 comments on commit e316eab

Please sign in to comment.