Contents
Skip to end of metadata
Go to start of metadata

Overview

This page will introduce users to accessing data stored on stash remotely using HTTP and show how to incorporate this access into job workflows.

Conventions

  • In the examples used on this page, text in red is being used as a placeholder and will need to be replaced with user specific information (e.g. username )
  • Names of servers are denoted using blue text (e.g. login01.osgconnect.net)
  • Directory or file names are denoted using green text (e.g. ~/my_file)

Preliminaries

Before getting started, users should login to login01.osgconnect.net and get a copy of the tutorial files:

Set up tutorial files

Making data accessible over HTTP

All user accounts on OSG-Connect have a directory that is automatically web accessible.  This directory is located at ~/data/public.  To make a file or directory accessible, copy it to this directory or a subdirectory of this directory and give files permissions of 644 and directories permissions of 755.  E.g. :

Making file accessible on HTTP

Manually Accessing Stash using HTTP

All the contents of the public directory are made available over HTTP.  Go to http://stash.osgconnect.net/+username to view the files and directory that you just made available in the previous section.  You can also use wget to retrieve the files, e.g:

Accessing files using wget

Accessing data from stash over HTTP within jobs

The final part of this section covers getting data within stash to jobs running on OSG using HTTP access.  This example will show the user how to access stash over HTTP within jobs.  The primary component of this example is the shell script that is run on the compute node.  It downloads the random_words data file and then generates a histogram with the most common words found in the file.  Before running this example, app_script.sh needs to be edited to replace username with the user's username:

app_script.sh

Next edit the application/application.submit file and replace PROJECT_NAME with the appropriate project name:

application.submit

Once that change has been made, submit the file:

Running random words application

Once the jobs are completed, users can look at the output in the logs directory and verify that the job ran correctly:

Verifying job completion
  • No labels