Skip to content
This repository was archived by the owner on Feb 20, 2020. It is now read-only.

Commit 17d901e

Browse files
author
Wander Lairson Costa
committed
Bug 1502337: Initial support for docker-worker payloads
This commit implements the initial support for docker-worker payloads. So far, only the Image, Command, Env and MaxRunTime fields are supported. It hasn't been extensive tested so features like task cancellation may not work. Also, it doesn't implement custom artifacts and more extensive tests. The support for docker-worker payloads is achieved through build flags. To build with docker-worker paylod, build it with the "docker" flag, like so: $ go build -tags=docker Notice that generic-worker will not be supported in this build. We also needed to upgrade golang due to a bug in the go compiler [1]. [1] golang/go#25908
1 parent 05c1574 commit 17d901e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1508
-305
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,6 @@ directory-caches.json
4747
file-caches.json
4848
tasks-resolved-count.txt
4949
/revision.txt
50+
51+
# binary file
52+
generic-worker

.taskcluster.yml

+38-38
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ tasks:
7070
maxRunTime: 3600
7171
command:
7272
- set CGO_ENABLED=0
73-
- set GOPATH=%CD%\gopath1.10.3
74-
- set GOROOT=%CD%\go1.10.3\go
73+
- set GOPATH=%CD%\gopath1.10.4
74+
- set GOROOT=%CD%\go1.10.4\go
7575
- set PATH=%CD%\git\cmd;%GOPATH%\bin;%GOROOT%\bin;%PATH%
7676
- git config --global core.autocrlf false
7777
- go version
@@ -111,16 +111,16 @@ tasks:
111111
- ineffassign .
112112
artifacts:
113113
- name: public/build/generic-worker-windows-amd64.exe
114-
path: gopath1.10.3\bin\generic-worker.exe
114+
path: gopath1.10.4\bin\generic-worker.exe
115115
expires: "{{ '2 weeks' | $fromNow }}"
116116
type: file
117117
mounts:
118118
- cacheName: generic-worker-checkout
119-
directory: gopath1.10.3\src
119+
directory: gopath1.10.4\src
120120
- content:
121-
url: https://storage.googleapis.com/golang/go1.10.3.windows-amd64.zip
122-
sha256: a3f19d4fc0f4b45836b349503e347e64e31ab830dedac2fc9c390836d4418edb
123-
directory: go1.10.3
121+
url: https://storage.googleapis.com/golang/go1.10.4.windows-amd64.zip
122+
sha256: 5499aa98399664df8dc1da5c3aaaed14b3130b79c713b5677a0ee9e93854476c
123+
directory: go1.10.4
124124
format: zip
125125
- content:
126126
url: https://github.com/git-for-windows/git/releases/download/v2.14.1.windows.1/MinGit-2.14.1-64-bit.zip
@@ -152,8 +152,8 @@ tasks:
152152
maxRunTime: 3600
153153
command:
154154
- set CGO_ENABLED=0
155-
- set GOPATH=%CD%\gopath1.10.3
156-
- set GOROOT=%CD%\go1.10.3\go
155+
- set GOPATH=%CD%\gopath1.10.4
156+
- set GOROOT=%CD%\go1.10.4\go
157157
- set PATH=%CD%\git\bin;%GOPATH%\bin;%GOROOT%\bin;%PATH%
158158
- git config --global core.autocrlf false
159159
- go version
@@ -182,16 +182,16 @@ tasks:
182182
- ineffassign .
183183
artifacts:
184184
- name: public/build/generic-worker-windows-386.exe
185-
path: gopath1.10.3\bin\generic-worker.exe
185+
path: gopath1.10.4\bin\generic-worker.exe
186186
expires: "{{ '2 weeks' | $fromNow }}"
187187
type: file
188188
mounts:
189189
- cacheName: generic-worker-checkout
190-
directory: gopath1.10.3\src
190+
directory: gopath1.10.4\src
191191
- content:
192-
url: https://storage.googleapis.com/golang/go1.10.3.windows-386.zip
193-
sha256: 89696a29bdf808fa9861216a21824ae8eb2e750a54b1424ce7f2a177e5cd1466
194-
directory: go1.10.3
192+
url: https://storage.googleapis.com/golang/go1.10.4.windows-386.zip
193+
sha256: 407e5619048c427de4a65b26edb17d54c220f8c30ebd358961b1785a38394ec9
194+
directory: go1.10.4
195195
format: zip
196196
- content:
197197
url: https://github.com/git-for-windows/git/releases/download/v2.11.0.windows.3/Git-2.11.0.3-32-bit.tar.bz2
@@ -223,8 +223,8 @@ tasks:
223223
maxRunTime: 3600
224224
command:
225225
- set CGO_ENABLED=0
226-
- set GOPATH=%CD%\gopath1.10.3
227-
- set GOROOT=%CD%\go1.10.3\go
226+
- set GOPATH=%CD%\gopath1.10.4
227+
- set GOROOT=%CD%\go1.10.4\go
228228
- set PATH=%CD%\git\cmd;%GOPATH%\bin;%GOROOT%\bin;%PATH%
229229
- git config --global core.autocrlf false
230230
- go version
@@ -264,16 +264,16 @@ tasks:
264264
- ineffassign .
265265
artifacts:
266266
- name: public/build/generic-worker-windows-amd64.exe
267-
path: gopath1.10.3\bin\generic-worker.exe
267+
path: gopath1.10.4\bin\generic-worker.exe
268268
expires: "{{ '2 weeks' | $fromNow }}"
269269
type: file
270270
mounts:
271271
- cacheName: generic-worker-checkout
272-
directory: gopath1.10.3\src
272+
directory: gopath1.10.4\src
273273
- content:
274-
url: https://storage.googleapis.com/golang/go1.10.3.windows-amd64.zip
275-
sha256: a3f19d4fc0f4b45836b349503e347e64e31ab830dedac2fc9c390836d4418edb
276-
directory: go1.10.3
274+
url: https://storage.googleapis.com/golang/go1.10.4.windows-amd64.zip
275+
sha256: 5499aa98399664df8dc1da5c3aaaed14b3130b79c713b5677a0ee9e93854476c
276+
directory: go1.10.4
277277
format: zip
278278
- content:
279279
url: https://github.com/git-for-windows/git/releases/download/v2.14.1.windows.1/MinGit-2.14.1-64-bit.zip
@@ -308,8 +308,8 @@ tasks:
308308
- -vxec
309309
- |
310310
export CGO_ENABLED=0
311-
export GOROOT="$(pwd)/go1.10.3/go"
312-
export GOPATH="$(pwd)/gopath1.10.3"
311+
export GOROOT="$(pwd)/go1.10.4/go"
312+
export GOPATH="$(pwd)/gopath1.10.4"
313313
export PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"
314314
go version
315315
go env
@@ -335,16 +335,16 @@ tasks:
335335
ineffassign .
336336
artifacts:
337337
- name: public/build/generic-worker-darwin-amd64
338-
path: gopath1.10.3/bin/generic-worker
338+
path: gopath1.10.4/bin/generic-worker
339339
expires: "{{ '2 weeks' | $fromNow }}"
340340
type: file
341341
mounts:
342342
- cacheName: generic-worker-checkout
343-
directory: gopath1.10.3/src
343+
directory: gopath1.10.4/src
344344
- content:
345-
url: https://storage.googleapis.com/golang/go1.10.3.darwin-amd64.tar.gz
346-
sha256: 131fd430350a3134d352ee75c5ca456cdf4443e492d0527a9651c7c04e2b458d
347-
directory: go1.10.3
345+
url: https://storage.googleapis.com/golang/go1.10.4.darwin-amd64.tar.gz
346+
sha256: 2ba324f01de2b2ece0376f6d696570a4c5c13db67d00aadfd612adc56feff587
347+
directory: go1.10.4
348348
format: tar.gz
349349

