Chapter 4 Setting up Billing on AnVIL

The following will help you set up billing for your class. You will:
* Set up a billing project for tracking costs * Add yourself and students to the billing project to grant permission to AnVIL resources * Learn about different sources of costs in AnVIL * Estimate costs for your class * Learn about how to track costs during your class

4.1 Creating a billing project

First, create the Billing Project. Billing Project names must be globally unique and cannot exceed 30 characters. We suggest the name of the Billing Project should be a combination of institution-class- (e.g., “jhu-bmr2021-bill-1”). To create a Billing Project:

  1. Go to https://anvil.terra.bio/#billing

  2. Click “+CREATE”

    Screenshot of the Terra Billing page. The "+CREATE" button is highlighted.

  3. Type in your Billing Project name

    Screenshot of the Terra Billing page with Create Billing Project pop out box. The new billing project name, jhu-bmr2021-instructors-bill-1, is highlighted.

  4. Select the appropriate Billing Account

    Screenshot of the Terra Billing page with Create Billing Project pop out box. The appropriate billing account name, My Billing Account, is highlighted.

  5. Click “CREATE BILLING PROJECT”

    Screenshot of the Terra Billing page with Create Billing Project pop out box. The "CREATE BILLING PROJECT" button is highlighted.

You now have a unique Billing Project.

4.2 Adding Instructors as “Owner”

Next, you want to give instructors permission to use the Billing Project to compute. To set instructor permissions:

  1. Go to https://anvil.terra.bio/#billing

  2. Select the “Owned by You” Billing Project sub-list

    Screenshot of the AnVIL Billing page. The "Owned by You" billing list is highlighted.

  3. Select the Billing Project you made in Instructor Billing Project

    Screenshot of the AnVIL Billing page. The "Owned by You" billing list has been expanded. The instructor Billing project, in this case jhu-bmr2021-instructors, is highlighted.

  4. Select the “Users” tab

    Screenshot of the AnVIL Billing page. The instructor Billing project, in this case jhu-bmr2021-instructors, has been selected and the Users Tab is highlighted.

  5. Click “+ Add User”. You will be prompted to add a “User email *”.

    Screenshot of the AnVIL Billing page. The instructor Billing project, in this case jhu-bmr2021-instructors, has been selected and the "+Add User" button is highlighted.

  6. Begin typing the instructor Group name set up in Instructor Group. You should see an email in the form (firecloud.org?) (e.g., ).

  7. Ensure “Can manage users (Owner)” is selected

    Screenshot of the AnVIL Billing page with the "Add User" pop out box. The instructor Group email, in this case jhu-bmr2021-instructors@firecloud.org, has been filled in and the Owner role checkbox has been ticked.

  8. Click “ADD USER”

    Screenshot of the AnVIL Billing page with the "Add User" pop out box. The instructor Group email, in this case jhu-bmr2021-instructors@firecloud.org, has been filled in and the Owner role checkbox has been ticked. The "ADD USER" button is highlighted.

This step makes it so that co-instructors can edit permissions and administer the Billing Project as needed. While this means you and co-instructors can compute using the student Billing Project, this makes spending difficult to track. Instructors should always use the instructor Workspace to compute. This makes it much easier to track costs associated with instructors versus students.

4.3 Adding Students as “User”

Next, you will add your student Group to the Billing Project so that they can compute. To set student permissions:

  1. Go to https://anvil.terra.bio/#billing

  2. Select the “Owned by You” Billing Project sub-list

    Screenshot of the AnVIL Billing page. The "Owned by You" billing list is highlighted.

  3. Select the Billing Project you made in Billing Project

    Screenshot of the AnVIL Billing page. The "Owned by You" billing list has been expanded. The student Billing project, in this case jhu-bmr2021-students, is highlighted.

  4. Select the “Users” tab

    Screenshot of the AnVIL Billing page. The student Billing project, in this case jhu-bmr2021-students, has been selected and the Users Tab is highlighted.

  5. Click “+ Add User”. You will be prompted to add a “User email *”.

    Screenshot of the AnVIL Billing page. The student Billing project, in this case jhu-bmr2021-students, has been selected and the "+Add User" button is highlighted.

  6. Begin typing the student Group name set up in Student Group. You should see an email in the form (firecloud.org?) (e.g., ).

  7. Keep “Can manage users (Owner)” deselected.

    Screenshot of the AnVIL Billing page with the "Add User" pop out box. The student Group email, in this case jhu-bmr2021-students@firecloud.org, has been filled in and the Owner role checkbox has NOT been ticked.

  8. Click “ADD USER”

    Screenshot of the AnVIL Billing page with the "Add User" pop out box. The student Group email, in this case jhu-bmr2021-students@firecloud.org, has been filled in and the Owner role checkbox has NOT been ticked. The "ADD USER" button is highlighted.

4.4 Understanding the various billing costs

Costs in AnVIL fall into one of three categories: compute costs, storage costs, and network usage (egress) costs. Compute costs are those that students accrue when actively using an AnVIL Workspace. Students can clone a Workspace for no cost, but they will begin to accrue costs as soon as they set up a cloud environment. Compute costs are based on how many CPUs you need, as well as how much memory and storage space you choose. You can also pause the Workspace and pay a lower cost per hour than if you were to keep the Workspace running. Current prices can be found here.

Storage costs are driven by the persistent disk. The persistent disk allows you to store data and installed programs/libraries for a low cost. Students can delete their Workspaces but maintain their persistent disk so they still have access to previous programs they have installed and previous files they’ve created. Current prices can be found here.

Finally, network usage costs are those involved with transferring data between networks or downloading data from the cloud to your local computer. Current prices can be found here.

4.5 Estimating costs before the class begins

AnVIL has a free AnVIL_Cost_Estimator that allows you estimate compute, storage, and network usage costs for your class. This is a Google sheet that you can tailor to fit your needs. Before you use it, make sure the prices are up to date by following the links at the bottom of the sheet.

If you need to create a Budget Justification for your class, you can also use the free AnVIL_Budget_Justification template.

4.6 How much does a class cost?

One of the advantages of billing projects in Terra is that you can keep track of the costs during real time. You can see how much each Workspace is costing while your course is happening, so there are no unexpected surprises at the end!

Full details about billing in Terra can be found here. These instructions are adapted from Terra Support.

To view the costs being accrued by each billing project, you can go to https://console.cloud.google.com/billing. At the top of the page, there is a dropdown menu. Choose the billing project name you’d like to view.

Locating dropdown menu

Once you are in proper billing project, you click on “View detailed charges” in the Billing section on the far right.

Locating detailed charges

This takes you to a report of the detailed charges accrued by the billing account. Here, you will be able to see the total cost over a time range, as well as costs broken down by services.

Locating dropdown menu