meetings / pollbal

Perlbal pool tool
MIT License
0 stars 0 forks source link

Provide scripts for backend pool controlling #7

Open amv opened 11 years ago

amv commented 11 years ago

We can provide a set of general scripts which do the most common operations needed for writing a backend state in to a file and handling it.

We can provide scripts for at least the following:

1) Write service name and version to the pool file in serving state 2) Write service name and version to the pool file in leaving state 3) Clear the pool file by force 4) Write out the current content of the pool file (or empty string) 5) Touch the update lock file in a default location 6) Take service out of pool controllably as described in issue #5

We should provide sane default for the locations of the pool files and update lock files.

We should allow the system to control service name and version (and also locations of files, timeouts etc) by placing the data in to predefined files, defining environment variables or providing them as command line parameters.

Ideally the backend developer could just check out our utils repo, put service name in to a standard file, put service version to a standard file, hook "GET /pool" to "sh script_4", "POST /pool_waring" to "sh script_5" and call script_6 before any update and script_1 on init and after update.

These scripts should probably have their own public git repo. pollbal_utils might be apt. Installation using NPM could be cool but I think the implementation should not depend on anything other than a sane unix environment and "bash".

amv commented 11 years ago

Actually if the version file is missing (and not configured by other means), we can probably assume the service is not versioned and omit it (pollbal does not need versions).

Also if the service name file is missing (and not configured by other means), we can probably use the following as a sane default:

hostname | sed 's/[_-]*[0-9][0-9]*$//'

this would make using the scripts even easier for the backend developer