Commit Graph

453 Commits

Author SHA1 Message Date
Jonas L fe0b2c4a7a
feat(analyzer): enhance analyzer cli and logging (#1507)
Some initial work on modernizing the analyzer app. This replace any custom logger or `logging` based logger with the logging tools from `libretime_shared.logging` and `loguru`.

- rename cli to main
- use pathlib in setup.py
- add api-client and shared package as dev deps
- rework main entrypoint cli to use click and shared helpers
- remove unused imports
- replace logging with logger
- rework analyzer app using shared abstract app
- move analyzer log path to systemd service
- change analyzer working dir

BREAKING CHANGE: The analyzer cli has been reworked and uses new flags / environnement variables for configuration.
`--debug` flag becomes `--log-level <level>`
`--rmq-config-file` flag becomes `--config <filepath>`
`--http-retry-queue-file` flag becomes `--retry-queue-filepath`.
`retry-queue-filepath` default value changed from `/tmp/airtime_analyzer_http_retries` to `retry_queue` in the working dir.
`LIBRETIME_CONF_DIR` environnement variable replaced by `LIBRETIME_CONFIG_FILEPATH`.

BREAKING CHANGE: When running analyzer as a systemd service, the working directory is now /var/lib/libretime/analyzer.
2022-01-17 10:26:30 +02:00
Jonas L 5c72f714a8
feat(playout): enhance playout logging (#1495)
Some initial work on modernizing the playout app. This replace any custom logger or
logging based logger with the logging tools from libretime_shared.logging and loguru.

Removed all the thread/function assigned logger (self.logger = ...), as this makes it
part of the logic (passing logger though function args) as it should not.

Of a dedicated logger is required for a specific task, it should use
the create_task_logger function.

- refactor: remove dead code
- refactor: remove py2 specific fix
- feat: remove unused test command
- feat: setup shared cli and logging tools
- feat: replace logging with loguru
- feat: setup shared cli and logging tools for notify
- fix: warn method deos not exist
- feat: make cli setup the entrypoint
- fix: install shared modules globally in production
  use extra_requires to load local packages in dev environement
- feat: configure log path in systemd service
- feat: default behavior is to log to console only
- feat: create log dir during install
- chore: add comment
- fix: don't create useless dir in install
- fix: move notify logs to /var/log/libretime dir
- fix: update setup_logger attrs
- style: linting
- fix: replace verbosity flag with log-level flag
- feat: use shared logging tool in liquidsoap
- fix: pass logger down to api client
- feat: allow custom log_filepath in liquidsoap config
- chore: add pylintrc to playout
- refactor: fix pylint errors
- feat: set liquidsoap log filepath in systemd service
- fix: missing setup entrypoint update

BREAKING CHANGE: for playout and liquidsoap the default log file path changed to None
and will only log to the console when developing / testing. Unless you are running the
app as a systemd service (production) the default logs filepaths changed:
from "/var/log/airtime/pypo/pypo.log" to "/var/log/libretime/playout.log" and
from "/var/log/airtime/pypo-liquidsoap/ls_script.log" to "/var/log/libretime/liquidsoap.log"

BREAKING CHANGE: for playout-notify the default log file path changed
from "/var/log/airtime/pypo/notify.log" to "/var/log/libretime/playout-notify.log"
2022-01-13 17:11:37 +02:00
jo aa4be97312 chore: move liquidsoap logrotate in install dir 2022-01-04 09:18:58 +02:00
Kyle Robbertze 959e001edd fix: revert removal of eval for shell commands
Fixes: #1434
2021-11-09 14:47:56 +01:00
Jonas L 4057c88cf0
feat: debian 11 support (#1292)
* Debian 11 Support

Run api ci test on bullseye as well

* Silan does not work for mp3 on bullseye

* Liquisoap does not fail with wma files on bullseye
2021-11-09 11:21:40 +02:00
Kyle Robbertze 022b1a2881 chore: resolve shell warnings 2021-11-08 20:57:41 +01:00
Kyle Robbertze 7182390000
feat: add support for Ubuntu Focal 20.04 (#1168)
Co-authored-by: Valerio Bozzolan <gnu@linux.it>
2021-11-04 09:55:50 +02:00
jo 19c816f294 Update paths after playout move 2021-10-17 08:02:47 +00:00
jo 8fe0156d4f Update paths after api_client move 2021-10-17 08:02:47 +00:00
jo cf36eec5f8 Update paths after wroker move 2021-10-17 08:02:47 +00:00
jo 08f13d850c Update paths after analyzer move 2021-10-17 08:02:47 +00:00
Kyle Robbertze 2f3adac09d
Merge pull request #1373 from jooola/feat/rename_python_packages
Rename python packages/entrypoints
2021-10-14 14:06:50 +00:00
jo 25e947c8bf Rename airtime-liquidsoap to libretime-liquidsoap
BREAKING:
sudo rm -f \
  /etc/logrotate.d/airtime-liquidsoap
2021-10-14 15:31:59 +02:00
jo 67db856fd8 Pin setuptools to ^58.0 in installer 2021-10-14 15:23:58 +02:00
jo c4c89eae19 Fix paths after legacy rename 2021-10-11 13:43:39 +02:00
jo a55962a42c Remove unused /run/airtime directory 2021-10-06 18:10:22 +02:00
jo 33933467a3 Move legacy packages.ini to airtime_mvc 2021-10-05 15:00:06 +02:00
jo 6013434393 Install api with prod extra requires 2021-10-01 17:49:33 +02:00
jo 691b564ad5 Install api using pip 2021-10-01 17:44:16 +02:00
jo af656d5481 Install analyzer with pip and change script prefix to default /usr/local 2021-10-01 17:43:20 +02:00
jo 53af85de02 Install celery using pip 2021-10-01 17:42:33 +02:00
jo d7615cfe37 Install pypo with pip and change script prefix to default /usr/local 2021-10-01 17:41:20 +02:00
jo 24203e2086 Install api_clients using pip 2021-10-01 17:37:47 +02:00
jo 51f152dbd0 Refactor pip install command 2021-10-01 17:37:23 +02:00
jo aad92c4ac1 Revert 77315885b9
And remove prod extra requires for api because ./setup.py install
don't handle extra requires.
2021-09-17 07:23:26 +02:00
jo eb223a6951 Install the api with prod extra 2021-09-13 15:01:06 +02:00
jo 77315885b9 Use pip to install apps on the system 2021-09-13 15:00:31 +02:00
jo 9a7c3e0d21 Replace build.sh with make to manage airtime_mvc 2021-09-11 04:55:51 +02:00
jo 03b109dcb5 Fix paths after composer.* files move 2021-09-11 04:48:53 +02:00
jo 7cb3501540 Rename scripts/ to tools/ 2021-09-07 23:03:19 +02:00
jo cac25543c6 Drop Upstart support 2021-09-02 14:30:31 +02:00
jo 3da0310173 Drop SysV support 2021-09-02 14:30:31 +02:00
jo 4bd76f096c Fix packages path in installer 2021-09-01 15:33:48 +02:00
jo b5c9a6b2c7 Use packages manager in install script 2021-08-31 16:07:29 +02:00
Marc-Alexandre Espiaut 44e654bc95
Fixing a permission bug in the install script.
On a fresh Ubuntu 18.04 install, the script stops when trying to execute `build.sh`. Calling `bash` to launch the script fixes the issue.
2021-08-24 08:00:16 +00:00
Kyle Robbertze cd60f4f7a9
Revert "Fix default web_root" 2021-08-17 21:14:15 +02:00
Kyle Robbertze bb941c2f22
Merge pull request #1298 from paddatrapper/fix/web-root
Fix default web_root
2021-08-17 21:11:53 +02:00
Kyle Robbertze c3e60640d4 Fix default web_root 2021-08-17 21:11:07 +02:00
jo 60bd49fa62 Fix bad logic
Before the formatting, the check was useless.
The fixes from the formatting/linting PR messed the logic.
2021-08-17 13:38:31 +02:00
jo 9881eebf55 Fix shellcheck warnings 2021-08-17 12:23:36 +02:00
jo dc999f9006 Fix shellcheck errors 2021-08-17 12:23:32 +02:00
jo b5f302ac61 Enhance bash shebangs 2021-08-17 12:22:47 +02:00
jo 8b3e09d41c Format shell scripts
Fix flags order
2021-08-17 12:22:46 +02:00
jo 8ce437828e Remove install apt-get dangerous options
Apt should fail fast (and report) instead of
forcing a broken installation.

The version check is also not required anymore as
most distribution now provide an apt version > 1.1.
2021-08-17 00:07:39 +02:00
jo 4033b20ee8 Rename apt requirements directory to apt
Previously ignored by the top level .gitignore, because
lib/ is a reserved directory name for python builds.
2021-08-15 14:16:55 +02:00
jo f00e912618 Fix installation failure on install -fap
When installing Icecast manually, we don't want the installer to interfere
with the icecast.xml config file by changing the passwords.

The script was failing trying to copy the Icecast password file it didn't create.
2021-08-11 17:21:02 +02:00
Kyle Robbertze d58fe19ae3
Merge pull request #1254 from paddatrapper/chore/remove-bionic
Drop Ubuntu Xenial support
2021-07-16 15:02:55 +02:00
Kyle Robbertze f5ca20ed3e install pycairo before PyGObject
Fixes: #1267
2021-07-15 10:27:23 +02:00
Kyle Robbertze f94e90a7f6 update documentation to remove bionic 2021-07-12 10:13:07 +02:00
Kyle Robbertze fa5db502ed Drop Ubuntu Xenial support
Fixes: #1226
2021-07-06 10:27:17 +02:00