IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40022


Ignore:
Timestamp:
Apr 30, 2017, 6:23:26 AM (9 years ago)
Author:
eugene
Message:

extensive wordsmithing

Location:
trunk/doc/release.2015
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/release.2015/Makefile.Common

    r39974 r40022  
    1414
    1515%.pdf: %.tex
    16         $(MY_LATEX) $*.tex
    17 
    18 #       $(MY_LATEX) $*.tex; if [ $? -eq 1 ]; then rm $*.pdf; exit 1; fi
    19 
    20 junk:
    21         if [ $(DO_BIBTEX) -eq 1 ]; then $(BIBTEX) $*; fi
    22         $(MY_LATEX) $*.tex; if [ $? -eq 1 ]; then rm $*.pdf; exit 1; fi
    23         if [ $(DO_BIBTEX) -eq 1  ]; then $(MY_LATEX) $*.tex; fi
     16#       need to remove the output pdf file if the latex fails or we cannot re-run
     17        $(MY_LATEX) $*.tex || (rm $*.pdf; exit 1)
     18        if [ $(DO_BIBTEX) -eq 1 ]; then $(BIBTEX) $* || (echo fail; exit 1); fi
     19#       need to re-run latex to get the reference right
     20        $(MY_LATEX) $*.tex || (rm $*.pdf; exit 1)
     21#       if we are running bibtex, we need to re-run latex AGAIN to get the reference right
     22        if [ $(DO_BIBTEX) -eq 1  ]; then $(MY_LATEX) $*.tex || (rm $*.pdf; exit 1); fi
    2423#       thumbpdf --modes=dvips $*.pdf
    2524#       $(MY_LATEX) $*.tex
  • trunk/doc/release.2015/ps1.datasystem/datasystem.tex

    r40021 r40022  
    10821082context. 
    10831083
    1084 One of the main purposes of the DVO system is to define the
    1085 relationship between individual detections of an astronomical object
    1086 and the definition of that object.  New detections are generally added
    1087 to the database in a group associated with, for example, an image from
    1088 the GPC1 camera.  As new detections are loaded, they are compared to
    1089 the objects already stored in the database.  If an object is already
    1090 found in the database within the match radius of \note{one arcsecond}, the new detection is
    1091 associated to that object. If more than one object exists within the
     1084One of the main purposes of DVO is to define the relationship between
     1085individual detections of an astronomical object and the definition of
     1086that object.  New detections are generally added to the database in a
     1087group associated with, for example, an image from the GPC1 camera.  As
     1088new detections are loaded, they are compared to the objects already
     1089stored in the database.  If an object is already found in the database
     1090within the match radius of \note{one arcsecond}, the new detection is
     1091assigned to that object. If more than one object exists within the
    10921092database, the detection is associated with the closest object.
    10931093
     
    14391439\section{Operations and Automation}
    14401440
     1441
    14411442\subsection{Pantasks and Parallel Processing}
    14421443\label{sec:pantasks}
     1444
     1445\subsubsection{Pantasks}
    14431446
    14441447Sections~\ref{sec:subsystesm} \& \ref{sec:postprocessing} describe the
     
    15651568prevent them from running for some reason.
    15661569
    1567 \note{discuss pcontrol}
     1570\subsubsection{pantasks passes jobs to pcontrol}
    15681571
    15691572Jobs which are generated by \ippprog{pantasks} may be run locally on
     
    15981601them to the list of jobs to execute.  It also accepts from pantasks
    15991602the names of computers on which it is allowed to run those jobs.
     1603
     1604\subsubsection{pcontrol passes jobs to pclient}
    16001605
    16011606When pcontrol is provided with the name of a computer, it will attempt
     
    16381643behavior depending on the exit code from the job. 
    16391644
    1640 \note{discuss pclient}
    1641 
    1642 \begin{verbatim}
    1643 * pantasks_client vs pantasks_server
    1644 * opihi scripting language
    1645 * task options (show example?)
    1646 
    1647 \end{verbatim}
     1645The \ippprog{pantasks} program can be run as a stand-alone program
     1646which presents an opihi shell interface to the user when it is
     1647started.  This mode is useful for testing as all errors are reported
     1648back to the opihi shell.  However, when the user exits the shell, the
     1649pantasks instance exits, shutting down pcontrol and all remote client
     1650connections.  In standard operations, pantasks is run in a client
     1651server mode.  The server runs continuously in the background and
     1652multiple users may connect via the \ippprog{pantasks_client} program.
     1653Users can the send commands to the server to load scripts, add
     1654parallel hosts, check status, and start or stop the pantasks
     1655operations.
    16481656
    16491657\begin{figure}
     
    16551663  periods  -exec 5.0
    16561664  npending 1
    1657   stdout   NULL
    1658   stderr   /data/local/example.task
     1665  stdout   /data/local/example.task.output
     1666  stderr   /data/local/example.task.errors
    16591667end 
    16601668\end{verbatim}
    16611669 \caption{\label{fig:simple.static.task} Example of a simple static
    1662    task in the opihi-based scripting language used by pantasks. }
     1670   task in the opihi-based scripting language used by pantasks.  In
     1671   this example, pantasks would run a single instance of the command
     1672   \code{ls /tmp} every 5 seconds, sending the stdout and stderr to
     1673   the listed files. }
    16631674  \end{center}
    16641675\end{figure}
    16651676
    1666 \note{this section needs to be re-written : pclient vs pcontrol vs pantasks}
    1667 
    1668 The actual processing of data is managed by the \ippprog{pantasks}
    1669 program.  This program launches a series of connections to other
    1670 computers in the IPP compute cluster, and launches instances of the
    1671 \ippprog{pclient} program that wait for jobs to be submitted.  These
    1672 jobs are generated from \ippmisc{ippTasks} command scripts that each
    1673 contain one set of tasks, written in the opihi language shared with
    1674 DVO.  These task scripts are generally sorted by the IPP stage.  The
    1675 tasks listed in these scripts are mainly written in the form of a pair
    1676 of \ippmisc{load} and \ippmisc{run} tasks.
    1677 
    1678 The \ippmisc{load} task for a particular stage queries the processing
    1679 database via an appropriate \ippmisc{ippTool} (see section \ref{sec:ipptools} below) for a list of jobs that are waiting to be run.
    1680 This task is executed on the host running the \ippprog{pantasks}
    1681 server, and only one of each type of \ippmisc{load} task is permitted to
    1682 run simultaneously, preventing race conditions.  To manage the
    1683 processing, the primary database tables for each stage contain a
    1684 \ippdbcolumn{label} field.  This field groups data into categories,
    1685 and the appropriate list of \ippdbcolumn{label}s are supplied to the
    1686 \ippprog{pantasks} program to be included in the queries to ensure
    1687 that only jobs for the active \ippdbcolumn{label}s are executed.  The
    1688 results from the database query are stored in \ippmisc{books} within the
    1689 \ippprog{pantasks} environment, with each resulting result row saved
    1690 to a separate entry within the \ippmisc{book}.  These \ippmisc{books} are
    1691 similar to an associative array indexing the entries (\ippmisc{pages} to
    1692 continue the analogy) to be accessed via a particular key.  Keys for
    1693 most stages are a combination of the stage id and an identifier for
    1694 the individual component for the job that will be executed.  The rest
    1695 of the column results from the query are stored to the \ippmisc{page},
    1696 with each field stored with the database column name.  An additional
    1697 field is added, the \ippdbcolumn{pantasksState}, which is set to
    1698 \ippmisc{INIT}, indicating that this \ippmisc{page} is a new addition to the
    1699 \ippmisc{book}.  Once all results from the database query have been
    1700 saved, the \ippmisc{load} task terminates, and waits to be rerun after
    1701 some timeout (on the order of a minute).  Once all new \ippmisc{pages}
    1702 have been added, the task then scans the \ippmisc{book} for any pages
    1703 with \ippdbcolumn{pantasksState} set to \ippmisc{DONE}, and removes them
    1704 from the book, as these represent jobs that have finished.
    1705 
    1706 Parallel to the \ippmisc{load} task, the \ippmisc{run} tasks are executed
    1707 by the \ippprog{pclient} code on one of the client nodes.  These
    1708 clients can access the \ippmisc{books} from \ippprog{pantasks}, and scan
    1709 the \ippmisc{book} to determine if it contains \ippmisc{pages}, and if one
    1710 of those pages contains an entry with the \ippdbcolumn{pantasksState}
    1711 set to \ippmisc{INIT}.  If such a \ippmisc{page} is found, the task sets
    1712 this field to \ippmisc{RUN} (ensuring no other \ippmisc{run} task will
    1713 attempt to process that page as well), and uses the information stored
    1714 on the page to construct a valid command line for the appropriate IPP
    1715 script.  The script (described below) command line is then executed,
    1716 and upon completion, pass the exit code back to \ippprog{pantasks},
    1717 allowing for an accounting of success and failures.  The page is then
    1718 set to \ippmisc{DONE}, indicating the job has completed, and the
    1719 \ippmisc{page} can be removed from the \ippmisc{book} by the next call of
    1720 the \ippmisc{load} task.  As the \ippmisc{run} tasks will involve processing
    1721 that may not complete in a known period of time, there is a timeout
    1722 limit set for the task, after which the \ippprog{pantasks} process can
    1723 terminate the task.  This prevents unproductive jobs from building up.
    1724 
    1725 In addition to these tasks, most stages have \ippmisc{revert} tasks
    1726 paired with the \ippmisc{run} task.  These tasks issue an appropriate
    1727 \ippmisc{ippTool} command to remove entries from the stage's secondary
    1728 database table that have the \ippdbcolumn{fault} field set to a value
    1729 other than zero.  This step allows these failures to be cleared from
    1730 the system, and schedule those jobs again for a retry.  Again, this
    1731 query is limited by the set of active \ippdbcolumn{label}s, ensuring
    1732 that only the data currently being processed is reverted.  Similarly,
    1733 some stages have \ippmisc{advance} tasks that update the primary table to
    1734 indicate that all of its components are complete.  For many of the
    1735 early stages of the pipeline (the \ippstage{chip} through
    1736 \ippstage{warp} stages), this \ippmisc{advance} task also adds an entry
    1737 into the database table for the next stage of processing for the
    1738 exposure being considered.  This step allows the data to process
     1677\subsubsection{Pantasks scripts: ippTasks}
     1678
     1679Pantasks provides an environment in which commands can be generated
     1680and extensive parallel processing managed.  The details of how to
     1681implement the different stages of IPP processing are captured in a
     1682collection of scripts written for pantasks in the \code{opihi}
     1683language.  In general, each stage is defined by an associated script
     1684collected together under the \ippmisc{ippTasks} collection.  While
     1685each script has its own details, there are a number of common
     1686elements.
     1687
     1688Most stages consist of two related tasks: a \ippmisc{load} task, which
     1689is responsible to querying the processing database to identify entries
     1690to be processed, and a \ippmisc{run} task, which is responsible for
     1691managing the processing of the individual entries.
     1692
     1693The \ippmisc{load} task for a particular stage generates
     1694\ippmisc{load} jobs which query the processing database via a
     1695dedicated database interface program (see the discussion of
     1696\ippmisc{ippTool} in section \ref{sec:ipptools} below) for a list of
     1697processing stage entries that are waiting to be run.  The
     1698\ippmisc{load} jobs are executed on the host running the
     1699\ippprog{pantasks} server.  Only one of each type of \ippmisc{load}
     1700job is permitted to run simultaneously, preventing race conditions.
     1701
     1702The results from the database query job are stored in an opihi data
     1703structure called a \ippmisc{book} within the \ippprog{pantasks}
     1704environment.  Each row in the result set is saved to a separate entry
     1705within the \ippmisc{book}.  These \ippmisc{books} are a hierarchical
     1706associative array indexing the entries (\ippmisc{pages} to continue
     1707the analogy) to be accessed via a particular key.  Keys for most
     1708stages are a combination of the stage id and an identifier for the
     1709individual component for the job that will be executed.  For a given
     1710row in the result set, each column in the row is stored as a separate
     1711line on the \ippmisc{page}, identified by the database column name.  An
     1712additional line, the \ippdbcolumn{pantasksState}, is added so pantasks
     1713can manage the processing of the job which will be generated by this
     1714page.  When the page is first generate, the
     1715\ippdbcolumn{pantasksState} is set to \ippmisc{INIT}, indicating that
     1716this \ippmisc{page} is a new addition to the \ippmisc{book}.  Once all
     1717new \ippmisc{pages} have been added, the task then scans the
     1718\ippmisc{book} for any pages with \ippdbcolumn{pantasksState} set to
     1719\ippmisc{DONE}, and removes them from the book, as these represent
     1720jobs that have finished. \note{the manipulation above takes place in
     1721  the task.exit subscript}
     1722
     1723The associated \ippmisc{run} task generates jobs constructed from the
     1724collection of pages in the book.  The task examines the book and
     1725selects the first available page with \ippdbcolumn{pantasksState}
     1726of \ippmisc{INIT}.  The task uses the information in the page to
     1727construct the appropriate command-line (e.g., lines in the page may
     1728include input file names and output file names for the specific item
     1729in the database).  The resulting command becomes a job in the pantasks
     1730collection of jobs.  Most IPP analysis stages specify that the jobs
     1731are then sent to pcontrol for parallel process.  Before task generates
     1732the job, the \ippdbcolumn{pantasksState} is set to \ippmisc{RUN} so a
     1733future execution of the task will not attempt to re-run this specific job.
     1734
     1735Upon completion of the job, it is necessary to update the processing
     1736database with the results, specifically indicating in the database
     1737that the job has completed and if was successful.  Within the IPP,
     1738this responsibility is left to the program which ran the analysis.
     1739IPP analysis steps normally consist of two main elements: a C-language
     1740program to do the data analysis work and a supporting perl script
     1741which performs the database update upon completion.  Upon completion,
     1742the pantasks \ippmisc{RUN} tasks is responsible for updating the
     1743status within the book, but not within the processing database.  This
     1744split keeps the interactions at the pantasks level relatively light,
     1745leaving the overhead of the database interaction within the job
     1746running on one of the computing machines in the cluster.
     1747
     1748In addition to these tasks, most stages have a \ippmisc{revert} task
     1749paired with the \ippmisc{run} task.  These tasks run infrequently and
     1750generate jobs which perform an operation on the processing database to
     1751clear jobs which have failed with one of the ephemeral failure modes
     1752(see the discussion in Section~\ref{sec:processing.database}).  This
     1753step allows these failures to be cleared from the system, and schedule
     1754those jobs again for a retry. 
     1755
     1756Similarly, some stages have \ippmisc{advance} tasks that update the
     1757primary table to indicate that all of its components are complete.
     1758For many of the early stages of the pipeline (the \ippstage{chip}
     1759through \ippstage{warp} stages), this \ippmisc{advance} task also adds
     1760an entry into the database table for the next stage of processing for
     1761the exposure being considered.  This step allows the data to process
    17391762automatically from stage to stage without intervention.
    17401763
    1741 \subsubsection{Stage automation}
     1764The IPP processing database is used to manage all versions of an
     1765analysis for all analysis stages.  In addition to the regular
     1766processing of the nightly data products, there may be large-scale
     1767re-processing analysis tasks or tests of various kinds.  It may be
     1768necessary for a test analysis of a particular item to use a different
     1769version of the processing software from the regular nightly analysis
     1770(for example, when testing a new algorithm for release).  A mechanism
     1771is needed to manage these different processing attempts of the same
     1772items.  With the IPP, this is accomplished with an extra field,
     1773\ippmisc{label}, for each processing stage.  Within the
     1774\ippmisc{load}, \ippmisc{revert}, and \ippmisc{advance} tasks
     1775discussed above, the query to the processing database for new items is
     1776restricted to a set of user-defined labels.  A given instance of
     1777pantasks will be supplied a set of labels which are then applied to
     1778all tasks managed by that pantasks.  For example, the pantasks which
     1779manages the nightly processing of the basic science analysis stages
     1780(chip - warp, stack, diff) is supplied with several labels which
     1781correspond to the different kinds of observations being performed.  In
     1782this way, the analysis of the nightly observations is kept separate
     1783from other processing attempts.
     1784
     1785
     1786
     1787\subsection{Stage automation}
    17421788\label{sec:automation}
    1743 \note{I'm not convinced this is the right place for it, but it felt like a natural extension of the ``advance''}.
    1744 
    1745 \note{wording..}  Beyond the warp stage, there is no longer a single
    1746 ``next'' stage into which data can be queued.  Because of this, more
    1747 sophisticated methods are used to advance the data.  For processing
    1748 data that is actively being observed at the summit, this is handled by
    1749 a set of ``nightly science'' tasks and an associated
    1750 \ippmisc{ippScript}.  The goal of these tasks is to ensure that
    1751 exposures are correctly paired into sets of
    1752 \ippstage{warp}-\ippstage{warp} difference images, and that nightly
    1753 stacks are generated for MD fields.
    1754 
    1755 Queuing the diffs is done by first examining the set of all exposures
    1756 that have been taken at the summit on the current night of observing,
    1757 and querying information from each stage up through \ippstage{warp}
    1758 stage.  These exposures are grouped by \ippdbcolumn{filter} and
    1759 \ippdbcolumn{object}, which is a unique identifier for each telescope
    1760 pointing on the sky.  Exposures in each group are then sorted by
    1761 increasing observation date (\ippdbcolumn{dateobs}), and the
    1762 information from each stage is used to ensure that the observations
    1763 have completed all stages through \ippstage{warp} successfully.  If
    1764 this is not the case, the script ignores that group until a future
    1765 scan, to allow the data to finish processing.  If the lack of
    1766 completion is due to a failure at a stage prior to \ippstage{warp},
    1767 then that exposure is dropped from the group to allow the remainder to
    1768 be considered for \ippstage{diff}s.  The remaining exposures are then
    1769 paired sequentially, with the final exposure ignored in the case of an
    1770 odd number of exposures (caused by either a failure in the processing
    1771 of an exposure or due to the telescope closing for weather prior to
    1772 completing all scheduled observations).  Once the observing process
    1773 completes (signalled to the nightly science task and script by the
    1774 presence in the database of entries for dark exposures that are taken
    1775 each morning after the telescope closes), and the script has generated
    1776 all \ippstage{diff} pairs that can be made with the above rule, a
    1777 second pass is performed, this time with the exposures in each group
    1778 sorted by decreasing observation date.  This change in ordering allows
    1779 exposures that were excluded due to an odd number of exposures to be
    1780 paired with the exposure closest in time (with the exposure that was
    1781 previously first ignored).
     1789
     1790\note{start with a discussion of the standard sequencing (end-stage)}
     1791
     1792\note{then discuss the addstar sequences with manual triggering}
     1793
     1794Outside of the basic sequence of chip to warp, there is no single
     1795natural next step.  For example: a stack can be generated with any
     1796number of input warps; a difference image can be generated between a
     1797warp and any one of many other warps or stacks.  Without a single
     1798sequence, more complex and sophisticated decisions much be made.
     1799
     1800For nightly processing of data obtained at the summit, this is handled
     1801by a set of ``nightly science'' tasks and an associated
     1802\ippmisc{ippScript}.  These scripts have a well-defined and restricted
     1803set of goals: to ensure that difference images are generated for each
     1804exposures (either by pairing together warps or pairs warps with
     1805pre-defined stacks), that nightly stacks are generated for MD fields,
     1806and that the stacks are also differenced against an appropriate
     1807reference. 
     1808
     1809Pairing warps together is simplified by the observing strategy in
     1810which the same pointing is observed multiple times in a night.  By
     1811limiting to warp-warp pairs from the same pointing, the problem is
     1812significantly reduced from the arbitrary case. 
     1813
     1814{\em Queuing the diffs} is done by first examining the set of all
     1815exposures that have been taken at the summit on the current night of
     1816observing, and querying information from each stage up through
     1817\ippstage{warp} stage.  These exposures are grouped by
     1818\ippdbcolumn{filter} and \ippdbcolumn{object}, which is a unique
     1819identifier for each telescope pointing on the sky.  Exposures in each
     1820group are then sorted by increasing observation date
     1821(\ippdbcolumn{dateobs}).  The database results for each stage
     1822(chip-warp) are checked to ensure that the selected exposures have
     1823been successfully processed for all stages through \ippstage{warp}.
     1824Exposure groups are ignored until all exposures have either been
     1825processed through warp or have failed with a bad quality, meaning the
     1826exposure (or portion) cannot be processed.  Failed exposures are
     1827rejected.  The remaining exposures are then paired sequentially, with
     1828the final exposure ignored in the case of an odd number of accepted
     1829exposures.  Exposures paired in this way are sent to the
     1830ippstage{diff} analysis stage.
     1831
     1832Once observations have been completed for the night (signalled by the
     1833end-of-night dark exposures that are taken each morning after the
     1834telescope closes), and the script has generated all \ippstage{diff}
     1835pairs that can be made with the above rules, a second pass is
     1836performed, this time with the exposures in each group sorted by
     1837decreasing observation date.  This change in ordering allows exposures
     1838that were excluded due to an odd number of exposures to be paired with
     1839the exposure closest in time (with the exposure that was previously
     1840first ignored).  Exposure pairs in which at least one exposures does
     1841not have a pre-existing difference image are queued for difference
     1842image analysis.
    17821843
    17831844The nightly stacks are queued based on checking that a minimum number
     
    17881849\ippstage{stack} database entries can be queued with the
    17891850\ippstage{warp} entries.  Again, failures and weather can reduce the
    1790 number of usable exposures, so the task generates \ippstage{stack}
    1791 entries using whatever exposures are available if one has not yet been
    1792 constructed by the time the morning dark exposures are registered into
    1793 the database. \note{wording}
    1794 
    1795 Automating the nightly processing is important, as it ensures that
    1796 data is processed as soon as it is downloaded from the summit,
    1797 reducing the lag between an observation and the reduced data.  The
    1798 other processing task that requires automation is the reprocessing of
    1799 the entire $3\pi$ survey, as the size of the dataset make it
     1851number of usable exposures.  If no stack could be made for a given MD
     1852field with the minimum number of inputs by the time of the
     1853end-of-night darks, stacks are generated using using whatever
     1854exposures are available.
     1855
     1856The automatic nightly processing ensures that data is processed as
     1857soon as it is downloaded from the summit, reducing the lag between an
     1858observation and the reduced data. \note{some numbers here about
     1859  completion times and such?  Words about getting data to MOPS and SN
     1860  transient folks}
     1861
     1862\note{re-read paragraph below and cleanup}
     1863
     1864The other processing task that requires automation is the reprocessing
     1865of the entire $3\pi$ survey, as the size of the dataset make it
    18001866challenging to do manually.  To manage this, the ``large area
    18011867processing'' (LAP) task and script are used.  The first stage of this
     
    18231889\ippdbcolumn{projection\_cell}.
    18241890
     1891
    18251892\subsection{Nebulous}
    18261893\label{sec:nebulous}
     1894
     1895\subsubsection{Motivation and Concept}
    18271896
    18281897A major concern recognized early in the Pan-STARRS project is the
    18291898challenge of storing and managing the large volume of data that is
    18301899generated by the GPC1 camera.  The \ippprog{Nebulous} system was
    1831 designed to organize this data.  The main components of this system
    1832 are a database storing the locations of the files, with a Simple
    1833 Object Access Protocol (SOAP) interface between the database and the
    1834 other IPP programs \note{define / mention http}.  The actual files are
    1835 stored on a collection of computers with substantial disk partitions
    1836 in the IPP cluster, shared within the cluster via NFS.  This
    1837 distribution of files is useful to balance the disk I/O, as this
    1838 parallelizes the load.
    1839 
    1840 The original design of \ippprog{Nebulous} was intended to aid in the
    1841 targetted processing of data, by having specific image data (such as
    1842 all the images from one OTA device) located on a single storage node.
    1843 This would allow any jobs involving that data to be assigned to the
    1844 storage node, eliminating network I/O.  Important data could be
    1845 duplicated to additional data nodes, with the alternate locations
    1846 stored in the database.  In practice, however, hardware failures and
    1847 increases in hard drive storage volumes and network bandwidth have
    1848 reduced the degree to which the IPP processing is targeted.
    1849 
    1850 \note{this is a critical paragraph and needs to be re-written to be
    1851   more accessible}
    1852 When a program creates a new file in \ippprog{Nebulous}, it supplies
    1853 an URI of the form \code{neb://HOST.VOLUME/PATH/FILENAME}.  The host
    1854 and volume specifiers are optional, and allow a file to be created on
    1855 a specific node.  The path and filename appear similar to a standard
    1856 full file location, and are used internally as the ``external id''.
    1857 \note{mention the nebulous schema before this?}  A storage object
    1858 entry is then created in the database for this id, and an instance of
    1859 the file created on the specified node (or at random from available
    1860 nodes if left empty).  This instance is created in a deterministic
    1861 filename location.  The external id is hashed using the SHA-1
    1862 function, and the first four hexadecimal digits of this hash are
    1863 separated into two two-digit strings and used as the top and second
    1864 level directory location for the disk file.  The disk file is created
    1865 using the database instance id, and a transformed version of the
    1866 external id, which has colons replacing any forward slash characters,
    1867 to convert the external id path into a filename.  For the example URI
     1900designed to aid in thie process.  \ippprog{Nebulous} is not a file
     1901system per-se, but only method of tracking the locations of files
     1902within the file system, and of tracking duplicate copies of the same
     1903file.  The core of \ippprog{Nebulous} is a dedicated database engine
     1904which tracks ``storage objects'', the concept of a file exists in the
     1905system.  Each storage object may be associated with a number of copies
     1906of the actual files on the disks in the storage system (called
     1907``instances''), which are also recorded by the database.  In the IPP
     1908cluster, the file instances are stored on a collection of computers
     1909with substantial disk partitions shared via NFS.
     1910
     1911\ippprog{Nebulous} also explicitly tracks the different computers on
     1912which the file instances are stored.  This allows the system to expose
     1913files to the user only on machines which are currently active in
     1914\ippprog{Nebulous}.  If, for example, a storage computer crashes or
     1915needs to be taken offline, the machine can be made unavailable in
     1916\ippprog{Nebulous}, in which case only instances on other machines
     1917will be supplied to users.
     1918
     1919This localization is also useful for allowing the IPP processing to
     1920target processing to computers based on the location of the data.  For
     1921example, all raw images from a specific chip in the camera could be
     1922stored on a specific computer (for at least one of the instances).
     1923All of the analysis stages which interact with that chip could then be
     1924preferentially targetted to be run on that computer.  The localization
     1925in \ippprog{Nebulous} and the host targetted processing in pantasks
     1926can therefore work together to encourage processing to require only
     1927local disk access, reducing the I/O local on the network
     1928infrastructure.  In the early stages of the Pan-STARRS project, this
     1929was important because network bandwidth was an expensive resource.  In
     1930practice, the as-built IPP has had sufficient network bandwidth that
     1931this targetting was not required.  In practice, due to the timing of
     1932hardware aquisition, occasional hardware failures, and other
     1933organizational details, targetted processing has only been used to a
     1934moderate degree within the Pan-STARRS cluster. \note{can we get a
     1935  number here?}
     1936
     1937\subsubsection{Implementation Details}
     1938
     1939The user interfaces to Nebulous consist of command-line programs as
     1940well as APIs in both C and Perl.  The basic user commands to interact
     1941with Nebulous are to 1) create a new storage object and associated
     1942instance; 2) add a new instance to an existing storage object; 3)
     1943remove (cull) an instance; 4) delete a storage object; and 5) find a
     1944file associated with a given storage objects.  Note that these user
     1945commands do not affect the files on disk \note{true for cull?}
     1946(exception: the create function will create an empty file if one does
     1947not exist).  They only change the state of the Nebulous database; it
     1948is the responsibility of the user program to read and write data to a
     1949file and to create the copies, etc.
     1950
     1951For the Nebulous users, the identifier of a storage object is a unique
     1952string with the form of a UNIX file path: e.g. a/b/c/file.  When a
     1953program creates a new file in \ippprog{Nebulous}, it supplies a URI of
     1954the form \code{neb://HOST.VOLUME/PATH/FILE}.  The host and volume
     1955specifiers are optional, and allow a file to be created on a specific
     1956node.  The path and filename portions become the identifier and are
     1957recorded in the \ippmisc{storage_object} table in the
     1958\ippmisc{extern_id} field.  A storage object entry is then created in
     1959the database for this id, and an instance of the file created on the
     1960specified node (or at random from available nodes if left empty).
     1961
     1962Files are stored on specific computers in a \ippprog{Nebulous}
     1963directory or directories on that computer.  In the IPP system, the
     1964top-level Nebulous directories are usually placed at the root of the
     1965storage device as mounted on the machine, in a subdirectory named
     1966\code{nebulous}.  Beneath the top-level directory are 256
     1967subdirectories with names of the form 00 - ff (i.e., 2 digit
     1968hexadecimate number).  Each subdirectory again as 256 subdirectories
     1969with the same naming scheme. 
     1970
     1971The filename of an instance in Nebulous is deterministic and derived
     1972from the \ippmisc{extern_id}: the \ippmisc{extern_id} is hashed using
     1973the SHA-1 function, and the first four hexadecimal digits of this hash
     1974are separated into two two-digit strings and used as the top and
     1975second level directory location for the disk file.  The instance table
     1976in the Nebulous database includes a unique auto-incrementing index to
     1977provide a unique SQL ID for each instance.  Under the subdirectory
     1978identified above, the disk file name is by appending the database
     1979instance id with a string derived from the \code{extern_id}: forward
     1980slash characters are replaced in the name with colons so the string
     1981can represent a file in the UNIX filesystem.  For the example URI
    18681982above, this results in a file located on disk in a location like
    1869 \code{/data/HOST.VOLUME/nebulous/d5/d8/9244993440.PATH:FILENAME}.
    1870 This file naming structure is useful, as it duplicates database
    1871 contents on disk.  \note{rephrase}
    1872 
    1873 The storage volumes that contain the data on disk are defined in the
    1874 \ippprog{Nebulous} database in a number of ways.  First, the locations
    1875 and mount points for the actual NFS storage are listed in the
     1983\code{/data/HOST.VOLUME/nebulous/d5/d8/9876.PATH:FILE}.
     1984This file naming structure has the benefit of providing redundancy
     1985between the filename on disk and the instance in the database.
     1986
     1987Nebulous tracks additional information beyond just the storage objects
     1988and the associated instances.  As mentioned above, the storage volumes
     1989are tracked to provide a link between a top level nebulous directory
     1990and the computer which contains that directory.  The locations and
     1991mount points for the actual NFS storage are listed in the
    18761992\ippdbtable{volume} table.  This table contains columns indicating if
    18771993the volume should be used for reading (\ippdbcolumn{available}) and
    1878 writing (\ippdbcolumn{allocate}), allowing these properties to be
    1879 manually set, which is useful in scheduling downtime for hardware
    1880 issues.  Another column, \ippdbcolumn{xattr}, is used to control the
    1881 behavior of this volume, with specific values used to denote desired
    1882 behavior.  For instance, the value of $1$ is used to indicate that a
    1883 volume should only be used as a backup volume (which accepts only
    1884 replicated copies), and the value of $5$ is used to indicate that the
    1885 volume is permanently unavailable, and should be ignored. \note{more
    1886   detail, more specific}
    1887 
    1888 In addition to this permanent table describing the volumes, a
    1889 \ippdbtable{mountedvol} table also exists that only lists those
     1994writing (\ippdbcolumn{allocate}).  As noted above, Nebulous will not
     1995return a file to the user if the storage volume is marked as not
     1996\ippdbcolumn{available}.  If a storage volume is marked as not to be
     1997\ippdbcolumn{allocate}ed, then new storage objects will not generate
     1998instances on that volume, but existing instances may be supplied to
     1999the user. 
     2000
     2001\note{we care about the concepts here, but not the numbers. reword}
     2002Another column, \ippdbcolumn{xattr}, is used to control the behavior
     2003of this volume, with specific values used to denote desired behavior.
     2004For instance, the volume may be marked to be used only for backup, in
     2005which case it will not be used to store an instance by default, but
     2006will be used preferentially if an instance noted as a backup when it
     2007is generated.  Alternatively, a volume may be marked as permanently
     2008unavailable, and should be ignored in most contexts.  This latter
     2009option allows the system to retain the memory of hardware which has
     2010been retired (and potentially to retain information about instances
     2011which were previously on such machines).
     2012
     2013In addition to the static table describing the volumes, a second
     2014dynamically-generated table, \ippdbtable{mountedvol}, lists those
    18902015volumes that are currently visible and accessible from the
    18912016\ippprog{Nebulous} database server.  This table also lists the total
     
    18972022\ippdbtable{volume} table.
    18982023
    1899 The final table controlling the operations of the \ippprog{Nebulous}
    1900 volumes is the \ippdbtable{cabinet} table, which organizes the
    1901 individual volumes into ``cabinets,'' a concept loosely based on the
    1902 physical arrangement of the storage servers in the data center.  These
    1903 cabinets are used to prevent the replication of a storage object
    1904 within a group of volumes where all instances of the object could be
    1905 taken off line by a single failure.  Since servers within a given
    1906 cabinet in the data center share a common set of PDUs \note{define},
    1907 it is important to ensure physical distance between replicated copies
    1908 to guarantee that a temporary failure of one of the cabinet PDUs does
    1909 not significantly impact processing.
     2024The \ippdbtable{cabinet} table organizes the individual volumes into
     2025``cabinets,'' a concept loosely based on the physical arrangement of
     2026the storage servers in the data center.  These cabinets are used to
     2027prevent the replication of a storage object within a group of volumes
     2028where all instances of the object could be taken off line by a single
     2029failure.  Since servers within a given cabinet in the data center
     2030share a common set of power delivery units (PDUs), it is important to
     2031ensure physical distance between replicated copies to guarantee that a
     2032temporary failure of one of the cabinet PDUs does not significantly
     2033impact processing.
     2034
     2035The nebulous user APIs do not interact directly with the nebulous
     2036mysql database.  Instead, they interact with one of several computers
     2037with an Apache web server.  Interactions with the Apache server are
     2038performed using the Simple Object Access Protocol (SOAP) interface,
     2039while the Apache servers interact directly with the Mysql database
     2040server.  This architecture avoids the overhead of setting up and
     2041tearing down the Mysql connection for each Nebulous command, instead
     2042using only the low-latency SOAP communications.
    19102043
    19112044\note{need a paragraph or two on stats: how many objects, how many
Note: See TracChangeset for help on using the changeset viewer.