350350

@@ -380,8 +380,8 @@ tasks:
380380
# - -vxec
381381
# - |
382382
# export CGO_ENABLED=0
383-
# export GOROOT="$(pwd)/go1.10.3/go"
384-
# export GOPATH="$(pwd)/gopath1.10.3"
383+
# export GOROOT="$(pwd)/go1.10.4/go"
384+
# export GOPATH="$(pwd)/gopath1.10.4"
385385
# export PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"
386386
# export CGO_ENABLED=0
387387
# go version
@@ -407,16 +407,16 @@ tasks:
407407
# ineffassign .
408408
# artifacts:
409409
# - name: public/build/generic-worker-linux-armv6l
410-
# path: gopath1.10.3/bin/generic-worker
410+
# path: gopath1.10.4/bin/generic-worker
411411
# expires: "{{ '2 weeks' | $fromNow }}"
412412
# type: file
413413
# mounts:
414414
# - cacheName: generic-worker-checkout
415-
# directory: gopath1.10.3/src
415+
# directory: gopath1.10.4/src
416416
# - content:
417-
# url: https://storage.googleapis.com/golang/go1.10.3.linux-armv6l.tar.gz
417+
# url: https://storage.googleapis.com/golang/go1.10.4.linux-armv6l.tar.gz
418418
# sha256: d3df3fa3d153e81041af24f31a82f86a21cb7b92c1b5552fb621bad0320f06b6
419-
# directory: go1.10.3
419+
# directory: go1.10.4
420420
# format: tar.gz
421421

