Last modified: 2014-05-27 15:14:59 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T42025, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40025 - Some improvements for the deployment scripts
Some improvements for the deployment scripts
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Deployment systems (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
deploysprint-13
: platformeng
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-05 21:17 UTC by Krinkle
Modified: 2014-05-27 15:14 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2012-09-05 21:17:24 UTC
While documenting some of these scripts I noticed two things:

* Not all of them log a message to the SAL[1]
* They duplicate ddsh/rsync parameters and may not be consistent (at least it is not obvious why they wouldn't be the same).

Proposal:

1) Update these to use sync-common-file internally (just like sync-file and sync-dir already do). That way they automatically get the following (if they didn't have it already, and if they did, it will now be centralized):

  - various checks such as for SSH and ddsh
  - notify dologmsg
  - notify deploy2graphite

 * sync-dblist
 * sync-docroot
 * sync-wikiversions

2) Update sync-apache to include a notify dologmsg





[1] http://wikitech.wikimedia.org/view/Server_admin_log
Comment 1 Krinkle 2013-02-27 04:14:31 UTC
Also, sync-file and sync-dir are not in version control for some reason.

and sync-dir has various silly assumptions about file. For one, it tries to do php-l on it, which is pointless since the line above asserted it was a directory.

And then it uses sync-common-file, which should probably be renamed to sync-common-path since it does either files or directories.
Comment 2 Andre Klapper 2013-02-28 22:42:57 UTC
Several issues in one ticket... not good. Might be a ticket for a sprint (like Amsterdam), like one of platformeng and one of ops working on it together.

1) Adding to version control.
2) Update the scripts.
Comment 3 Ori Livneh 2013-03-27 06:21:43 UTC
Tim's changes in I9d315c4cb9 fix linting.
Comment 4 Krinkle 2013-03-27 15:14:56 UTC
(In reply to comment #3)
> Tim's changes in I9d315c4cb9 fix linting.

That would be Ic40757f3f04 instead.
Comment 5 Krinkle 2013-03-27 15:26:27 UTC
So, checklist then:

For each of the sync scrips, ensure:

[ ] In version control
[ ] Have checks for SSH_AUTH_SOCK and dsh etc.
    (probably best to centralise in a common function)
[ ] Have checks for existence of directory or file
[ ] Lint PHP
[ ] Have consistency in parameters to dsh,mwdeploy,rsync
    (perhaps centralise in a common function)
[ ] notify dologmsg
[ ] notify deploy2graphite

I'm assigning to myself. I'd like to do this clean up once Tim's scap-to-tin branch[1] is ready and merged.


[1] https://gerrit.wikimedia.org/r/#/q/project:operations/puppet+topic:scap-to-tin,n,z
Comment 6 Ori Livneh 2013-04-06 20:45:37 UTC
(In reply to comment #5)
> So, checklist then:
> 
> For each of the sync scrips, ensure:
> 
> [X] In version control

https://gerrit.wikimedia.org/r/#/c/57854/

> [ ] Have checks for SSH_AUTH_SOCK and dsh etc.
>     (probably best to centralise in a common function)
> [ ] Have checks for existence of directory or file
> [ ] Lint PHP
> [X] Have consistency in parameters to dsh,mwdeploy,rsync
>     (perhaps centralise in a common function)

https://gerrit.wikimedia.org/r/#/c/57890/

> [ ] notify dologmsg
> [ ] notify deploy2graphite
> 
> I'm assigning to myself. I'd like to do this clean up once Tim's scap-to-tin
> branch[1] is ready and merged.
> 
> 
> [1]
> https://gerrit.wikimedia.org/r/#/q/project:operations/puppet+topic:scap-to-
> tin,n,z
Comment 7 MZMcBride 2013-05-14 05:25:25 UTC
I think the checklist from comment 5 is pretty far along. If someone could reply to comment 5 with an updated list of what's been done, that'd be nice.
Comment 8 Greg Grossmeier 2013-05-15 17:36:30 UTC
Krinkle: Are you still actively working on this/think of it as your task to take? If not, go ahead an unassign yourself.
Comment 9 Andre Klapper 2013-06-03 15:45:31 UTC
Krinkle: Are you still actively working on this/think of it as your task to
take? If not, go ahead an unassign yourself.
Comment 10 Krinkle 2013-06-03 16:16:52 UTC
Go ahead :)
Comment 11 Krinkle 2013-06-03 17:39:54 UTC
(See also comment #5, comment #6)

For each of the sync scrips, ensure:

[OK] In version control
[  ] Checks SSH_AUTH_SOCK
[  ] Checks dsh
[  ] Checks existence of file or directory
[  ] Recursively lint php files
[  ] Have consistency in parameters to dsh and rsync
[  ] notify dologmsg
[  ] notify deploy2graphite

* scap, sync-common-file and sync-wikiversions check SSH_AUTH_SOCK
* scap-1skins, scap-2, sync-common-file, sync-dblist,
  sync-docroot and sync-wikiversions call rsync with parameters
* scap, sync-common-file, sync-dblist, sync-docroot and
  sync-wikiversions call dologmsg
* sync-dir and sync-file use sync-common-file internally


In I9d315c4cb937389fb8 Tim centralised a lot of information already (though not everything, it did make it a lot easier). That change introduced a similar pattern as Ori proposed in I702777b4ada8706b653, namely "/usr/local/lib/mw-deployment-vars.sh" which sets the variables.

Depending on how much variance is needed between all the various scripts, I think it should be possible to do all of the above in 1 common function that takes only a path as argument. Pretty much what sync-common-file is now (except that it is oddly named "-file", where in fact "sync-common-path" would be a better name).

Current state:
(
  scap,
  * loads vars
  * checks SSH_AUTH_SOCK
  * lint-php
  * !! does not check dsh
  * dsh -F30 -cM -o -oSetupTimeout=10
  * > sync-common > scap-1 > scap-2
    * rsync -a --delete --exclude=svn,git --no-perms
  * notifies dologmsg
  * notifies deploy2graphite

  scap-1skins
  scap-1
  scap-2
  * used by scap

  sync-common > scap-1

  sync-common-all > scap

  sync-common-file
  * loads vars
  * checks SSH_AUTH_SOCK
  * checks existence
  * checks dsh
  * !! does not lint-php, but callers (sync-dir, sync-file) do
  * notifies dologmsg, deploy2graphite
  * dsh -cM -o -oSetupTimeout=30 -F30
  * rsync -a --delete --exclude=svn,git --exclude=cache/l10n --no-perms
  * notifies dologmsg
  * notifies deploy2graphite

  sync-dblist
  * loads vars
  * !! does not check SSH_AUTH_SOCK
  * !! does not check dsh
  * dsh -cM -o -oSetupTimeout=30 -F30
  * rsync -a # doesn't pass --delete, --no-perms and --exclude
    # though --exclude does seem (harmlessly) redundant in this case
  * notifies dologmsg
  * !! does not notify deploy2graphite

  sync-docroot
  * loads vars
  * !! does not check SSH_AUTH_SOCK
  * !! does not check dsh
  * !! does not lint-php
  * dsh -cM -o -oSetupTimeout=30 -F30
  * rsync -a --no-perms  # doesn't pass --delete
  * notifies dologmsg
  * notifies deploy2graphite

  sync-dir
  * loads vars
  * checks existence
  * lint-php
  * > sync-common-file

  sync-file
  * loads vars
  * checks existence
  * lint-php
  * > sync-common-file

  sync-wikiversions
  * loads vars
  * checks SSH_AUTH_SOCK
  * checks dsh
  * dsh -cM -o -oSetupTimeout=30 -F30
  * rsync -l 
  * notifies dologmsg
  * notifies deploy2graphite
)
Comment 12 Gerrit Notification Bot 2013-07-04 06:20:17 UTC
Change 57890 merged by Tim Starling:
Set common rsync and dsh parameters in mw-deployment-vars

https://gerrit.wikimedia.org/r/57890
Comment 13 Greg Grossmeier 2014-05-02 21:00:23 UTC
I think this bug has aged a lot over the past 6 months.

The good: I think much of this has been done by Bryan in the migration of scap (and sub/helper commands) from php/shell to python.

The bad: It's overly time consuming for me at this point to go through each of these checklists and see what's still needed for scap(py).

The basic checklist I believe is complete though:
[  ] In version control
[  ] Checks SSH_AUTH_SOCK
[  ] Checks dsh
[  ] Checks existence of file or directory
[  ] Recursively lint php files
[  ] Have consistency in parameters to dsh and rsync
[  ] notify dologmsg
[  ] notify deploy2graphite

Bryan: Correct me if I'm wrong on those assertions.

Unless I hear a "you're wrong" I'll close this bug, but at this point I'd ideally prefer specific actionable bug reports for specific parts of scap/our deployment tooling instead of making ever more sub-checklists here.
Comment 14 Bryan Davis 2014-05-02 22:13:25 UTC
(In reply to Greg Grossmeier from comment #13)
> Unless I hear a "you're wrong" I'll close this bug, but at this point I'd
> ideally prefer specific actionable bug reports for specific parts of
> scap/our deployment tooling instead of making ever more sub-checklists here.

Today some of Krinkle's analysis is dated due to the scap port to python, but since the sync-* family is still unported some of it remains valid. I'm planning to work on sync-* soon. We should revisit this once that work is done. It should be easy to close then.
Comment 15 Bryan Davis 2014-05-27 15:14:59 UTC
I believe that this is resolved since the merge of I08ec8e987225b8e7fb1ae2119a4623383cba4db7. The only scripts left in the scap collection that have not been converted to python at this point are refreshCdbJsonFiles, restart-twemproxy and scap-recompile.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links