HTRC Data Capsule Tutorials

HTRC Data Capsule Tutorials

View step-by-step tutorials for common Data Capsule functions.

 

Once you have your Capsule running, you may find it useful to open this guide in an internet browser in your Capsule so you can copy and paste commands. The short link for this page is: https://wiki.htrc.illinois.edu/x/TQFRAQ.

Overview of Generic Research Workflow in a Capsule

  1. Register and sign in to your HTRC account. 

  2. Create and start a Capsule in the HTRC.

  3. View your Capsule using the Remote Desktop view/Terminal view, or SSH into your Capsule in Maintenance mode.

  4. Configure the software environment of the Capsule as needed. Download the scripts or programs you plan to use in your analysis.

  5. Switch Capsule to Secure mode through HTRC.

  6. Run your analysis against the secure HTRC corpus repository.

  7. Move your results to the secure volume storage on the Capsule.

  8. Switch Capsule back to Maintenance mode to regain normal network access.

Step-by-Step Instructions

Note: You will need to create an HTRC account if you don't already have one. 

From the Analytics homepage, create a Capsule by clicking on Data Capsules on the top menu, then select Create a Capsule from the dropdown menu. You will be asked to provide information about the Capsule you would like to create. This step also explains how to create or convert an existing Capsule to one with access to the full HathiTrust corpus, for HathiTrust members only. 

 Watch video tutorials

User interfaces shown in these videos may be outdated, but step-by-step instructions are up to date.

We're updating our videos to show latest changes!

Create a Capsule

Check Capsule Status

Convert a Research Capsule

 Read step-by-step instructions

Navigate to the 'Create a data capsule' page

Make sure you are signed in. Navigate to Create a data capsule page under the Tools navigation label at the top menu of HTRC Analytics.


Create a data capsule

You will be prompted to choose to create a Demo Capsule, a Research Capsule, or a Customized Research Capsule.


Create Demo Capsule

Note:

  • Demo Capsules are not configurable and can access public domain content only.
  • You cannot request to export derived data from a Demo Capsule.

Hit the Create Capsule button. The Capsule creation procedure usually takes about 1 minute to complete. Refresh your screen to see if it has finished.


You will be prompted to agree to the HTRC Data Capsules Terms of Use. Please review this document as it outlines policy for acceptable in-Capsule behavior. 

Create Research Capsule

Note:

  • Research Capsules are configurable and by default can access public domain content only.
  • You can request to export derived data from a Research Capsule.
  • Additional information is required to create your Capsule. 
  • During creation or after it's created, researchers from HathiTrust member institutions can request for their Research Capsule to be converted to one with computational access to the full HathiTrust corpus, including in-copyright content. 

Fill out the form with the title of your research project, and choose the specs for your Capsule. 

Capsule size can range from 1-10 VCPUs, from 1-20 GB of memory, and from 10-70 GB of secure volume size. The VCPUs and memory allocation you choose will affect the processing speed of your Capsule. 

Add the description for your research project. These answers will be used to aid in reviewing requests to export results from your Capsule. The more information you can provide, the more easily we can assess your results for adherence to the HTRC's Non-consumptive Use Research Policy

Affiliates of HathiTrust member institutions can check the box to request a Capsule with access to the full HathiTrust corpus. 


Checking that box will prompt you to fill out additional information about your project. Note: Creation requests from users who check this box will be routed for human review. Your request will be reviewed to verify that you are affiliated with a HathiTrust member institutions and that your request demonstrates serious research intentions in compliance with the HTRC's Non-consumptive Use Research Policy and  HTRC Data Capsules Terms of Use


Include more information about your anticipated results to further assist in the human review of your data export requests.



If you like, you can choose to allow HTRC to communicate anonymized information about your research project. You must also agree that you will not share your log-in information for HTRC Analytics with anyone.
 


