Commit graph

3820 commits

Author SHA1 Message Date
429658e7c8
Refactored PackageManager classes.
Instead of having a custom `get_installed` callable field, with
replicated code for each package manager, the field has now been
promoted to a class method containing the common logic, and the
instances now expect a `list` field (base command to list the installed
packages using the specified package manager) and a `parse_list_line`
callback field (to extract the base package name given a raw line from
the command above).

Also, we shouldn't run the list command if we're running within a Docker
context - the host and container environments will be different.
2023-08-28 01:26:19 +02:00
86e5f74645
platyvenv should generate (and document) a run.sh helper script. 2023-08-27 23:20:03 +02:00
9e6430a9ac Clone git repo if platyvenv is not running from a srcdir 2023-08-23 20:02:04 +02:00
dafd65dc21
Added new platyvenv Python script. 2023-08-23 11:55:25 +02:00
f230fa79bb
to_pkg_install_commands should skip already installed sys packages. 2023-08-23 11:51:53 +02:00
449821673c
Added PackageManager.get_installed. 2023-08-23 10:50:29 +02:00
b10ccdb313
Added get_src_root utility function. 2023-08-23 02:53:31 +02:00
1ef0d804db
Added full_command argument to to_pip_install_commands.
This is useful if we just want to get the list of pip dependencies and
create our own pip command.
2023-08-23 02:19:54 +02:00
2bff4c9cf1
Exclude python-* system packages when installing in a venv. 2023-08-23 02:17:19 +02:00
cddf318fa7
Dependencies.from_config should include the base system deps. 2023-08-23 02:16:33 +02:00
8f39231d31
Added new utility methods to the Dependencies class. 2023-08-23 02:15:50 +02:00
782ddf5097
Removed legacy platyvenv bash script.
The script is being migrated to a Python implementation.
2023-08-23 02:08:51 +02:00
ce68250b4d
Refactor/documentation round for platydock. 2023-08-22 02:49:05 +02:00
10c0e5fcad
Added default_os field to PackageManagers enum elements.
This is useful to determine which is the default set of scripts that
should be used by the installer depending on the detected installed
package manager.
2023-08-20 21:21:37 +02:00
2c46b6fe14
Added git a required manifest dependency when needed.
It is needed for packages that install pip packages via git.
2023-08-20 21:19:15 +02:00
a28dcb7a8d
Remove /var/cache/apk from container image after installation. 2023-08-20 14:19:04 +02:00
a6752ed034
Fixed wrong event path in a manifest file. 2023-08-20 14:08:22 +02:00
700b8e1d16
Added header and footer to generated Dockerfile. 2023-08-20 14:05:22 +02:00
f66c4aa071
Ignore the Dockerfile in the root folder 2023-08-20 13:48:55 +02:00
a6f8021150
PackageManager has both install and uninstall. 2023-08-20 13:33:49 +02:00
5efcae64c1
Better Dockerfile logic to retrieve sources.
If the /install folder on the container doesn't contain a copy of the
source files, then the git repository will be cloned under that folder.

The user can specify via `-r/--ref` option which tag/branch/commit they
want to install.
2023-08-20 13:31:13 +02:00
28ba042810
If no configuration file is passed to platydock generate a minimal Dockerfile. 2023-08-20 03:36:34 +02:00
199ac5f0f7
New way of managing installation scripts and dependencies.
Created `platypush/install` folder that contains:

- Dockerfiles for the supported distros
- Lists of required base dependencies for the supported distros
- Install and run scripts
- Added Debian to supported base images
2023-08-20 02:28:10 +02:00
71c5291190
Refactored the interface of Platydock and manifest utils. 2023-08-19 22:46:37 +02:00
a99ffea37c
Fixed apt dependencies for mpd plugin. 2023-08-19 21:46:08 +02:00
7889b2f1db
Updated generate_missing_docs to use the new manifest API. 2023-08-19 13:49:31 +02:00
980af16984
Rewritten platydock utility.
Platydock now will only print out a Dockerfile given a configuration
file.

