Skip to content

Commit

Permalink
Bug 1648591: Remove taskgraph based cron implementation; r=aki
Browse files Browse the repository at this point in the history
  • Loading branch information
tomprince committed Jul 7, 2020
1 parent 6efb126 commit 3040c6e
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 497 deletions.
5 changes: 2 additions & 3 deletions .cron.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Definitions for jobs that run periodically. For details on the format, see
# `taskcluster/taskgraph/cron/schema.py`. For documentation, see
# `taskcluster/docs/cron.rst`.

# `https://hg.mozilla.org/ci/ci-admin/file/tip/build-decision/src/build_decision/cron/schema.yml`.
# For documentation, see `taskcluster/docs/cron.rst`.
---

jobs:
Expand Down
5 changes: 2 additions & 3 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is rendered via JSON-e by
# - mozilla-taskcluster - See
# https://docs.taskcluster.net/reference/integrations/mozilla-taskcluster/docs/taskcluster-yml
# - hg-push - https://hg.mozilla.org/ci/ci-admin/file/tip/build-decision/src/build_decision/hg_push.py
# {
# tasks_for: 'hg-push',
# push: {owner, comment, pushlog_id, pushdate},
Expand All @@ -10,7 +9,7 @@
# ownTaskId: // taskId of the task that will be created
# }
#
# - cron tasks - See taskcluster/taskgraph/cron/decision.py
# - cron tasks - https://hg.mozilla.org/ci/ci-admin/file/tip/build-decision/src/build_decision/cron/decision.py
# {
# tasks_for: 'cron',
# push: {revision, pushlog_id, pushdate, owner}
Expand Down
15 changes: 8 additions & 7 deletions taskcluster/docs/cron.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,22 @@ In the root of the Gecko directory, you will find `.cron.yml`. This defines
the periodic tasks ("cron jobs") run for Gecko. Each specifies a name, what to
do, and some parameters to determine when the cron job should occur.

See ``taskcluster/taskgraph/cron/schema.py`` for details on the format and
meaning of this file.
See `the scema <https://hg.mozilla.org/ci/ci-admin/file/tip/build-decision/src/build_decision/cron/schema.yml>`_
for details on the format and meaning of this file.

How It Works
------------

The `TaskCluster Hooks Service <https://firefox-ci-tc.services.mozilla.com/hooks>`_
has a hook configured for each repository supporting periodic task graphs. The
hook runs every 15 minutes, and the resulting task is referred to as a "cron task".
That cron task runs `./mach taskgraph cron` in a checkout of the Gecko source
tree.
That cron task runs the `build-decision
<https://hg.mozilla.org/ci/ci-admin/file/tip/build-decision>`_ image in a
checkout of the Gecko source tree.

The mach subcommand reads ``.cron.yml``, then consults the current time
(actually the time the cron task was created, rounded down to the nearest 15
minutes) and creates tasks for any cron jobs scheduled at that time.
The task reads ``.cron.yml``, then consults the current time (actually the time
the cron task was created, rounded down to the nearest 15 minutes) and creates
tasks for any cron jobs scheduled at that time.

Each cron job in ``.cron.yml`` specifies a ``job.type``, corresponding to a
function responsible for creating TaskCluster tasks when the job runs.
Expand Down
42 changes: 6 additions & 36 deletions taskcluster/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,43 +208,13 @@ def taskgraph_decision(self, **options):
sys.exit(1)

@SubCommand('taskgraph', 'cron',
description="Run the cron task")
@CommandArgument('--base-repository',
required=False,
help='(ignored)')
@CommandArgument('--head-repository',
required=True,
help='URL for "head" repository to fetch')
@CommandArgument('--head-ref',
required=False,
help='(ignored)')
@CommandArgument('--project',
required=True,
help='Project to use for creating tasks. Example: --project=mozilla-central')
@CommandArgument('--level',
required=True,
help='SCM level of this repository')
@CommandArgument('--force-run',
required=False,
help='If given, force this cronjob to run regardless of time, '
'and run no others')
@CommandArgument('--no-create',
required=False,
action='store_true',
help='Do not actually create tasks')
@CommandArgument('--root', '-r',
required=False,
help="root of the repository to get cron task definitions from")
description="Provide a pointer to the new `.cron.yml` handler.")
def taskgraph_cron(self, **options):
"""Run the cron task; this task creates zero or more decision tasks. It is run
from the hooks service on a regular basis."""
import taskgraph.cron
try:
self.setup_logging()
return taskgraph.cron.taskgraph_cron(options)
except Exception:
traceback.print_exc()
sys.exit(1)
print(
'Handling of ".cron.yml" files has move to '
"https://hg.mozilla.org/ci/ci-admin/file/tip/build-decision."
)
sys.exit(1)

@SubCommand('taskgraph', 'action-callback',
description='Run action callback used by action tasks')
Expand Down
157 changes: 0 additions & 157 deletions taskcluster/taskgraph/cron/__init__.py

This file was deleted.

84 changes: 0 additions & 84 deletions taskcluster/taskgraph/cron/decision.py

This file was deleted.

Loading

0 comments on commit 3040c6e

Please sign in to comment.