Module folder structure¶
There are two relevant folder structures: the layout used while developing a module, and the layout used after the module has been installed.
Repository Structure¶
When developing a new module the following folder structure is required. This example is based on the Allsky ADSB module.
allsky_adsb Top-level folder, the module name
├── allsky_adsb Data folder, copied into core Allsky. Named the same as the module
│ ├── adsb_data This can be any data that is needed. The folder name is only relevant to your code
│ └── tools A folder to hold post-install tools
│ └── build_database.py The post-install tool, referenced in the installer.json file
├── allsky_adsb.py The actual module itself
├── blocks Folder to hold blocks
│ ├── aircraft1.json
│ ├── aircraft2.json
│ ├── aircraft3.json
│ ├── aircraft4.json
│ ├── aircraft5.json
│ ├── closest.json
│ └── top5.json
├── charts Folder to hold charts
│ ├── total_aircraft_chart.json
│ └── total_aircraft_gauge.json
├── db Folder for database config
│ └── db_data.json The database config, mainly handles how the database is purged
├── installer.json Installation details file
├── manifest.json Required security manifest generated before submitting the module
├── requirements.txt LEGACY file, do not use
├── packages.txt LEGACY file, do not use
└── README.md README file for people browsing the repo
The manifest.json file is generated by the module manifest tool in the allsky-modules repository. Do not edit it by hand. Regenerate it after any change to module code, data, dependency files, installer metadata, charts, blocks, or documentation inside the module folder.
Installed structure¶
Once a module has been installed by the module installer the files are copied into the main Allsky folder. The base folder for extra modules is
~/allsky/config/myfiles/modules
modules The modules folder containing all extra modules
├── allsky_adsb.py The adsb module
├── moduledata Module data folder
│ ├── blocks Blocks folder, each module has its own folder
│ │ └── allsky_adsb The blocks for the adsb module
│ │ ├── aircraft1.json
│ │ ├── aircraft2.json
│ │ ├── aircraft3.json
│ │ ├── aircraft4.json
│ │ ├── aircraft5.json
│ │ ├── closest.json
│ │ └── top5.json
│ ├── charts Charts folder, each module has its own folder
│ │ └── allsky_adsb The charts for the adsb module
│ │ ├── total_aircraft_chart.json
│ │ └── total_aircraft_gauge.json
│ ├── data Data folder, each module has its own folder
│ │ └── allsky_adsb The data folder for the adsb module, copied from the repo
│ │ ├── adsb_data
│ │ └── tools
│ │ └── build_database.py
│ ├── info
│ │ └── allsky_adsb
│ ├── installer Installer info for each module
│ │ └── allsky_adsb Installer info for the adsb module
│ │ ├── installer.json
│ │ └── manifest.json Security manifest copied from the module repository
│ └── logfiles Logs created during installation
│ └── allsky_adsb
│ └── dependencies.log
└── __pycache__ Compiled Python code
How Allsky finds modules¶
Allsky ships with core modules which can then be extended by installing the extra modules. Once installed Allsky will search for modules in the following order
- The legacy custom modules folder
/opt/allsky/modules - The new custom modules folder
~/allsky/config/myfiles/modules - Core Allsky
~/allsky/scripts/modules
This mechanism allows you to implement custom versions of the core Allsky modules should you wish to do so.
Overriding Core Allsky Modules
Before attempting to override a core module you must understand the existing functionality of the module. Failure to understand the modules could result in Allsky failing
Legacy Module Locations
version v2024.12.06_01 and prior of Allsky stored all modules and module data in the /opt/allsky/modules folder. All modules and associated data are now stored within the ~/allsky folder.