422422

@@ -472,13 +472,13 @@ tasks:
472472
"${GOPATH}/bin/ineffassign" .
473473
artifacts:
474474
- name: public/build/generic-worker-linux-amd64
475-
path: gopath1.10.1/bin/generic-worker
475+
path: gopath1.10.4/bin/generic-worker
476476
expires: "{{ '2 weeks' | $fromNow }}"
477477
type: file
478478
mounts:
479479
- cacheName: generic-worker-checkout
480-
directory: gopath1.10.1/src
480+
directory: gopath1.10.4/src
481481
- content:
482-
url: https://storage.googleapis.com/golang/go1.10.1.linux-amd64.tar.gz
483-
directory: go1.10.1
482+
url: https://storage.googleapis.com/golang/go1.10.4.linux-amd64.tar.gz
483+
directory: go1.10.4
484484
format: tar.gz

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: go
22
go:
3-
- "1.10.3"
3+
- "1.10.4"
44

55
env:
66
- "CGO_ENABLED=0 GIMME_OS=linux GIMME_ARCH=386"

artifacts_test.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build !docker
2+
13
package main
24

35
import (
@@ -13,17 +15,10 @@ import (
1315
"golang.org/x/crypto/openpgp"
1416
"golang.org/x/crypto/openpgp/clearsign"
1517

16-
"github.com/taskcluster/slugid-go/slugid"
1718
tcclient "github.com/taskcluster/taskcluster-client-go"
1819
"github.com/taskcluster/taskcluster-client-go/tcqueue"
1920
)
2021

21-
var (
22-
// all tests can share taskGroupId so we can view all test tasks in same
23-
// graph later for troubleshooting
24-
taskGroupID = slugid.Nice()
25-
)
26-
2722
func validateArtifacts(
2823
t *testing.T,
2924
payloadArtifacts []Artifact,

aws_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build !docker
2+
13
package main
24

35
import (

chain_of_trust_all-unix-style.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build !windows
1+
// +build !windows,!docker
22

33
package main
44

chain_of_trust_docker.go

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// +build docker
2+
3+
package main
4+
5+
func (cot *ChainOfTrustTaskFeature) ensureTaskUserCantReadPrivateCotKey() error {
6+
return nil
7+
}
8+
9+
func secureSigningKey() error {
10+
return nil
11+
}

docker_linux.go

-46
This file was deleted.

0 commit comments

Comments
 (0)