<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[onecolumn,letterpaper,11pt]{article}

%===================================================================
\input{common_latex/common_latex_packages}
\input{common_latex/common_latex_definitions}
\input{common_latex/common_latex_lab_format}
%===================================================================

\begin{document}

\begin{labcover}
\labtitle{Scripts}
\vspace{0.1in}
\labdate{March 2023}
\vspace{0.1in}
\labauth{Michael Benjamin, mikerb@mit.edu}
\labauth{Department of Mechanical Engineering}
\labauth{MIT, Cambridge MA 02139}
\labsrc{project-pavlab/mtasc/mt\_scripts} 
\labtoc{small}
\end{labcover}

\wikidoc{file=MT.Scripts}
\wikidoc{auth=mikerb@mit.edu}


%===================================================================
\section{Scripts}
%===================================================================
\label{sec_mt_scripts}

\vspace{0.1in}
\begin{consoleverb}
  cron (reboot) -&gt;
  |-&gt; upon_reboot.sh
      |-&gt; upon_rebootx.sh
          |-&gt; upon_reboot_moosivp.sh
              upon_reboot_pavlab.sh
              upon_reboot_swarm.sh
\end{consoleverb}
\vspace{0.1in}

\vspace{0.1in}
\begin{consoleverb}
  restore_svn.sh
\end{consoleverb}
\vspace{0.1in}

The MTASC network environment, in terms of which machines are powered
and with which IP address, is somewhat non-deterministic. This is due
to intermittent failures of machines and network IP assignments not
being guaranteed.  This may vary from system to system or day to day.
However, since the pablo network configuration is fairly stable during
a single power cycle of the system, the configuration is cached in
four files in the user's home directory. 


\begin{packed_itemize}
\item \var{.pablo\_ips}: List of PABLO IP addresses on the local network.
\item \var{.pablo\_names}: List of names for each PABLO on the local network. 
\item \var{.pablos\_byname}: Mapping from PABLO name to IP address. 
\item \var{.pablos\_byip}: Mapping from IP address to PABLO name. 
\end{packed_itemize}

%===================================================================
\subsection{Cache Files Example Snippets}

\vspace{0.1in}
\noindent
Example \var{~/.pablo\_names}: 

\vspace{0.1in}
\begin{fileverb}
paba01
paba02
paba03
paba04
paba05
\end{fileverb}
\vspace{0.1in}

\vspace{0.1in}
\noindent
Example \var{~/.pablo\_ips}: 

\vspace{0.1in}
\begin{fileverb}
192.168.7.32
192.168.7.33
192.168.7.34
192.168.7.35
192.168.7.36
\end{fileverb}
\vspace{0.1in}

\vspace{0.1in}
\noindent
Example \var{~/.pablos\_byname}: 

\vspace{0.1in}
\begin{fileverb}
paba01 192.168.7.60
paba02 192.168.7.66
paba03 192.168.7.71
paba04 192.168.7.62
paba05 192.168.7.55
\end{fileverb}
\vspace{0.1in}

\vspace{0.1in}
\noindent
Example \var{~/.pablos\_byip}: 

\vspace{0.1in}
\begin{fileverb}
192.168.7.32 paba25
192.168.7.33 paba24
192.168.7.34 paba21
192.168.7.35 paba40
192.168.7.36 paba22
\end{fileverb}
\vspace{0.1in}

%===================================================================
\subsection{SSH Keys}

Generation of cache files, and most other interactions with the PABLO
cluster, will require the user to have an ssh-key installed on the local
laptop and credentialed with the PABLOS. Otherwise remotedly executed
steps under the hood of bash scripts will likely fail.

\vspace{0.1in}
\noindent
See the document on MTASC SSH Keys.

%===================================================================
\subsection{Generating the Cache Files}

The cache files are generated by a script, \var{find\_pablos\_init.sh}
which can be found:

\vspace{0.1in}
\begin{consoleverb}
moos-ivp-swarm/scripts/find_pablo_init.sh
\end{consoleverb}
\vspace{0.1in}

\noindent
This script will scan a range of IP addresses using the \cmd{fping}
utility to determine which IP address seem to have a live computer. It
will then attempt to run a remote command on each computer to get the
name of the PABLO. For machines that are not a PABLO, this command
will return an empty string. If a machine is indeed a PABLO, a new
entry is made for each of the four cache files.

%===================================================================
\subsection{Aliases}

Below are a list of aliases that are recommended to be part of your bash
environment of your local computer being used to control an MTASC cluster. 

\vspace{0.1in}
\begin{fileverb}
  pup='find_pablo_init.sh -v'

  PABLO_FILES="  ${HOME}/.pablo_names"
  PABLO_FILES+=" ${HOME}/.pablo_ips"
  PABLO_FILES+=" ${HOME}/.pablos_byname"
  PABLO_FILES+=" ${HOME}/.pablos_byip"
  alias  hhp='head -n 50 ${PABLO_FILES}'
  alias  hp='head -n 5 ${PABLO_FILES}'
\end{fileverb}
\vspace{0.1in}

\noindent
A typical initial action upon starting the MTASC cluster, and letting them boot
is to run:

\vspace{0.1in}
\begin{consoleverb}
$ pup
\end{consoleverb}
\vspace{0.1in}

\noindent
Then to verify things work, taking a look at say the first 5 lines of each file:

\vspace{0.1in}
\begin{consoleverb}
$ hp
\end{consoleverb}
\vspace{0.1in}

\noindent
Or \cmd{hpp} if you want to see the full contents (up to 50 lines) of each file.

\end{document}


</pre></body></html>