Tools

The tools are a collection of scripts and utilities used for building and managing Anthias. They are located in the tools directory. The main entry point for the tools is the image_builder script, which is used to build disk images for Anthias.

image_builder

The image_builder script is used to build disk images for Anthias. It takes a number of options, which control which services are included in the image, and the target architecture. The following options are available:

  • --services: This option takes a comma-separated list of services to include in the image. The available services are:
    • server: This service provides the backend functionality for Anthias.
    • celery: This service is used for background tasks.
    • redis: This service is used for caching and message brokering.
    • websocket: This service provides a websocket connection between the frontend and the backend.
    • nginx: This service is used for serving the frontend application.
    • viewer: This service is used to render the content on the display.
    • wifi-connect: This service is used to connect to a Wi-Fi network.
    • test: This service is used for running unit tests.
    • tools: This service is used for installing the tools themselves.
  • --arch: This option specifies the target architecture. The available architectures are:
    • armv7l: This architecture is used for Raspberry Pi 1, 2, and 3 models.
    • arm64: This architecture is used for Raspberry Pi 4 models.
    • amd64: This architecture is used for PCs.
    • i386: This architecture is used for PCs.

Example:

python tools/image_builder/__main__.py --services server,celery,redis,websocket,nginx,viewer,wifi-connect --arch armv7l
          

This command will build a disk image for a Raspberry Pi 1, 2, or 3 model, which includes the following services: server, celery, redis, websocket, nginx, viewer, and wifi-connect.

The image_builder script uses the lib/utils.py script to determine the target architecture. The arch function in lib/utils.py uses the machine() function to determine the current architecture.

viewer.py

The viewer.py script is a standalone script used for rendering content on a display. It can be used to test content before deploying it to Anthias.

balena-disk-image.yaml

The balena-disk-image.yaml script is a workflow used for building Balena disk images. This workflow is triggered when a new release of Anthias is tagged on GitHub.

README.md

  • The main README.md file contains information about Anthias, including how to get started, how to contribute, and how to support the project.
  • The documentation section provides links to the forum, website, general documentation, developer documentation, and migrating assets from Anthias to Screenly.

website/index.html

  • The website/index.html file provides information about Anthias, including the hardware requirements, how Anthias works, and frequently asked questions.

docs/developer-documentation.md

The developer documentation provides an overview of the different directories and files that are present in a Raspberry Pi with Anthias installed.

docs/qa-checklist.md

The QA checklist provides a checklist of things to test when building a new release of Anthias.

docs/d2/anthias-diagram-overview.d2

The overview diagram shows the architecture of Anthias.

license

The license file contains the license terms for Anthias.

Top-Level Directory Explanations

.github/ - This directory contains GitHub-specific configuration files and workflows for the project.

.github/workflows/ - This directory contains YAML files defining continuous integration and deployment workflows for GitHub Actions.

ansible/ - Ansible is an open-source configuration management and automation tool. This directory contains Ansible playbooks and roles for managing and configuring the project.

ansible/roles/ - This directory contains Ansible roles, which are reusable collections of tasks and configurations for managing specific aspects of a system.

ansible/roles/screenly/ - This role is specific to the Screenly project and likely contains configurations and tasks related to it.

ansible/roles/system/ - This role manages system-level configurations.

anthias_app/ - This directory contains the main application codebase for the project, likely written in Django.

anthias_app/migrations/ - This directory contains database migration files for the Django application.

anthias_django/ - This directory may contain additional Django-specific configuration files and code.

api/ - This directory contains the API codebase for the project.

bin/ - This directory contains executable scripts for the project.

lib/ - This directory contains reusable Python modules and libraries for the project.

static/ - This directory contains static files, such as images, CSS, and JavaScript, that are served directly to the user by the web server.

static/fontawesome/ - This directory contains Font Awesome icons and styles.

static/fontawesome/css/ - This directory contains Font Awesome CSS files.

static/js/ - This directory contains JavaScript files.

static/spec/ - This directory contains test files for the static files.

static/spec/jasmine/ - This directory contains Jasmine test files.

templates/ - This directory contains HTML templates used to render dynamic content.

tests/ - This directory contains test files for the project.

tools/ - This directory contains tools and scripts used to develop and maintain the project.

tools/image_builder/ - This tool likely builds and optimizes images for the project.

website/ - This directory contains the website codebase.

website/bin/ - This directory contains website executable scripts.

webview/ - This directory likely contains configuration files and code for a webview component.