Bug 1276409 - Use a generic ubuntu image as a base for the lint image, r=dustin
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 25 May 2016 09:32:10 -0400
changeset 338599 45beb943c93ec59e84ac39f30848a886b553fda6
parent 338598 8ab467b4554b19aca790fe53a8922fd45d2aa9a0
child 338600 0443ae0763bb88d4f6242f6afa2ae74f18b49927
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1276409
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1276409 - Use a generic ubuntu image as a base for the lint image, r=dustin The ES job uses an image based on the official node image. While this was convenient for eslint, it is a bit less convenient for other things. I want to use this image for all lint jobs, and switching the base to a generic ubuntu image seems a bit cleaner. I chose 16.04 for no good reason other than it is the most recent, and we might as well. Node v4.4.5 and taskcluster-vcs have been uploaded to tooltool. MozReview-Commit-ID: GngYeH98zO1
testing/docker/lint/Dockerfile
testing/docker/lint/system-setup.sh
testing/taskcluster/tasks/branches/base_jobs.yml
--- a/testing/docker/lint/Dockerfile
+++ b/testing/docker/lint/Dockerfile
@@ -1,22 +1,23 @@
-FROM          node:4.2
-MAINTAINER    Dave Townsend <dtownsend@oxymoronical.com>
+FROM          ubuntu:16.04
+MAINTAINER    Andrew Halberstadt <ahalberstadt@mozilla.com>
 
 RUN useradd -d /home/worker -s /bin/bash -m worker
 WORKDIR /home/worker
 
-# install necessary npm packages
-RUN           npm install -g taskcluster-vcs@2.3.12
-
 # Install tooltool directly from github.
 RUN mkdir /build
 ADD https://raw.githubusercontent.com/mozilla/build-tooltool/master/tooltool.py /build/tooltool.py
 RUN chmod +rx /build/tooltool.py
 
+# Install lint packages
+ADD           system-setup.sh   /tmp/system-setup.sh
+RUN           bash /tmp/system-setup.sh
+
 # Set variable normally configured at login, by the shells parent process, these
 # are taken from GNU su manual
 ENV           HOME          /home/worker
 ENV           SHELL         /bin/bash
 ENV           USER          worker
 ENV           LOGNAME       worker
 ENV           HOSTNAME      taskcluster-worker
 ENV           LANG          en_US.UTF-8
new file mode 100644
--- /dev/null
+++ b/testing/docker/lint/system-setup.sh
@@ -0,0 +1,65 @@
+#!/usr/bin/env bash
+# This allows ubuntu-desktop to be installed without human interaction
+export DEBIAN_FRONTEND=noninteractive
+
+set -ve
+
+test `whoami` == 'root'
+
+mkdir -p /setup
+cd /setup
+
+apt_packages=()
+apt_packages+=('curl')
+apt_packages+=('mercurial')
+apt_packages+=('python')
+apt_packages+=('xz-utils')
+
+apt-get update
+apt-get install -y ${apt_packages[@]}
+
+tooltool_fetch() {
+    cat >manifest.tt
+    /build/tooltool.py fetch
+    rm manifest.tt
+}
+
+
+###
+# ESLint Setup
+###
+
+# install node
+
+# For future reference things like this don't need to be uploaded to tooltool, as long
+# as we verify the hash, we can download it from the external net.
+tooltool_fetch <<'EOF'
+[
+{
+    "size": 8310316,
+    "digest": "95f4fa3d9b215348393dfac4a1c5eff72e9ef85dca38eb69cc8e6c1fe5aada0136c3b182dc04ed5c19fb69f0ac7df85d9c4045b9eb382fcb545b0ccacfece25b",
+    "algorithm": "sha512",
+    "filename": "node-v4.4.5-linux-x64.tar.xz"
+}
+]
+EOF
+tar -C /usr/local --strip-components 1 -xJ < node-*.tar.xz
+node -v  # verify
+npm -v
+
+# install taskcluster-vcs@2.3.12
+tooltool_fetch <<'EOF'
+[
+{
+"size": 6282161,
+"visibility": "public",
+"digest": "a781a96e596f6403eca6ec2300adb9c1a396659393e16993c66f98a658050e557bc681d521f70b50c1162aa4b435274e0098ffcbd37cbe969c0e4f69be19a1e0",
+"algorithm": "sha512",
+"filename": "taskcluster-vcs-v2.3.12.tar.gz"
+}
+]
+EOF
+npm install -g taskcluster-vcs-v2.3.12.tar.gz
+
+cd /
+rm -rf /setup
--- a/testing/taskcluster/tasks/branches/base_jobs.yml
+++ b/testing/taskcluster/tasks/branches/base_jobs.yml
@@ -504,16 +504,17 @@ tasks:
         - '**/*.xml'
         # Run when eslint policies change.
         - '**/.eslintignore'
         - '**/*eslintrc*'
         # The plugin implementing custom checks.
         - 'testing/eslint/eslint-plugin-mozilla/**'
         # Other misc lint related files.
         - 'tools/lint/**'
+        - 'testing/docker/lint/**'
   android-api-15-gradle-dependencies:
     task: tasks/builds/android_api_15_gradle_dependencies.yml
     root: true
     when:
       file_patterns:
         - 'mobile/android/config/**'
         - 'testing/docker/android-gradle-build/**'
         - 'testing/mozharness/configs/builds/releng_sub_android_configs/*gradle_dependencies.py'