No more maintaining the state of containers, storing separate workdirs
and configuration directories etc. - that introduced way too much
overhead over Docker.
2023-08-19 13:47:43 +02:00
9002f3034a
Tweaked package managers install command arguments. 2023-08-19 13:46:08 +02:00
69706eaabe
s/logger/_logger/ in the plugins module.
The `logger` name may clash with the context of an action, where
`logger` may have been set to something else.
2023-08-19 13:32:19 +02:00
1cb686bdab
Updated the inspect plugin to the new manifest utils interface. 2023-08-19 13:31:48 +02:00
043f303761
s/HttpBackend._DEFAULT_HTTP_PORT/HttpBackend.DEFAULT_HTTP_PORT/g 2023-08-19 13:30:51 +02:00
dd3a701a2e
Full rewrite of platypush.utils.manifest.
The new version encapsulates all the utility functions into three
classes - `Manifest`, `Manifests` and `Dependencies`.
2023-08-19 13:28:40 +02:00
a8255f3621
Pass the configuration file used by the application to the Alembic process.
The database settings could also be overridden in the configuration file
besides the command line.

We should therefore pass the path to the runtime configuration file, so
the Alembic process can initialize its configuration from the same file
and use the same settings.
2023-08-19 13:23:20 +02:00
1825b492b3
Replaced Config.workdir with Config.get_workdir().
Again, Python < 3.9 doesn't like class properties.
2023-08-19 13:21:24 +02:00
a8836f95f5
Support explicit workdir parameter override in Config constructor. 2023-08-19 13:15:29 +02:00
5bc82dfe64
s/Config._cfgfile/Config.config_file/g 2023-08-19 13:13:36 +02:00
181da63c89
Pass the database engine to the Alembic process as an extra argument.
If the path of the default database engine is overridden via `--workdir`
option then it won't be visible to the new `python` subprocess spawned
for Alembic.
2023-08-19 13:02:05 +02:00
c2b3ec8ce3
Fixed manifest files with outdated formats. 2023-08-19 12:54:33 +02:00
e463a52435
Use sys.executable rather than 'python' to launch the application. 2023-08-19 12:40:57 +02:00
0a5fc40dc5
Merge branch 'master' into 276/better-docker 2023-08-18 17:34:56 +02:00
3236e235ef Merge pull request '278/fix-variable-errors-on-python-3-8' (#279) from 278/fix-variable-errors-on-python-3-8 into master
Reviewed-on: platypush/platypush#279
2023-08-18 17:25:08 +02:00
2cab836bdf
Entity.columns class property replaced by Entity.get_columns method.
Again, Python < 3.9 doesn't like the combination of `@property` +
`@classmethod`.
2023-08-18 17:20:53 +02:00
a9cdff900e
_variable should be an external global function rather than a class property.
The combination of `@property` + `@classmethod` isn't supported on
Python < 3.9.
2023-08-18 16:16:47 +02:00
d0c89f88a8
Fixed parenthesised multi-with statement.
This syntax is not supported on Python < 3.9, and therefore it should be
broken down as a multi-line statement.
2023-08-18 16:10:31 +02:00
ca95490412
Added timeout parameter to requests.get in the rss plugin. 2023-08-18 15:53:30 +02:00
5dd7345c0b
Sync the latest parse timestamps in main instead of __init__ in rss.
We should load the latest timestamps from the db when the thread starts
instead of doing it in the constructor.

The constructor may be invoked when the entities engine hasn't been
initialized yet, and result in deadlocks.
2023-08-18 15:51:11 +02:00
ec64b0ef8b
Added --device_id command line option. 2023-08-17 23:16:24 +02:00
ac83b43f98
Support for custom key-value overrides on Config.init. 2023-08-17 22:03:39 +02:00
657b2cc87d
Create the default configuration file even if --config is supplied but the file doesn't exist. 2023-08-17 11:25:49 +02:00
afa4de5673
Dockerfile moved to application root 2023-08-17 10:38:21 +02:00