Deployment tooling/Notes/What does scap do

Scap ("sync-common-all-php") is a collection of shell scripts used to publish code and configuration to the WMF production web servers.

scap
scap is the driver script for syncing the MW versions and configuration files currently staged on tin.equiad.wmnet to the rest of the MW servers in the production cluster.


 * Usage
 * scap [--versions= ] [ ]


 * 1) Acquire lock on
 * 2) Record start timestamp
 * 3) Ensure that   is available (needed for   to remote hosts)
 * 4) Check for command line flag to limit activities to a particular MW version
 * 5) Export   variable describing software versions to push with sync scripts. Either:
 * 6) * A specific version given with the  command line argument (eg 1.23wmf12)
 * 7) * The output of
 * 8) Lint files in $MW_COMMON_SOURCE/wmf-config and $MW_COMMON_SOURCE/multiversion
 * 9) Runs
 * 10) Runs
 * 11) Runs   to announce that scap is starting
 * 12) Runs   via   on scap-proxies group
 * 13) Randomizes list of hosts to update (All hosts listed in  )
 * 14) Runs   via
 * 15) Runs   via
 * 16) Runs
 * 17) Computes total runtime
 * 18) Runs   to log runtime
 * 19) Runs   to log scap run completion
 * 20) Deletes temp files
 * 21) Releases lock on

sync-common
sync-common is really just an alias for scap-1 in shell script form.


 * 1) Runs

scap-1

 * 1) Sources
 * 2) If   directory is not found:
 * 3) * Creates  via
 * 4) If   directory is not found:
 * 5) * Creates  via
 * 6) Initialize   variable to first command line argument (could be empty string)
 * 7) Initialize   as an empty variable
 * 8) If   is not an empty string:
 * 9) * Set  via
 * 10) If   is still empty:
 * 11) * Set  to
 * 12) Run   as the user
 * 13) *  invocation
 * 14) Echo "Done"
 * 15) Exit 0

find-nearest-rsync
find-nearest-rsync is a perl script that attempts to determine the host with the lowest ICMP ping round trip time (rtt) from a given list of hosts.


 * Usage
 * find-nearest-rsync [--verbose] [ ...]

The host with the lowest rtt will be printed to stdout.

scap-2
scap-2 pulls files from another server via rsync


 * Usage
 * scap-2 [ ]


 * 1) Sources
 * 2) Initialize   as
 * 3) If   is still empty:
 * 4) * Set  to
 * 5) Initialize   as an array containing
 * 6) If   is not an empty string:
 * 7) * Add  to   for each $v in
 * 8) * Add  to
 * 9) Echo that   is copying from
 * 10) Run

mwversionsinuse
mwversionsinuse is a shell script to call the local version of multiversion/activeMWVersions


 * 1) Sources
 * 2) Runs