Web-based interface (w/command-line tools) for managing:
- Application server configuration.
- SSH keys, etc.
- Application installation.
- Drop a
.zip
(or.egg
, more on this below) into a folder. - Upload the same via web interface.
- Enter the URL of a SCM system for checkout and deployment.
- Several deployment strategies:
always-latest
one-branch
latest-tag
- Several deployment strategies:
- Drop a
- Application configuration.
- The application provides a configuration spec via INI or YAML.
- Mustn’t be Python code within the application; it might not be installed yet!
- A library of standard widgets and validation schemes must be provided.
- Additional validation via regular expressions.
- The Application Server then allows editing, validation, and saving of an INI or YAML on-disk configuration for the application.
- The application provides a configuration spec via INI or YAML.
- Application “mounting” within: (i.e. virtual server management w/ path-based mounting)
- Nginx
- Apache
- Lighttpd
- Includes several common “light-weight” applications out-of-the-box:
- Simple serving of static files.
- XML-RPC or JSON application server API. (To make the API public; available from localhost by default.)
- This type of API is how the web interface and command-line interfaces actually get work done.
- Install-via-SSH “slave” application servers.
- Post-commit hook service for updating applications.
- Database-backed logging handler for trapping of all application’s log events.
- Log viewer, search, and notification system.
- MongoDB capped collections are perfect for this.
- Applications are “extracted” into a pseudo-virtualenv for the application.
- Dependencies may be shared between applications or may be application-specific.
- Site packages are ignored, but the Python path includes a “shared” (
server-packages
) location and the application’ssite-packages
folder.
- The application may request (via a spec file) writeable directories. Examples include:
- Sessions
- Caches
- Lock Files
- The daemon serving each application is provided:
- The method of management: threading, multi-process, etc.
- A path to save the PID to.
- A path to save on-disk sockets to, or, a range of assigned port numbers.
A .pyapp
file is a zip file containing:
metadata.yaml
- Application metadata, generated from
setup.py
and/orsetup.ini
. - Better defines dependencies as
shared
orlocal
. - Requests resources such as writeable paths, database connections, etc.
- Defines paths to static resources.
- Defines the root WSGI application or WSGI application factory callable.
- Update policies.
- Post-install, pre/post-update, and pre-delete hooks.
- Recurrent tasks executed from within the context of the application.
- Application metadata, generated from
configuration.yaml
- Runtime application configuration specification.
src/
- Extracted and installed using
setup.py install
.
- Extracted and installed using
deps/
- Like
pip bundle
, copies of the dependencies that are version-sensitive or for cases where you want offline installation. - One subfolder per dependency, installed via the application’s
setup.py install
to allow for C extensions and such.
- Like
- Applications have defined for them by the Application Server several environment variables:
PYAPP_CONFIG_FILE
— The filled-in YAML configuration.PYAPP_TMP_PATH
— A directory it is safe to create temporary files within.
- Applications are chrooted to their installation directory (pseudo-venv) and run as the application server.
- Applications are accessed directly by the underlying web server, not proxied through the management application.
The underlying server (
Paste
,Flup
,marrow.server.*
, etc.) doesn't matter as they all speak WSGI in the end.