-
-
Notifications
You must be signed in to change notification settings - Fork 3
Providers in services #9
Comments
What's the default importance ordering for providers?In depends#sql=( mysql postgresql ) mysql is used if both mysql and pgsql ate available? |
If both are provided, the file /etc/tt/conf/mywebapp.depends is needed to choose which one is used. The global system file |
Will |
Following the above example of
When, instead of adding a service, the database is updated and a provider has been added to the services, |
New proposal with virtualsAnother possibility would be to use providers and virtuals together. Example with a user audio setup: Virtual audio service
Pulseaudio service
Mpd service
This new proposal would require no additional syntax (as oppesed to the initial proposal). How does it work?When enabling mpd:
File settingsThe file
The file
The service setting has priority over the system setting. The latter has priority over automatic choice of providers. Multiple providers for one virtualOptionally, multiple providers can be chosen via both system and service setting. For example a web service would require multiple database to work. However, udev and mdev could not work together, so there should be an option |
The new proposal sounds better to me since we won't have to declare what services are providers of a certain functionality multiple times (for different services that need that functionality). |
Yea, that's better. Just modifying a virtual would add a new provider. One small change over the new proposal is to split dependencies and providers so that it would be simpler to implement (and easier to read too). |
While implementing providers I've found a few things to better define and I'd like to write them down here first:
My idea to fix the third point would be to have differente keys for every require:
Each key corresponds to a different mapping in the config file; a single key/value format will be applied to Regarding the second point, I haven't put much thought in it yet. |
Not quite sure if I understand the need for |
It would be important for service restarting. If a service has only postgres as sql provider, I don't want to restart it when mariadb goes down.
The user choose his own providers by writing to By using We could also use EDIT 1: While writing the implementation, I encountered another issue with
|
Some services need a feature that can be provided by one or more services but they only depend on one (otherwise optional dependencies would have sufficed).
Example
mysql.service
mywebapp.system:
When enabling mywebapp, tt will look for both mysql.system and postgresql.system files. In this case the service postgresql cannot be found so mywebapp will depend on mysql service.
Overriding default decision
The default decision can be overriden by creating a file /etc/tt/conf/mywebapp.depends (the exact name/location needs to be finalized) with the following contents:
This is also needed when both services are found on the system.
CLI
In addition, the following arguments will be added:
Use cases
Possibilities
Providers chosen for the system in a /etc/tt/depends file and overridden by myservice.depends files.
The text was updated successfully, but these errors were encountered: