Page MenuHomePhabricator

Improve dry-run behavior of wmcs.wikireplicas.add_wiki cookbook
Closed, ResolvedPublic

Description

I understand right now, it kind of fails when it dry-runs and isn't useful. This should provide a detailed list of things it would do. Please add this.

Event Timeline

Bstorm triaged this task as Low priority.Oct 22 2020, 5:51 PM
Bstorm created this task.

Change 639320 had a related patch set uploaded (by Bstorm; owner: Bstorm):
[operations/cookbooks@master] wmcs wikireplicas: add a dry_run option

https://gerrit.wikimedia.org/r/639320

Bstorm added a comment.Nov 5 2020, 9:52 PM

So actually, dry_run works fine. It's an argument to the cookbook CLI, not to the cookbook itself:

[bstorm@cumin1001]:~ $ sudo cookbook wmcs.wikireplicas.add_wiki --dry-run  --task-id T260551 thankyouwiki
usage: cookbooks.wmcs.wikireplicas.add_wiki [-h] --task-id TASK_ID
                                            <database_name>
cookbooks.wmcs.wikireplicas.add_wiki: error: unrecognized arguments: --dry-run
[bstorm@cumin1001]:~ $ sudo cookbook --dry-run wmcs.wikireplicas.add_wiki  --task-id T260551 thankyouwiki
DRY-RUN: Executing cookbook wmcs.wikireplicas.add_wiki with args: ['--task-id', 'T260551', 'thankyouwiki']
DRY-RUN: START - Cookbook wmcs.wikireplicas.add_wiki
DRY-RUN: Generating views...
DRY-RUN: Executing commands ['/usr/local/sbin/maintain-replica-indexes --database thankyouwiki', '/usr/local/sbin/maintain-views --databases thankyouwiki'] on 4 hosts: labsdb[1009-1012].eqiad.wmnet
DRY-RUN: Adding DNS
DRY-RUN: Executing commands ['source /root/novaenv.sh; wmcs-wikireplica-dns --aliases'] on 1 hosts: cloudcontrol1003.wikimedia.org
DRY-RUN: Finalizing meta_p
DRY-RUN: Executing commands ['/usr/local/sbin/maintain-meta_p --databases thankyouwiki'] on 4 hosts: labsdb[1009-1012].eqiad.wmnet
DRY-RUN: Added views for new wiki: thankyouwiki T260551
DRY-RUN: END (PASS) - Cookbook wmcs.wikireplicas.add_wiki (exit_code=0)

Change 639320 merged by jenkins-bot:
[operations/cookbooks@master] wmcs wikireplicas: Fix the logger

https://gerrit.wikimedia.org/r/639320

Bstorm closed this task as Resolved.Nov 5 2020, 10:03 PM

Updated the documentation to reflect the correct use of dry runs or this.
https://wikitech.wikimedia.org/w/index.php?title=Add_a_wiki&diff=1887502&oldid=1885863