contrib/automation/README.rst
changeset 42312 65b3ef162b39
parent 42024 b05a3e28cf24
child 42913 92593d72e10b
equal deleted inserted replaced
42311:195dcc10b3d7 42312:65b3ef162b39
    99 Under normal operation, recurring costs are limited to:
    99 Under normal operation, recurring costs are limited to:
   100 
   100 
   101 * Storage costs for AMI / EBS snapshots. This should be just a few pennies
   101 * Storage costs for AMI / EBS snapshots. This should be just a few pennies
   102   per month.
   102   per month.
   103 
   103 
   104 When running EC2 instances, you'll be billed accordingly. By default, we
   104 When running EC2 instances, you'll be billed accordingly. Default instance
   105 use *small* instances, like ``t3.medium``. This instance type costs ~$0.07 per
   105 types vary by operation. We try to be respectful of your money when choosing
   106 hour.
   106 defaults. e.g. for Windows instances which are billed per hour, we use e.g.
       
   107 ``t3.medium`` instances, which cost ~$0.07 per hour. For operations that
       
   108 scale well to many CPUs like running Linux tests, we may use a more powerful
       
   109 instance like ``c5.9xlarge``. However, since Linux instances are billed
       
   110 per second and the cost of running an e.g. ``c5.9xlarge`` for half the time
       
   111 of a ``c5.4xlarge`` is roughly the same, the choice is justified.
   107 
   112 
   108 .. note::
   113 .. note::
   109 
   114 
   110    When running Windows EC2 instances, AWS bills at the full hourly cost, even
   115    When running Windows EC2 instances, AWS bills at the full hourly cost, even
   111    if the instance doesn't run for a full hour (per-second billing doesn't
   116    if the instance doesn't run for a full hour (per-second billing doesn't
   123    $ automation.py terminate-ec2-instances
   128    $ automation.py terminate-ec2-instances
   124 
   129 
   125 To purge all EC2 resources that we manage::
   130 To purge all EC2 resources that we manage::
   126 
   131 
   127    $ automation.py purge-ec2-resources
   132    $ automation.py purge-ec2-resources
       
   133 
       
   134 Remote Machine Interfaces
       
   135 =========================
       
   136 
       
   137 The code that connects to a remote machine and executes things is
       
   138 theoretically machine agnostic as long as the remote machine conforms to
       
   139 an *interface*. In other words, to perform actions like running tests
       
   140 remotely or triggering packaging, it shouldn't matter if the remote machine
       
   141 is an EC2 instance, a virtual machine, etc. This section attempts to document
       
   142 the interface that remote machines need to provide in order to be valid
       
   143 *targets* for remote execution. These interfaces are often not ideal nor
       
   144 the most flexible. Instead, they have often evolved as the requirements of
       
   145 our automation code have evolved.
       
   146 
       
   147 Linux
       
   148 -----
       
   149 
       
   150 Remote Linux machines expose an SSH server on port 22. The SSH server
       
   151 must allow the ``hg`` user to authenticate using the SSH key generated by
       
   152 the automation code. The ``hg`` user should be part of the ``hg`` group
       
   153 and it should have ``sudo`` access without password prompting.
       
   154 
       
   155 The SSH channel must support SFTP to facilitate transferring files from
       
   156 client to server.
       
   157 
       
   158 ``/bin/bash`` must be executable and point to a bash shell executable.
       
   159 
       
   160 The ``/hgdev`` directory must exist and all its content owned by ``hg::hg``.
       
   161 
       
   162 The ``/hgdev/pyenv`` directory should contain an installation of
       
   163 ``pyenv``. Various Python distributions should be installed. The exact
       
   164 versions shouldn't matter. ``pyenv global`` should have been run so
       
   165 ``/hgdev/pyenv/shims/`` is populated with redirector scripts that point
       
   166 to the appropriate Python executable.
       
   167 
       
   168 The ``/hgdev/venv-bootstrap`` directory must contain a virtualenv
       
   169 with Mercurial installed. The ``/hgdev/venv-bootstrap/bin/hg`` executable
       
   170 is referenced by various scripts and the client.
       
   171 
       
   172 The ``/hgdev/src`` directory MUST contain a clone of the Mercurial
       
   173 source code. The state of the working directory is not important.
       
   174 
       
   175 In order to run tests, the ``/hgwork`` directory will be created.
       
   176 This may require running various ``mkfs.*`` executables and ``mount``
       
   177 to provision a new filesystem. This will require elevated privileges
       
   178 via ``sudo``.
       
   179 
       
   180 Various dependencies to run the Mercurial test harness are also required.
       
   181 Documenting them is beyond the scope of this document. Various tests
       
   182 also require other optional dependencies and missing dependencies will
       
   183 be printed by the test runner when a test is skipped.