You will be prompted to agree to the HTRC Data Capsules Terms of Use. Please review this document as it outlines policy for acceptable in-Capsule behavior. You will be reminded of these terms regularly while using your Capsule. 

Create Customized Research Capsule

Note:

  • Customized Research Capsules are copies of other users' Research Capsules, and they are ideal for classroom or workshop use.
  • Customized Research Capsules are configurable and by default can access public domain content only.
  • You can request to export derived data from a Customized Research Capsule.
  • Additional information is required to create your Capsule. 
  • During creation or after it's created, researchers from HathiTrust member institutions can request for their Customized Research Capsule to be converted to one with computational access to the full HathiTrust corpus, including in-copyright content. 

Choose a Customized Research Capsule template to use, and select Create a Data Capsule.


Fill out the form with the title of your research project, and choose the specs for your Capsule. 

Capsule size can range from 1-10 VCPUs, from 1-20 GB of memory, and from 10-70 GB of secure volume size. The VCPUs and memory allocation you choose will affect the processing speed of your Capsule. 





Add the description for your research project. These answers will be used to aid in reviewing requests to export results from your Capsule. The more information you can provide, the more easily we can assess your results for adherence to the HTRC's Non-consumptive Use Research Policy

Affiliates of HathiTrust member institutions can check the box to request a Capsule with access to the full HathiTrust corpus. 


Checking that box will prompt you to fill out additional information about your project. Note: Creation requests from users who check this box will be routed for human review. Your request will be reviewed to verify that you are affiliated with a HathiTrust member institutions and that your request demonstrates serious research intentions in compliance with the HTRC's Non-consumptive Use Research Policy and  HTRC Data Capsules Terms of Use


Include more information about your anticipated results to further assist in the human review of your data export requests.

If you like, you can choose to allow HTRC to communicate anonymized information about your research project. You must also agree that you will not share your log-in information for HTRC Analytics with anyone.

You will be prompted to agree to the HTRC Data Capsules Terms of Use. Please review this document as it outlines policy for acceptable in-Capsule behavior. You will be reminded of these terms regularly while using your Capsule.

Check Capsule Status 

After creating a Capsule, you will be taken back to the "My data capsule allocations" page. By default, the Capsule you just created is not running. 

  

Convert a Research Capsule

HathiTrust member-affiliated individuals can request to convert existing Research Capsules into one with access to the full HathiTrust corpus. 

From your My Data Capsule Resources page, click on the title of the Capsule you would like to convert. Then, click the button to Request access to Full HathiTrust Corpus.

You will be taken to the Capsule creation form. If you submit answers when creating your Capsule, they will appear for you to review and, if desired, edit. You will also be asked to fill in additional information about your research use case. Your request will be reviewed to verify that you are affiliated with a HathiTrust member institutions and that your request demonstrates serious research intentions in compliance with the HTRC's Non-consumptive Use Research Policy and  HTRC Data Capsules Terms of Use


Start the Capsule you created by clicking the Start Capsule button on the Capsules page.

From the HTRC Analytics homepage, click the My data capsule allocations link under the Tools top menu header. 


From the My data capsule allocations page, click on the data capsule title of the capsule you wish to start.


Next, click the Start Capsule button located on the upper-right hand side of the page.

Interact with the Capsule either via Remote Desktop viewer or Terminal viewer.

To get the details of your capsule so that you can log in to it, click on data capsule's title on the My data capsule allocations page.

