.. _cmdline: Command line interface ====================== This page provides an overview of the hanythingondemand command line interface. .. note:: This only applies to hanythingondemand version 3 and newer; older versions provided a significantly different command line interface. .. contents:: :depth: 3 .. _cmdline_hod: ``hod`` command --------------- The main hanythingondemand command is a Python script named ``hod``, and implements the top-level command line interface that discriminates between the various subcommands. Running ``hod`` without arguments is equivalent to ``hod --help``, and results in basic usage information being printed: .. FIXME generate this .. code:: $ hod hanythingondemand version 3.2.0 - Run services within an HPC cluster usage: hod [subcommand options] Available subcommands (one of these must be specified!): batch Submit a job to spawn a cluster on a PBS job controller, run a job script, and tear down the cluster when it's done clean Remove stale cluster info. clone Write hod configs to a directory for editing purposes. connect Connect to a hod cluster. create Submit a job to spawn a cluster on a PBS job controller destroy Destroy an HOD cluster. dists List the available distributions genconfig Write hod configs to a directory for diagnostic purposes help-template Print the values of the configuration templates based on the current machine. list List submitted/running clusters relabel Change the label of an existing job. .. _cmdline_hod_options: General ``hod`` command line options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. _cmdline_hod_help: ``hod [subcommand] --help`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Print usage information and supported subcommands along with a short help message for each of them, or usage information and available options for the specified subcommand. .. .. _cmdline_hod_scheduler: .. ``hod --scheduler`` .. ^^^^^^^^^^^^^^^^^^^ .. Specify which scheduler to use; if no interface is specified, a list of available schedulers is printed. .. .. note:: For now, only ``PBS`` is supported. .. ----------- .. SUBCOMMANDS .. ----------- .. _cmdline_hod_subcommands: ``hod`` subcommands ------------------- The ``hod`` command provides a number of subcommands, which correspond to different actions. An overview of the available subcommands is available via ``hod --help`` (see :ref:`cmdline_hod`). More details on a specific subcommand are available via ``hod --help``. Available subcommands: * :ref:`cmdline_batch` * :ref:`cmdline_clean` * :ref:`cmdline_clone` * :ref:`cmdline_connect` * :ref:`cmdline_create` * :ref:`cmdline_destroy` * :ref:`cmdline_dists` * :ref:`cmdline_genconfig` * :ref:`cmdline_helptemplate` * :ref:`cmdline_list` * :ref:`cmdline_relabel` .. _cmdline_batch: ``hod batch --script=`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Create a cluster and run the script. Upon completion of the script, the cluster will be stopped. Next to ``--script`` (which is mandatory with ``batch``), all configuration options supported for ``create`` are also supported for ``batch``, see :ref:`cmdline_create_options`. When used with ``batch``, these options can also be specified via ``$HOD_BATCH_*``. Jobs that have completed will remain in the output of ``hod list`` with a job id of ```` until ``hod clean`` is run (see :ref:`cmdline_clean`), or until the cluster is destroyed using ``hod destroy`` (see :ref:`cmdline_destroy`). .. note:: ``--hod-module``, ``--workdir``, and either ``--hodconf`` or ``--dist`` **must** be specified. .. _cmdline_clean: ``hod clean`` ~~~~~~~~~~~~~ Remove cluster info directory for clusters that are no longer available, i.e. those marked with ```` in the output of ``hod list``. .. _cmdline_clone: ``hod clone `` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Clone a dist for use editing purposes. If there is a provided dist that is almost what is required for some work, users can clone it and edit the files. .. _cmdline_connect: ``hod connect `` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. ssh + set up environment (screen no longer needed!) Connect to an existing hanythingondemand cluster, and set up the environment to use it. This basically corresponds to logging in to the cluster head node using SSH and sourcing the cluster information script that was created for this cluster (``$HOME/.config/hod.d/