You are browsing a read-only backup copy of Wikitech. The primary site can be found at wikitech.wikimedia.org

User:SRodlund/Tool accounts (staging)

From Wikitech-static
< User:SRodlund
Revision as of 22:10, 16 May 2019 by imported>SRodlund (→‎What is a Tool Account?)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The title of this page will change when it is moved to main. It will cover some content on the current Toolforge:Help page. This page is a very rough draft. It contains a lot of disorganized information. See Toolforge:Help for current and definitive information.

Stories

  • I am a new developer and/or new to the Wikimedia ecosystem, and I want to understand what is possible to do with Toolforge
  • I am a new developer and/or new to the Wikimedia ecosystem, and I want to understand what Toolforge is and how to use it to create a tool
  • I am an experienced developer, and I want to onboard experienced developers who are working on or with Toolforge
  • I am an experienced developer, and I want to share information about how to perform a task or complete a process with a less experienced developer
  • I am an experienced developer, and I want to find information about how Toolforge works

Overview

If you want to create a tool or collaborate with others to create and maintain tools, you'll need to create a Tool Account. This page will help you understand what a Tool Account is and the basics of using it.

Visit Portal:Toolforge to learn more about Toolforge and to explore more how-tos, tutorials, and developer stories.

Definitions

  • Tool Account (Group Account)
  • maintainer (member of a tool account)
  • Toolforge
  • tool
  • user
  • Toolsadmin
  • Tool Webpage

What is a Tool Account?

The Tool Account is a group account which can have one or more maintainers at a time. You'll create a separate Tool Account for each new tool you develop on Toolforge, and you'll join an existing Tool Account when you're invited to work on or maintain the tool.

Each Tool Account includes:

  • A home directory on shared storage: /data/project/<TOOL NAME>
  • The ability to run a web service which is visible at https://tools.wmflabs.org/<TOOL NAME>/
  • Database access credentials: $HOME/replica.my.cnf, which provide access to the production database replicas as well as to project-local databases.
  • Access to the continuous and task queues of the compute grid
  • Credentials and a namespace for running containers on the Kubernetes cluster

Roles

Role of the Tool Account

The Tool Account is a group account which can have one or more maintainers at a time. The Tool Account exists independently of its maintainers, which makes it easy for individuals of the group to come and go.

Maintainers

People who have access to a Tool Account are called maintainers Maintainers have access to tool account's code and data. Maintainers can:

  • create Tool Accounts/tools
  • join existing Tool Accounts/tools
  • leave Tool Accounts/tools in the care of others
  • sudo to the Tool Account/tools

Join an existing Tool Account

All tool accounts hosted in Toolforge are listed on the tools list. If you would like to be added to an existing account, you must contact the maintainer(s) directly.

If you would like to add (or remove) maintainers to a tool account that you manage, you may do so with the 'manage maintainers' link found beneath the tool name on the Toolforge home page.

  • Include screenshot

Create tools with Tool Accounts

Screenshot about creating a new tool..png

Members of the ‘tools’ project can create tool accounts using toolsadmin:

  1. Go to https://toolsadmin.wikimedia.org/tools/.
  2. Click the "Create new tool" link at the bottom of the "Your tools" sidebar (if you don't see this and you were recently added to the 'tools' project, try to logoff and login again)
  3. Follow the instructions in the tool account creation form.
    • The new tool will need a unique name. The name will become part of the URL for the final webservice, so choose wisely!

Do not prefix your tool name with tools.. The system will do so automatically where appropriate, and there is a known issue that will cause the account to be created improperly if you do.

Note: If you have only recently been added to the 'tools' project, you may get an error about not being a member. Simply log out and back in to toolsadmin to fix this.

The Tool account will be created and you will be granted access to it within a minute or two. If you were already logged in to a Toolforge bastion through SSH, you will have to log off then back in before you can access the new tool account.

Using a Tool account

A simple way for maintainers to switch to the tool account is with become:

maintainer@tools-login:~$ become <TOOL NAME>
tools.toolname@tools-login:~$

Customize a Tool account

Once you have created a tool account, there are a few things that you can customize to make the tool more easily understood and used by other users. These include:

  • Adding a tool account description (the description will appear on the Tools home page beside the tool name)
  • Creating a web page for your tool (it will be linked from the Tools home page automatically)

Create a Tool web page

To create a web page for your tool account, simply place an index.html file in the tool account's ~/public_html/ directory. The page can be a simple description of the tool or bot with basic information on how to set it up or shut it down, or it contain an interface for the web service. To see examples of existing tool web pages, click any of the linked tool names on the Tools list.

Note that some files, such as PHP files, will give a 500 error unless the owner of the file is tool account.

You will also need to start a webservice for your tool.

1. Log into the Tool environment and become your tool account:

maintainer@tools-login:~$ become toolname

2. Start the web service:

tools.toolname@tools-login:~$ webservice start

Creating a Tool description

To create a tool description:

1. Log into a Toolforge bastion using your Wikimedia developer account and become your tool account:

$ ssh tools-login.wmflabs.org
maintainer@tools-login:~$ become toolname

2. Create a .description file in the tool account’s home directory. Note that this file must be HTML:

tools.toolname@tools-login:~$ vim .description

3. Add a brief description (no more than 25 words or so) and save the file. You can use basic HTML markup in the file.

4. Navigate to the Tools list. Your tool account description should now appear beside your tool account name.

Configuring Tools

Tools and bot code should be stored in your tools account, where it can be managed by multiple users and accessed by all execution hosts. Specific information about configuring web services and bots, along with information about licensing, package installation, and shared code storage, is available at the § Developing on Toolforge section.

Note that bots and tools should be run via the grid, which finds a suitable host with sufficient resources to run each. Simple, one-off jobs can be submitted to the grid easily with the jsub command. Continuous jobs, such as bots, can be submitted with jstart.

Troubleshoot your new Tool Account

$ become <TOOL NAME>
become: no such tool '<TOOL NAME>'
  • Make sure you have typed your new tool name correctly.
  • It may take a few minutes for your tool's home directory and files to be created. Wait a few minutes, and try again.
$ become <TOOL NAME>
You are not a member of the group tools.<TOOL NAME>.
Any existing member of the tool's group can add you to that.
  • An active ssh session to login.tools.wmflabs.org will not automatically be updated with new permissions when you are added as a maintainer of a tool. If you are already logged in via ssh when you create the new tool, log out and then log in again to activate your new permissions.

Rename a Tool Account

Tools can't be renamed. However, you can work around this by creating a new tool with a new name and copying the code over from the old tool.

Delete a Tool Account

You can't delete a tool account yourself, though you can delete the content of your directories and make an existing web tool inaccessible by shutting down the web service (webservice stop). If you really want a tool account to be deleted, please file a task in Phabricator requesting that the tool be deleted eventually.

Communication and support

Support and administration of the WMCS resources is provided by the Wikimedia Foundation Cloud Services team and Wikimedia movement volunteers. Please reach out with questions and join the conversation:

Discuss and receive general support
Receive mail announcements about critical changes
Subscribe to the cloud-announce@ mailing list (all messages are also mirrored to the cloud@ list)
Track work tasks and report bugs
Use the Phabricator workboard #Cloud-Services for bug reports and feature requests about the Cloud VPS infrastructure itself
Learn about major near-term plans
Read the News wiki page
Read news and stories about Wikimedia Cloud Services
Read the Cloud Services Blog (for the broader Wikimedia movement, see the Wikimedia Technical Blog)