You will see the details for your capsule. From this page, you can start, stop, or delete your Capsule. If your capsule has been started, you can also click to connect via Terminal (command line interface) or Remote Desktop (to see your capsule's Ubuntu desktop). You will see different options in the More Data Capsule Functions dropdown menu depending on whether you have opened a demo capsule or research capsule and whether or not you have started your capsule.

  • Demo capsule
    • If you have not yet started your capsule, the More Data Capsule Functions dropdown menu offers you the option to request data capsule help.

    • If you have started your capsule, the More Data Capsule Functions dropdown menu allows you to switch between Secure mode and Maintenance mode as well as request data capsule help.

       
  • Research Capsule
    • If you have not yet started your Capsule, the More Data Capsule Functions dropdown menu allows you to manage collaborators, create a template, or request data capsule help.

    • If you have started your capsule, the More Data Capsule Functions dropdown menu allows you to choose to switch between Secure mode and Maintenance mode, manage collaborators, or request data capsule help.


If you choose connect via Terminal, you will be take to a page showing a command line interface to interact with your Capsule. (Note: This option available in Maintenance mode only.)

If you choose to connect via Remote Desktop, you will be taken to a page from which you can interact with your Capsule's desktop. (Note: This option is available in either Maintenance or Secure mode.)

Watch the following video for rules for copying and pasting text/commands in the Data Capsule environment:

Overview of rules

  • Regardless of your local operating system, use ctrl-c and ctrl-v to copy and paste IN the Capsule.
  • AND if you are using the terminal IN your Capsule, regardless of your local operating system, use ctrl-shift-c and ctrl-shift-v.
  • You cannot copy and paste from you local desktop into the Capsule window AND you cannot copy and paste from your Capsule to your local desktop.

If you want to interact with your Capsule via SSH from your personal machine, you can follow the directions to set up that access. 

Alternatively, you can SSH into your Capsule when it is in Maintenance mode only. 

 Watch video tutorial

User interfaces shown in this video may be outdated, but step-by-step instructions are up to date.

We're updating our videos to show latest changes!

 Read step-by-step instructions

First, you will need a public key. Scroll down to the blue box at the bottom of your Capsule's status page.

You will be prompted for a key when you attempt to SSH into your Capsule. If you do not yet have a public key set up, then entering one will establish your key. You can do this by clicking Add or Update Public Key in the blue box. If you already have a key, resubmitting a response in the field below "Public Key" will change your key.

You'll find the command to SSH into your Capsule in the blue box on each Capsule's status page.

Switch between Maintenance and Secure mode.

HTRC Data Capsules have two modes: Maintenance mode and Secure mode. In Maintenance mode, the capsule can access the network (i.e. the internet) so that you can set up your capsule as you like, such as installing software or importing additional, non-HathiTrust data. In Secure mode, the capsule can access HathiTrust Data. 

HathiTrust data you import and/or work with in Secure mode must be stored on the capsule's Secure Volume, a storage location available in Secure mode only, in order to persist in a capsule when its modes are switched or when it is turned off and back on. For security reasons, data transferred or generated in the capsule in Secure mode that is not saved to the Secure Volume will be deleted when the capsule switches modes or is turned off and on. 


 Watch a video on how to switch modes

User interfaces shown in this video may be outdated, but step-by-step instructions are up to date.

We're updating our videos to show latest changes!

 Read instructions for how to switch modes

There are two ways you can switch your capsule's mode.

Option 1:

Go to the My data capsule allocations page and click on the title of one of your data capsules.

Start your capsule, and then click on the "More data capsule functions" dropdown menu to select "Switch to secure mode." Once it is in secure mode, you can switch it back to maintenance mode from the dropdown as well. 


Option 2:

When viewing your capsule via Remote Desktop, you will see a blue button to either "Switch to Secure Mode" or "Switch to Maintenance Mode." 



Click the button to switch. You'll see the Capsule's state change.



Once it has switched, you'll see that you can click the blue button again to switch modes back. 

 

Share your Research Data Capsule with up to 5 other researchers.

 Watch a video tutorial

User interfaces shown in this video may be outdated, but step-by-step instructions are up to date.

We're updating our videos to show latest changes!

 Read step-by-step instructions

From the My data capsule allocations page, click on the data capsule title for the capsule you would like to share.


Next, click on the dropdown menu located to the right of the screen labeled More data capsule functions. Select the Manage collaborators option.



You will be taken to a new page, where you can input the email address for the user you would like to add.



The email address must be the one associated with their HTRC Analytics account or you will get an error.



When you successfully add a collaborator, that user's information will appear in the table of collaborators. By default, they will have the role of Contributor. Contributors can access the Capsule and interact with it in its current state. You will have the role of Owner-Controller.



Before the new Contributor can access the Capsule, they will need to agree to the Data Capsules Terms of Use. You will also be unable to delegate control of the Capsule to them until they have agreed.

Once they have agreed to the Terms of Use, you can choose to make them a Controller of the Capsule by clicking the Delegate Control button.



Once complete, you'll find that their role has changed to Controller. Only the Controller can start, stop, and switch the modes of the Capsule. (The Owner-Controller likewise can do these tasks.)



Your role has changed to Owner. The owner can delete the Capsule and revoke control from the Controller. Click on the Revoke Control button to resume Owner-Controller status.



Now the collaborator again has the role of Contributor and you are Owner-Controller.



If you no longer want to share your Capsule with a user, click the red 'X' button next to the Delegate Control button.



After they are removed, you'll see the collaborators table has returned to displaying only you as associated with this Capsule.


Change your data capsule resource amounts.

You can adjust your data capsule resource amounts after after you’ve created it and when it is in SHUTDOWN mode. First select your desired data capsule from the My data capsule allocations page, and then click on the “Update resources” button in the “Resources” row.

Screen Shot 2024-07-02 at 2.13.28 PM.png

A popup will appear and you can adjust your available resources to you liking. Please note: if you have other data capsules, your available options will be based on what you have already used in your other capsules. Resource maximums can be seen at the top of your My data capsule allocations page.

 

Screen Shot 2024-07-02 at 2.14.50 PM.png

Make your changes and click “Confirm.” Your data capsule will take a moment to update accordingly.

 

Screen Shot 2024-07-02 at 2.17.20 PM.png

 

Bring text data into your Capsule.

Learn how to bring HT volume content into your Data Capsule.

Preferred method

HTRC has developed a Python library for loading volumes into the Data Capsule environment: the HTRC Workset Toolkit. The Toolkit is standard in all Capsules created after March 18, 2018. If you have a Capsule created earlier than this date, then you will need to install or update the Toolkit. 

Make sure you are in Secure mode to prepare to fetch content into your Data Capsule; it won't work in Maintenance mode for security reasons.

You can use the Workset Toolkit's "htrc download" command to transfer the volumes you would like to include in your dataset.

For example, the following command will import the volumes in the HathiTrust collection 'Adventure Novels: G.A. Henty'.

htrc download 'https://babel.hathitrust.org/cgi/mb?a=listis;c=464226859'


You can also curate a list of volumes whose data you would like to import by creating a file containing a HathiTrust volume ID list that you're interested in, with one ID per line. Run the above command replacing the collection URL with your file name.

For example, if you had a file called myvolumes.txt, you would run the following command.

htrc download myvolumes.txt


In the above examples, the data will be transferred to “/media/secure_volume/workset/”. If you want to specify an alternative location, provide an output by including -o and the file path in your command.

Other functions of the Workset Toolkit

You can also use a volume ID, collection URL, or catalog record ID to import volumes. Additionally, you have the option to concatenate files, remove folders, and retrieve metadata using the functions of the Workset Toolkit.

For more examples, see the detailed guide.

For the technical documentation, see: https://htrc.github.io/HTRC-WorksetToolkit/cli.html




Perform your analysis. See the following use cases for examples of how to perform text analysis in the Capsule. 

If you will need more than one session to complete your research, save your interim data to the Secure Volume.

Between sessions, stop the Capsule via the HTRC using the web browser on your personal desktop. The next time you log in, you can restart the same Capsule and continue your work.

When you are finished with your research, request to export your non-consumptive results. When you no longer need the Capsule, delete it via the HTRC. 

How to create a data Capsule template:

What to do if you need help troubleshooting problems with your data Capsule:

Questions?