Hello,

Today I came across this "Web application package guidelines" for Arch
Linux. What do you think about it ? Do you think it could be a good
guideline to follow when packaging a web application for Guix ?


For example, we could:

- Define the web app package that install the app code in
  "/usr/share/$app_name/", owned by root

- Define a system service type that only configure and run the webapp

- Define a full stack system service, that configure and run the webapp,
  the database, the reverse proxy and/or any other necessary components



The system service type will:

- Generate the config for the app and store it in "/etc/$app_name/"

- Define a Shepherd service that will run an instance of the web app,
  are named like the web app and can have optional other Shepherd
  services as dependencies

- Be extensible

- Use activation script to do first start actions, if necessary


This system service type can be made to run one or multiple instances of
the same app. In this case, in "/etc/$app_name/", a sub directory will
be created in it for each instance config. And the Shepherd service of
each instance will be named as "$app_name-$instance_name". But I don't
know if the multiple instances management should be inside the service type
logic or if a service type can have multiple instances of itself.


The Shepherd service will:

- Run the instance of the web app

- Use "/run/$app_name/" or "/run/$app_name/$instance_name/" as the
  runtime directory of the application

- Use "/var/cache/$app_name/" or "/var/cache/$app_name/$instance_name/"
  as the cache directory of the application

- Use "/var/lib/$app_name/" or "/var/lib/$app_name/$instance_name/" as
  the persistent storage of the application

- Set other Shepherd services dependencies, if defined in the web app
  service type instance configuration


The full stack system service will:

- Extend the web app service type to define an instance of it

- Extend the database service type to define an instance of it

- Same for each component needed to have a full stack deployment (app,
  database, reverse proxy, etc)

- Set the web app's Shepherd service dependencies as the database
  Shepherd service, the reverse proxy Shepherd service, etc



With this, in the `operating-system` structure, a system administrator
could choose between:

- Define each components herself or himself (the app, the database, the
  revers proxy, etc) and set manually the Shepherd services dependencies

- Or define only the full stack app service and configure only the minimum
  required. Letting the rest be automatically configured by the full
  stack service type.


The first solution is ideal when a sys admin already have an
infrastructure with a database, a reverse proxy, etc, of her or his
choice. Allowing a fine integration into the infrastructure. Or if the
sys admin want to fine tune each component parameters.

The second solution is ideal when a sys admin want to deploy the
application as simply as possible on a dedicated server.



What do you think ?


Best regards

-------
Gendre Sébastien




Attachment: signature.asc
Description: PGP signature

Reply via email to