Skip to content
This repository was archived by the owner on May 9, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
env:
es6: true
node: true
extends: 'eslint:recommended'
parserOptions:
ecmaVersion: 8
ecmaVersion: 2018
sourceType: 'module'
ecmaFeatures: impliedStrict
extends: 'eslint:recommended'
rules:
indent:
- error
Expand Down
78 changes: 39 additions & 39 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ tasks:
taskclusterProxy:
true
env:
TASKCLUSTER_ROOT_URL: https://taskcluster.net
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The worker should set this for you anyway? But, doesn't hurt..

TASKCLUSTER_ROOT_URL: https://community-tc.services.mozilla.com
command:
- /bin/bash
- '--login'
Expand All @@ -43,24 +43,24 @@ tasks:
export DOCS_PROJECT=docker-worker DOCS_TIER=workers DOCS_FOLDER=docs DOCS_README=README.md &&
upload-project-docs
metadata:
name: "Publish docker-worker docs to https://docs.taskcluster.net/reference/workers/docker-worker"
description: "Upload docker-worker documentation to taskcluster [docs site](https://docs.taskcluster.net/reference/workers/docker-worker)."
name: "Publish docker-worker docs to https://docs.community-tc.services.mozilla.com/reference/workers/docker-worker"
description: "Upload docker-worker documentation to taskcluster [docs site](https://docs.community-tc.services.mozilla.com/reference/workers/docker-worker)."
owner: '{{ event.head.user.email }}'
source: '{{ event.head.repo.url }}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole task actually doesn't do anything anymore, and could be removed (but again doesn't hurt)


- provisionerId: aws-provisioner-v1
workerType: worker-ci-test
- provisionerId: proj-taskcluster
workerType: ci
retries: 0
scopes:
- 'docker-worker:cache:docker-worker-garbage-*'
- 'docker-worker:capability:privileged'
- 'docker-worker:capability:device:loopbackAudio'
- 'docker-worker:capability:device:loopbackVideo'
- 'secrets:get:repo:github.com/taskcluster/docker-worker:ci-creds'
- 'secrets:get:repo:github.com/taskcluster/docker-worker:pulse-creds'
- 'secrets:get:project/taskcluster/testing/docker-worker/ci-creds'
- 'secrets:get:project/taskcluster/testing/docker-worker/pulse-creds'
payload:
image: >-
taskcluster/worker-ci@sha256:2c6bf1eddb9c6f9b959ee5a596761297a7684c1da9e1e213c83fc96e66da1944
taskcluster/worker-ci@sha256:c0eec8cce5bc3c751e0424d20bb7cfdb8680fc217e62b34e26cc1f48c8dfea9d
maxRunTime: 10800
command:
- >-
Expand All @@ -72,7 +72,7 @@ tasks:
loopbackVideo: true
env:
WORKER_CI: '1'
TASKCLUSTER_ROOT_URL: https://taskcluster.net
TASKCLUSTER_ROOT_URL: https://community-tc.services.mozilla.com
features:
taskclusterProxy: true
metadata:
Expand All @@ -90,19 +90,19 @@ tasks:
- pull_request.synchronize
- pull_request.reopened

- provisionerId: aws-provisioner-v1
workerType: worker-ci-test
- provisionerId: proj-taskcluster
workerType: ci
retries: 3
scopes:
- 'docker-worker:cache:docker-worker-garbage-*'
- 'docker-worker:capability:privileged'
- 'docker-worker:capability:device:loopbackAudio'
- 'docker-worker:capability:device:loopbackVideo'
- 'secrets:get:repo:github.com/taskcluster/docker-worker:ci-creds'
- 'secrets:get:repo:github.com/taskcluster/docker-worker:pulse-creds'
- 'secrets:get:project/taskcluster/testing/docker-worker/ci-creds'
- 'secrets:get:project/taskcluster/testing/docker-worker/pulse-creds'
payload:
image: >-
taskcluster/worker-ci@sha256:2c6bf1eddb9c6f9b959ee5a596761297a7684c1da9e1e213c83fc96e66da1944
taskcluster/worker-ci@sha256:c0eec8cce5bc3c751e0424d20bb7cfdb8680fc217e62b34e26cc1f48c8dfea9d
maxRunTime: 10800
command:
- >-
Expand All @@ -115,7 +115,7 @@ tasks:
loopbackVideo: true
env:
WORKER_CI: '1'
TASKCLUSTER_ROOT_URL: https://taskcluster.net
TASKCLUSTER_ROOT_URL: https://community-tc.services.mozilla.com
features:
taskclusterProxy: true
metadata:
Expand All @@ -133,19 +133,19 @@ tasks:
- pull_request.synchronize
- pull_request.reopened

- provisionerId: aws-provisioner-v1
workerType: worker-ci-test
- provisionerId: proj-taskcluster
workerType: ci
retries: 3
scopes:
- 'docker-worker:cache:docker-worker-garbage-*'
- 'docker-worker:capability:privileged'
- 'docker-worker:capability:device:loopbackAudio'
- 'docker-worker:capability:device:loopbackVideo'
- 'secrets:get:repo:github.com/taskcluster/docker-worker:ci-creds'
- 'secrets:get:repo:github.com/taskcluster/docker-worker:pulse-creds'
- 'secrets:get:project/taskcluster/testing/docker-worker/ci-creds'
- 'secrets:get:project/taskcluster/testing/docker-worker/pulse-creds'
payload:
image: >-
taskcluster/worker-ci@sha256:2c6bf1eddb9c6f9b959ee5a596761297a7684c1da9e1e213c83fc96e66da1944
taskcluster/worker-ci@sha256:c0eec8cce5bc3c751e0424d20bb7cfdb8680fc217e62b34e26cc1f48c8dfea9d
maxRunTime: 10800
command:
- >-
Expand All @@ -158,7 +158,7 @@ tasks:
loopbackVideo: true
env:
WORKER_CI: '1'
TASKCLUSTER_ROOT_URL: https://taskcluster.net
TASKCLUSTER_ROOT_URL: https://community-tc.services.mozilla.com
features:
taskclusterProxy: true
metadata:
Expand All @@ -176,19 +176,19 @@ tasks:
- pull_request.synchronize
- pull_request.reopened

- provisionerId: aws-provisioner-v1
workerType: worker-ci-test
- provisionerId: proj-taskcluster
workerType: ci
retries: 3
scopes:
- 'docker-worker:cache:docker-worker-garbage-*'
- 'docker-worker:capability:privileged'
- 'docker-worker:capability:device:loopbackAudio'
- 'docker-worker:capability:device:loopbackVideo'
- 'secrets:get:repo:github.com/taskcluster/docker-worker:ci-creds'
- 'secrets:get:repo:github.com/taskcluster/docker-worker:pulse-creds'
- 'secrets:get:project/taskcluster/testing/docker-worker/ci-creds'
- 'secrets:get:project/taskcluster/testing/docker-worker/pulse-creds'
payload:
image: >-
taskcluster/worker-ci@sha256:2c6bf1eddb9c6f9b959ee5a596761297a7684c1da9e1e213c83fc96e66da1944
taskcluster/worker-ci@sha256:c0eec8cce5bc3c751e0424d20bb7cfdb8680fc217e62b34e26cc1f48c8dfea9d
maxRunTime: 10800
command:
- >-
Expand All @@ -201,7 +201,7 @@ tasks:
loopbackVideo: true
env:
WORKER_CI: '1'
TASKCLUSTER_ROOT_URL: https://taskcluster.net
TASKCLUSTER_ROOT_URL: https://community-tc.services.mozilla.com
features:
taskclusterProxy: true
metadata:
Expand All @@ -219,19 +219,19 @@ tasks:
- pull_request.synchronize
- pull_request.reopened

- provisionerId: aws-provisioner-v1
workerType: worker-ci-test
- provisionerId: proj-taskcluster
workerType: ci
retries: 3
scopes:
- 'docker-worker:cache:docker-worker-garbage-*'
- 'docker-worker:capability:privileged'
- 'docker-worker:capability:device:loopbackAudio'
- 'docker-worker:capability:device:loopbackVideo'
- 'secrets:get:repo:github.com/taskcluster/docker-worker:ci-creds'
- 'secrets:get:repo:github.com/taskcluster/docker-worker:pulse-creds'
- 'secrets:get:project/taskcluster/testing/docker-worker/ci-creds'
- 'secrets:get:project/taskcluster/testing/docker-worker/pulse-creds'
payload:
image: >-
taskcluster/worker-ci@sha256:2c6bf1eddb9c6f9b959ee5a596761297a7684c1da9e1e213c83fc96e66da1944
taskcluster/worker-ci@sha256:c0eec8cce5bc3c751e0424d20bb7cfdb8680fc217e62b34e26cc1f48c8dfea9d
maxRunTime: 10800
command:
- >-
Expand All @@ -244,7 +244,7 @@ tasks:
loopbackVideo: true
env:
WORKER_CI: '1'
TASKCLUSTER_ROOT_URL: https://taskcluster.net
TASKCLUSTER_ROOT_URL: https://community-tc.services.mozilla.com
features:
taskclusterProxy: true
metadata:
Expand All @@ -262,19 +262,19 @@ tasks:
- pull_request.synchronize
- pull_request.reopened

- provisionerId: aws-provisioner-v1
workerType: worker-ci-test
- provisionerId: proj-taskcluster
workerType: ci
retries: 3
scopes:
- 'docker-worker:cache:docker-worker-garbage-*'
- 'docker-worker:capability:privileged'
- 'docker-worker:capability:device:loopbackAudio'
- 'docker-worker:capability:device:loopbackVideo'
- 'secrets:get:repo:github.com/taskcluster/docker-worker:ci-creds'
- 'secrets:get:repo:github.com/taskcluster/docker-worker:pulse-creds'
- 'secrets:get:project/taskcluster/testing/docker-worker/ci-creds'
- 'secrets:get:project/taskcluster/testing/docker-worker/pulse-creds'
payload:
image: >-
taskcluster/worker-ci@sha256:2c6bf1eddb9c6f9b959ee5a596761297a7684c1da9e1e213c83fc96e66da1944
taskcluster/worker-ci@sha256:c0eec8cce5bc3c751e0424d20bb7cfdb8680fc217e62b34e26cc1f48c8dfea9d
maxRunTime: 10800
command:
- >-
Expand All @@ -287,7 +287,7 @@ tasks:
loopbackVideo: true
env:
WORKER_CI: '1'
TASKCLUSTER_ROOT_URL: https://taskcluster.net
TASKCLUSTER_ROOT_URL: https://community-tc.services.mozilla.com
features:
taskclusterProxy: true
metadata:
Expand Down
2 changes: 2 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ Vagrant.configure("2") do |config|
# Setup Taskcluster and Pulse Credentials if available
echo 'export TASKCLUSTER_CLIENT_ID="#{ENV['TASKCLUSTER_CLIENT_ID']}"' >> /home/vagrant/.bash_profile
echo 'export TASKCLUSTER_ACCESS_TOKEN="#{ENV['TASKCLUSTER_ACCESS_TOKEN']}"' >> /home/vagrant/.bash_profile
echo 'export TASKCLUSTER_ROOT_URL="#{ENV['TASKCLUSTER_ROOT_URL']}"' >> /home/vagrant/.bash_profile
echo 'export PULSE_USERNAME="#{ENV['PULSE_USERNAME']}"' >> /home/vagrant/.bash_profile
echo 'export PULSE_PASSWORD="#{ENV['PULSE_PASSWORD']}"' >> /home/vagrant/.bash_profile
echo 'set -o vi' >> /home/vagrant/.bash_profile

SCRIPT

Expand Down
9 changes: 0 additions & 9 deletions src/bin/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@ var overridableFields = [
'provisionerId'
];

function sanitizeGraphPath() {
return Array.prototype.slice.call(arguments).reduce(function(result, v) {
if (!v) return result;
// Remove any dots which can get confused...
result.push(v.replace('.', '-'));
return result;
}, []).join('.');
}

function verifySSLCertificates(config) {
try {
fs.statSync(config.ssl.certificate);
Expand Down
3 changes: 1 addition & 2 deletions src/lib/docker/artifact_image.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ const Debug = require('debug');
const fs = require('mz/fs');
const { spawn } = require('child_process');
const slugid = require('slugid');
const {Transform} = require('stream');
const path = require('path');
const tarfs = require('tar-fs');
const {scopeMatch} = require('../scopes');
const pipe = require('promisepipe');

const {makeDir, removeDir} = require('../util/fs');
const {fmtLog, fmtErrorLog} = require('../log');
const {fmtLog} = require('../log');
const downloadArtifact = require('../util/artifact_download');
const sleep = require('../util/sleep');

Expand Down
3 changes: 0 additions & 3 deletions src/lib/docker/indexed_image.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
const Debug = require('debug');
const taskcluster = require('taskcluster-client');

const ArtifactImage = require('./artifact_image');

let debug = Debug('docker-worker:indexedImage');

/*
* Image manager for indexed images.
*/
Expand Down
1 change: 0 additions & 1 deletion src/lib/features/balrog_stage_vpn_proxy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const assert = require('assert');
const Debug = require('debug');
const { scopeMatch } = require('../scopes');
const got = require('got');
Expand Down
1 change: 0 additions & 1 deletion src/lib/features/balrog_vpn_proxy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const assert = require('assert');
const Debug = require('debug');
const { scopeMatch } = require('../scopes');
const got = require('got');
Expand Down
2 changes: 0 additions & 2 deletions src/lib/features/bulk_log.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ to s3 after the task has completed running.

const Debug = require('debug');
const fs = require('mz/fs');
const https = require('https');
const streamClosed = require('../stream_closed');
const temporary = require('temporary');
const uploadToS3 = require('../upload_to_s3');
const url = require('url');
const zlib = require('zlib');

var debug = Debug('taskcluster-docker-worker:features:bulk_log');
Expand Down
2 changes: 1 addition & 1 deletion src/lib/features/chain_of_trust.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const streamClosed = require('../stream_closed');
const temporary = require('temporary');
const uploadToS3 = require('../upload_to_s3');
const zlib = require('zlib');
const {fmtLog, fmtErrorLog} = require('../log');
const {fmtErrorLog} = require('../log');

let debug = Debug('taskcluster-docker-worker:features:cot');

Expand Down
1 change: 0 additions & 1 deletion src/lib/features/interactive.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const assert = require('assert');
const Debug = require('debug');
const {DockerExecServer} = require('docker-exec-websocket-server');
const fs = require('mz/fs');
Expand Down
16 changes: 0 additions & 16 deletions src/lib/gc.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
var EventEmitter = require('events').EventEmitter;
var parseImage = require('docker-image-parser');
var debug = require('debug')('taskcluster-docker-worker:garbageCollector');
var exceedsDiskspaceThreshold = require('./util/capacity').exceedsDiskspaceThreshold;

async function getImageId(docker, imageName) {
var dockerImages = await docker.listImages();
var imageId;
dockerImages.forEach(function (dockerImage) {
if (dockerImage.RepoTags.indexOf(imageName) !== -1) {
imageId = dockerImage.Id;
}
});
return imageId;
}

function isContainerRunning(container) {
return (container['Status'].indexOf('Exited') === -1);
}

async function isContainerStale(docker, container, expiration) {
// Containers can be running, exited, or no status (created but not started).
// For a container exited or never ran so has no status, inspect() returns
Expand Down
3 changes: 0 additions & 3 deletions src/lib/host/packet.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Return the appropriate configuration defaults when on packet.net.
*/

const Debug = require('debug');
const got = require('got-promise');
const { createLogger } = require('../log');
const { spawn } = require('child_process');
Expand All @@ -11,8 +10,6 @@ const assert = require('assert');
const fs = require('fs');
const taskcluster = require('taskcluster-client');

const debug = Debug('docker-worker:host:packet');

const log = createLogger({
source: 'host/packet'
});
Expand Down
3 changes: 0 additions & 3 deletions src/lib/shutdown_manager.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
const { EventEmitter } = require('events');
const { spawn } = require('child_process');
const Debug = require('debug');

let debug = Debug('docker-worker:shutdown_manager');

class ShutdownManager extends EventEmitter {
constructor(host, config) {
Expand Down
Loading