Skip to content

Commit

Permalink
refactor!: remove 'cache-dotcache' key
Browse files Browse the repository at this point in the history
  • Loading branch information
ahal committed Jan 20, 2025
1 parent 4820778 commit cda7368
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 27 deletions.
19 changes: 18 additions & 1 deletion docs/reference/migrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ Migration Guide

This page can help when migrating Taskgraph across major versions.

12.x -> 13.x
------------

* Remove all ``run.cache-dotcache`` keys. If it was set to ``true``, replace it
with:

.. code-block:: yaml
run:
use-caches: [checkout, <caches>]
Where caches can be any of ``cargo``, ``pip``, ``uv`` or ``npm``. If the task
was setting up ``.cache`` for another tool, a mount will need to be created
for it manually. If ``use-caches`` was previously set to ``false``, omit
``checkout`` in the example above. If ``use-caches`` was previously set to
``true``, replace ``true`` with the value above (including ``checkout``).

11.x -> 12.x
------------

Expand Down Expand Up @@ -110,7 +127,7 @@ This page can help when migrating Taskgraph across major versions.
5.x -> 6.x
----------

* Replace all uses of ``command-context` with the more generalized ``task-context``
* Replace all uses of ``command-context`` with the more generalized ``task-context``

4.x -> 5.x
----------
Expand Down
22 changes: 0 additions & 22 deletions src/taskgraph/transforms/run/run_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
run_task_schema = Schema(
{
Required("using"): "run-task",
# if true, add a cache at ~worker/.cache, which is where things like pip
# tend to hide their caches. This cache is never added for level-1 tasks.
# TODO Once bug 1526028 is fixed, this and 'use-caches' should be merged.
Required("cache-dotcache"): bool,
# Which caches to use. May take a boolean in which case either all
# (True) or no (False) caches will be used. Alternatively, it can
# accept a list of caches to enable. Defaults to only the checkout cache
Expand Down Expand Up @@ -115,7 +111,6 @@ def common_setup(config, task, taskdesc, command):


worker_defaults = {
"cache-dotcache": False,
"checkout": True,
"sparse-profile": None,
"run-as-root": False,
Expand All @@ -142,16 +137,6 @@ def docker_worker_run_task(config, task, taskdesc):
command = run.pop("run-task-command", ["/usr/local/bin/run-task"])
common_setup(config, task, taskdesc, command)

if run.get("cache-dotcache"):
worker["caches"].append(
{
"type": "persistent",
"name": "{project}-dotcache".format(**config.params),
"mount-point": "{workdir}/.cache".format(**run),
"skip-untrusted": True,
}
)

run_command = run["command"]

# dict is for the case of `{'task-reference': str}`.
Expand Down Expand Up @@ -184,13 +169,6 @@ def generic_worker_run_task(config, task, taskdesc):
common_setup(config, task, taskdesc, command)

worker.setdefault("mounts", [])
if run.get("cache-dotcache"):
worker["mounts"].append(
{
"cache-name": "{project}-dotcache".format(**config.params),
"directory": "{workdir}/.cache".format(**run),
}
)
worker["mounts"].append(
{
"content": {
Expand Down
2 changes: 1 addition & 1 deletion taskcluster/docker/python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM debian:bookworm-slim
LABEL maintainer="Release Engineering <[email protected]>"

VOLUME /builds/worker/checkouts
VOLUME /builds/worker/.cache
VOLUME /builds/worker/.task-cache/uv

# Add worker user
RUN mkdir -p /builds && \
Expand Down
2 changes: 1 addition & 1 deletion taskcluster/kinds/check/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ task-defaults:
run:
using: run-task
cwd: '{checkout}'
cache-dotcache: true
use-caches: [checkout, uv]

tasks:
type:
Expand Down
1 change: 1 addition & 0 deletions taskcluster/kinds/codecov/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ tasks:
run:
using: run-task
cwd: '{checkout}'
use-caches: [checkout, uv]
command: >-
uv run coverage combine --data-file $MOZ_FETCHES_DIR/coverage $MOZ_FETCHES_DIR &&
uv run coverage xml --data-file $MOZ_FETCHES_DIR/coverage -o $MOZ_FETCHES_DIR/coverage.xml &&
Expand Down
2 changes: 1 addition & 1 deletion taskcluster/kinds/doc/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ task-defaults:
run:
using: run-task
cwd: '{checkout}'
cache-dotcache: true
use-caches: [checkout, uv]

tasks:
generate:
Expand Down
2 changes: 1 addition & 1 deletion taskcluster/kinds/test/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ task-defaults:
run:
using: run-task
cwd: '{checkout}'
cache-dotcache: true
use-caches: [checkout, uv]

tasks:
unit:
Expand Down

0 comments on commit cda7368

Please sign in to comment.