User:Kmenger/Tool Labs

TODO for improvingTool Labs documentation
Questions and initial notes, with some additional notes from July 15 meeting

- Would love to add a more detailed overview (features, rationale, basic architecture,open-source rule, etc) as an introduction, based on this really helpful presentation:http://www.mediawiki.org/wiki/File:Tool_Labs_presentation_(Hackaton_2013).pdf. High-level examples of tools and bots (e.g., edit counter/ edit bot) and where one encounters them was also very helpful to me.

[Add overview here: https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools]

- I don’t fully understand the difference between tools and toolsbeta. What types of development would go where? How do I choose which project to use? Are there different ways of accessing each? Are there things that should go on one, andnot the other? -The instructions for creating a key/requesting account are very helpful! I got confused when I tried to ssh in.
 * toolsbeta is for experiments in the tool labs environment itself; things like new systems entirely, or when you need experimental versions of system libraries that could affect other users. In general, every tool maintainer should work primarily on tools, only doing work on toolsbeta when changes to the tool labs need to be tested to support their tool.

-The instructions say 24 hours or less to process a Tool Labs account request. I waited about 24 hours before asking for help on IRC. -What are the rules for using bots? I wondered this and was/am worried about running mybot/changing anything. I would have appreciated some advice on this matter.
 * The delay is generally less than a day; but it does depend on admin availability (i.e.: either one of the ops taking care of labs or one of the project admins needs to handle it).

[MORE INFO:http://meta.wikimedia.org/wiki/Botand Wikipedia bot approval group for more info: http://en.wikipedia.org/wiki/Wikipedia:Bot_Approvals_Group ] -Add a 'Contact us' section with  irc/mailing list/bugzilla info. Any other points of contact?
 * The rules for running a bot on the Labs are fairly liberal (while still in draft, they sum up as "don't break anything"). The rules for running bots on projects are decided by the project themselves and are not part of the Labs rules (although we will certainly have a provision that you should abide the rules of every project you interact with).

-This info is in powerpoint slides, but not the guide, I believe, but it seems important to note: 'There are two bastionhosts: Ssh://tools-login.wmflabs.org Ssh://tools-dev.wmflabs.org This is whereusers log in and do their thing. They are functionally identical, but we request that heavy processing nottake place on –login (compiles, etc) to keepinteractive performance snappy.'

-Can you commit code to git via gerrit? If so, how? Magnus notes that WMF Labs does not offer aneasy-to-use code repository and offers other suggestions: https://wikitech.wikimedia.org/wiki/User:Magnus_Manske/Migrating_from_toolserver#GIT Is there a recommended way/set up? -Creating a new tool account. Seems there are two ways to do this: From Tool Labs Webpage> Create tool Or from https://wikitech.wikimedia.org/wiki/Special:NovaProject>add service group. Are there any differences between these? Can a new tool account only be created via the web interface? Also, adding/removing users to account. Also only through web ui? -Am thinking it would be helpful to add an “Accessing Tool Labs section” to consolidate the info about this (web, ssh, putty/winscp, sftp<—a user mentions that this worksand is currently undocumented)
 * WMF's gerrit repo works from the labs without difficulty, but tool maintainers have to ask for a project to be created for their tools (there is no provision to create them automatically)
 * They both point to the same place.

-The first thing I encountered/wondered about when I accessed my account was the replica.my.cnf file. I figured out what it is/how it is used from the database access section, but I also liked the idea of mentioning this information in the ‘creating a new tool account’ section as that is the first place I looked.

-Thinking that it might be nice to create a section along the lines of ‘Configuring a tool account’ with info about creating a tool description/webpage, mail, adding/removing users, maybe the pywikibot set up, etc. some of this info is in the doc, but it gets a little lost in sections dedicated to other topics.

-Russell Blau’s Using pywikibot on Labs doc is really helpful! https://wikitech.wikimedia.org/wiki/User:Russell_Blau/Using_pywikibot_on_Labs Are there other common tool set ups that could/should be documented?

-That said, re:Blau, although I was able to successfully set a path variable, create a sub-directoryin my home directory for bot-related files, add my user-config.pyfile, and runa test (step 1-4) I wasn’t able to run my simple test bot, which is (sans all paths): pythonpwb.py basic-dry User:KBot500

I tried several ways (e.g., with fully qualified path to pwb.py (e.g.,/shared/pywikipedia/rewrite/pwb.py), full paths to both pwb and basic. I experimented with the symbolic link as well. I managed to run the bot from my local machine, with the user-config.py I added to Tool Labs.

-I haven’t yet been able to test out the grid access. Are there some bots/tools that I can practice with/look at? If so, what’s the best way to get these? A shared ‘Examples’ Tools account or something along those lines? Something else? I'd love to see examples of bots that one would run continuously, and tools that create/access databases in different ways. **** This is as far as I’ve gotten in using tool labs. More as it comes!
 * UPDATE: From IRC, YuviPanda and logoktm recommend setting up virtualenv and installing pwb to that.

My trouble running pywikibot on Tool Labs
UPDATE: From IRC, YuviPanda and logoktm recommend setting up virtualenv and installing pwb to that.

Steps followed and subsequent error:

1.     I followed Blau’s guide to setting up pywikibot on Labs: https://wikitech.wikimedia.org/wiki/User:Russell_Blau/Using_pywikibot_on_Labs. I used a user-config.py that works on my system and successfully ran:

local-kirstentest@tools-login:~/.pywikibot$python /shared/pywikipedia/rewrite/scripts/version.py

2.     I tried to run my bot, which I ran locally with no trouble as:  python  pwb.py basic -dry User:KBot500. To run it in Labs, I put in full paths:

local-kirstentest@tools-login:~/.pywikibot$python /shared/pywikipedia/rewrite/pwb.py /shared/pywikipedia/rewrite/scripts/basic -dry User:KBot500

I got the following error: Traceback (most recent call last):  File"/shared/pywikipedia/rewrite/pwb.py", line 35, in    execfile('generate_user_files.py')IOError: [Errno 2] No such file or directory:'generate_user_files.py'

Feedback on bots installing/configuring, and running pywikibot:
-the python on my mac laptop (approx.. three years old) was too old for pywikibot. Not just pc that might need to download python!

-the magic keywords in the presentation are incomplete. I found the full set in an older version of the presentation:http://upload.wikimedia.org/wikipedia/mediawiki/archive/9/9b/20130526081606%21Bots_hackathon_2013.pdf