author Gregory Szorc <gps@mozilla.com>
Fri, 29 Jul 2016 21:03:48 -0700
changeset 394583 25020657e91a320b83b9ccf9ed726334081e2d6c
parent 394324 738db6c78ddebfcff0b129a760e12b59128ecae9
permissions -rw-r--r--
Bug 1290620 - Use run-task from decision task; r?dustin This commit does a lot. But it's really not too difficult to comprehend once you focus on the final state, which is basically the same as the "lint" image and derived tasks. Before, the "decision" image contained a "checkout-gecko" script and "run-action" and "run-decision" scripts. The latter 2 invoked the first script. The "run-task" script basically does what the combination of these scripts were doing before. So we switch to it. While we're here, we also replaced the custom Mercurial installation in this image with the shared install-mercurial.sh script. The system-setup.sh script for the decision image is now short and sweet. The YAML files for tasks using this image have been updated to use "run-task." We no longer have to pass an environment variable to hold command arguments. So we revert to putting these arguments inline in the task's command. Dustin never liked passing the arguments as environment variables, so it should make him happy ;) We add --log-no-times because "run-task" prefixes its own timestamps on output lines. The path to the Gecko checkout has been changed from /home/worker/workspace to /home/worker/checkouts to match changes made in bug 1289643. Finally, since "checkout-gecko-and-run" is no longer used, we delete it. The Docker image version has been bumped accordingly. MozReview-Commit-ID: HAGuCz6668Q

version: 0
  name: 'Taskcluster tasks for Gecko'
  description: "The taskcluster task graph for Gecko trees"
  owner: mozilla-taskcluster-maintenance@mozilla.com
  source: {{{source}}}

  # Note the below scopes are insecure however these get overriden on the server
  # side to whatever scopes are set by mozilla-taskcluster.
  - queue:*
  - docker-worker:*
  - scheduler:*

# Available mustache parameters (see the mozilla-taskcluster source):
# - owner:          push user (email address)
# - source:         URL of this YAML file
# - url:            repository URL
# - project:        alias for the destination repository (basename of
#                   the repo url)
# - level:          SCM level of the destination repository
#                   (1 = try, 3 = core)
# - revision:       (short) hg revision of the head of the push
# - revision_hash:  (long) hg revision of the head of the push
# - comment:        comment of the push
# - pushlog_id:     id in the pushlog table of the repository
# and functions:
# - as_slugid:      convert a label into a slugId
# - from_now:       generate a timestamp at a fixed offset from now

  - taskId: '{{#as_slugid}}decision task{{/as_slugid}}'
      created: '{{now}}'
      deadline: '{{#from_now}}1 day{{/from_now}}'
      expires: '{{#from_now}}14 day{{/from_now}}'
        owner: mozilla-taskcluster-maintenance@mozilla.com
        source: {{{source}}}
        name: "Gecko Decision Task"
        description: |
            The task that creates all of the other tasks in the task graph

      workerType: "gecko-decision"
      provisionerId: "aws-provisioner-v1"

        createdForUser: {{owner}}

        # Bug 1269443: cache scopes, etc. must be listed explicitly
        - "docker-worker:cache:level-{{level}}-*"
        - "docker-worker:cache:tooltool-cache"
        # mozilla-taskcluster will append the appropriate assume:repo:<repo>
        # scope here.

        - "index.gecko.v2.{{project}}.latest.firefox.decision"
        - "tc-treeherder.v2.{{project}}.{{revision}}.{{pushlog_id}}"
        - "tc-treeherder-stage.v2.{{project}}.{{revision}}.{{pushlog_id}}"

          # checkout-gecko uses these to check out the source; the inputs
          # to `mach taskgraph decision` are all on the command line.
          GECKO_BASE_REPOSITORY: 'https://hg.mozilla.org/mozilla-unified'
          GECKO_HEAD_REPOSITORY: '{{{url}}}'
          GECKO_HEAD_REF: '{{revision}}'
          GECKO_HEAD_REV: '{{revision}}'

          level-{{level}}-hg-shared: /home/worker/hg-shared
          level-{{level}}-checkouts: /home/worker/checkouts

          taskclusterProxy: true

        # Note: This task is built server side without the context or tooling that
        # exist in tree so we must hard code the version
        image: 'taskcluster/decision:0.1.3'

        maxRunTime: 1800

        # TODO use mozilla-unified for the base repository once the tc-vcs
        # tar.gz archives are created or tc-vcs isn't being used.
          - /home/worker/bin/run-task
          - /home/worker/checkouts/gecko
          - '--'
          - bash
          - -cx
          - >
              cd /home/worker/checkouts/gecko &&
              ln -s /home/worker/artifacts artifacts &&
              ./mach --log-no-times taskgraph decision

            type: 'directory'
            path: '/home/worker/artifacts'
            expires: '{{#from_now}}7 days{{/from_now}}'

          symbol: D