gecko-dev/taskcluster/docs/caches.rst
Gregory Szorc 96fa6fe838 Bug 1289643 - Change path for checkouts from "workspace" to "checkouts"; r=dustin
Currently, TaskCluster tasks tend to use the "workspace" directory as
a cache that manages the source checkout *and* additional state.

Historically at Mozilla, we've lumped "source checkout" and "workspace"
(sometimes known as an "objdir") into the same directory. This is
not ideal. Ideally, there is an immutable, read-only source checkout
and all files produced from that source live in a separate directory.

In this commit, the "workspace" directory for the "lint" image has been
renamed to "checkouts" and all tasks using the image have been updated
accordingly. By having "checkout" in the name, we clearly identify this
cache as being relevant to source checkouts, which IMO can serve a
different role from "workspaces." This distinction is important, as the
next commit will prevent the "checkouts" cache from getting optimized
out in certain tasks.

To hammer this point home, documentation on common caches has been
introduced.

MozReview-Commit-ID: BSEc4dM5YCt

--HG--
extra : rebase_source : 5a62939e066d3723736b41e14007112d92346684
2016-07-29 10:44:19 -07:00

44 lines
1.6 KiB
ReStructuredText

.. taskcluster_caches:
=============
Common Caches
=============
There are various caches used by the in-tree tasks. This page attempts to
document them and their appropriate use.
Version Control Caches
======================
level-{{level}}-hg-shared
This cache holds Mercurial *stores*: this is the historical data of a
Mercurial repository (as opposed to a checkout or working directory).
This cache should ideally be written to by the ``hg robustcheckout``
command, which is the preferred mechanism to clone a Mercurial repository
in automation.
When using ``hg robustcheckout``, data for the same logical repository
will automatically be stored in the same directory in this cache. e.g.
data for the Firefox repository will be in the directory
``8ba995b74e18334ab3707f27e9eb8f4e37ba3d29``, which is the SHA-1 of the
first revision in the Firefox repository. This helps ensure that any
given changeset is only stored once in the cache. This is why there is
no ``{{project}}`` component in the cache name.
level-{{level}}-checkouts
This cache holds version control checkouts or working directories. This
is distinct from the cache that holds the version control *store* data.
Ideally, checkouts should be read-only. If a task needs to create new
files from content of a checkout, this content should be written in
a separate directory/cache (like a workspace).
Workspace Caches
================
level-{{level}}-*-workspace
These caches (of various names typically ending with ``workspace``)
contain state to be shared between task invocations. Use cases are
dependent on the task.