*********************************
Command line interface (AER 2.28)
*********************************

.. raw:: html

    <div class="section" id="cas-mirror">
    <h2>cas-mirror<a class="headerlink" href="#cas-mirror" title="Permalink to this headline">¶</a></h2>
    <p>NOTE: The cas-mirror tool is a component of the Anaconda repository
    enterprise product and is not available for free.</p>
    <p>The mirror tool is used to setup a package mirror of the Anaconda repository
    within your organization.  The following <code class="docutils literal"><span class="pre">conda</span></code> command installs the
    mirror tool:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>conda install cas-mirror
    </pre></div>
    </div>
    <p>Installing cas-mirror will make these commands available:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">cas</span><span class="o">-</span><span class="n">sync</span> <span class="o">--</span><span class="n">help</span>
    <span class="n">cas</span><span class="o">-</span><span class="n">server</span> <span class="o">--</span><span class="n">help</span>
    </pre></div>
    </div>
    <p>The first command <code class="docutils literal"><span class="pre">cas-sync</span></code> is used to bring the local mirror of the
    Anaconda repository up-to-date with our remote servers.
    To configure the location of the mirror on your file system, check
    the output of:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">cas</span><span class="o">-</span><span class="n">sync</span> <span class="o">--</span><span class="n">config</span>
    </pre></div>
    </div>
    <p>and, if necessary, create a configuration file (either <code class="docutils literal"><span class="pre">~/.cas-mirror</span></code> or
    system-wise <code class="docutils literal"><span class="pre">/etc/cas-mirror</span></code>) which contains the desired location
    of the local mirror on the filesystem, the platforms which should be
    mirrored, as well as an optional blacklist of packages (the names of
    packages which should not be mirrored, e.g.</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>mirror_dir: /home/data/mirror
    remote_url: &quot;&quot;  # where to get miniconda and anaconda installers -- blank to skip
    # possible platforms are: linux-64, linux-32, osx-64, win-32, win-64
    platforms:
      - linux-64
      - win-32
    blacklist:
      - dnspython
      - shapely
      - gdal
    </pre></div>
    </div>
    <p>Once you are happy with the mirror directory (which may be the default),
    you can run:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">cas</span><span class="o">-</span><span class="n">sync</span>
    </pre></div>
    </div>
    <p>Running this command for the first time will take many hours, because the
    entire Anaconda repository is being downloaded.  Subsequent runs will take
    significantly less time.
    To serve the Anaconda repository over HTTP, you can run:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">cas</span><span class="o">-</span><span class="n">server</span>
    </pre></div>
    </div>
    <p>The port on which the repository is being served may be changed using
    the <code class="docutils literal"><span class="pre">--port</span></code> option.  Note that you will need to run <code class="docutils literal"><span class="pre">cas-server</span></code> as
    root when you intend to serve on port 80.</p>
    <p>More extensive information about the cas-mirror tool&#8217;s functionality and configurable options is available <a class="reference external" href="mirrors-sync-configuration.html">here</a>.</p>
    </div>
    <div class="section" id="cas-installer">
    <h2>cas-installer<a class="headerlink" href="#cas-installer" title="Permalink to this headline">¶</a></h2>
    <p>A token from Continuum is required to install cas-installer, and you should
    have received it when your organization purchased Anaconda Repository, Workgroup or
    Enterprise. If you no longer have access to your token, submit a support ticket
    or contact us at <a class="reference external" href="https://support.continuum.io/">priority support</a>. You can
    also email support at the email address given to you by your sales
    representative.</p>
    <p>When you have the token, run:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>export TOKEN=&lt;your Anaconda Cloud token&gt;
    conda config --add channels https://conda.anaconda.org/t/$TOKEN/anaconda-server
    </pre></div>
    </div>
    <p>This tool allows you to create an installer for a conda environment.
    It is important that the cas-installer package is installed into the &#8220;root&#8221;
    conda environment (not &#8220;root&#8221; user).  The following command ensures that
    this happens:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>conda install -n root cas-installer=1.3.2
    </pre></div>
    </div>
    <p>Once installed, the <code class="docutils literal"><span class="pre">cas-installer</span></code> command will be available:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">cas</span><span class="o">-</span><span class="n">installer</span> <span class="o">-</span><span class="n">h</span>
    </pre></div>
    </div>
    <p>The command takes an installer specification file as its argument, which
    specifies the name of the installer, the conda channel to pull packages
    from, the conda packages included in the installer etc.  Here is an
    example:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span># ----------------- required -----------------
    # name
    name: test

    # channels to pull packages from
    # The &amp;channels creates a backreference so that it can be reused as
    # *channels in the conda_default_channels section below.
    channels: &amp;channels
      - http://repo.continuum.io/pkgs/free/

    # specifications
    specs:
      - python
      - grin

    # ----------------- optional -----------------
    # platform e.g. linux-32, osx-64, win-32 defaults to current platform
    #platform: linux-64

    # The conda default channels which are used when running a conda which
    # was installed be the cas-installer created (requires conda (3.6.2 or
    # greater) in the specifications). The *channels is a YAML reference to
    # &amp;channels above.  It inserts all the channels from the channels key, so
    # that they do not have to be typed twice.
    conda_default_channels: *channels

    # installer filename
    #installer_filename: grin.sh

    # default install prefix
    default_prefix: /opt/anaconda
    </pre></div>
    </div>
    <p>For Windows, the tool creates nsis-based <code class="docutils literal"><span class="pre">.exe</span></code> installers, which can only
    be created on a Windows platform, although the architecture may be different.
    For Unix, the tool creates bash-based <code class="docutils literal"><span class="pre">.sh</span></code> installer, which can only
    be created on Unix (Linux, Mac OS X) systems.</p>
    </div>
