Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONSchema ¶
func JSONSchema() string
Returns json schema for the payload part of the task definition. Please note we use a go string and do not load an external file, since we want this to be *part of the compiled executable*. If this sat in another file that was loaded at runtime, it would not be burned into the build, which would be bad for the following two reasons:
- we could no longer distribute a single binary file that didn't require installation/extraction
- the payload schema is specific to the version of the code, therefore should be versioned directly with the code and *frozen on build*.
Run `generic-worker show-payload-schema` to output this schema to standard out.
Types ¶
type D2GConfiguration ¶
type D2GConfiguration struct {
// Default: true
AllowChainOfTrust bool `json:"allowChainOfTrust" default:"true"`
// Default: true
AllowDisableSeccomp bool `json:"allowDisableSeccomp" default:"true"`
// Default: false
AllowGPUs bool `json:"allowGPUs" default:"false"`
AllowHostSharedMemory bool `json:"allowHostSharedMemory" default:"true"`
// Default: true
AllowInteractive bool `json:"allowInteractive" default:"true"`
// Default: true
AllowKVM bool `json:"allowKVM" default:"true"`
// Default: true
AllowLoopbackAudio bool `json:"allowLoopbackAudio" default:"true"`
// Default: true
AllowLoopbackVideo bool `json:"allowLoopbackVideo" default:"true"`
// Default: true
AllowPrivileged bool `json:"allowPrivileged" default:"true"`
// Default: true
AllowPtrace bool `json:"allowPtrace" default:"true"`
// Default: true
AllowTaskclusterProxy bool `json:"allowTaskclusterProxy" default:"true"`
// Default: "all"
Gpus string `json:"gpus" default:"all"`
}
Configuration options for the d2g translation
type D2GTestCases ¶
type D2GTestCases struct {
// A suite of tests for a particular d2g feature or set of features
TestSuite TestSuite `json:"testSuite"`
}
Static d2g input/output test cases. Contains pairs of Docker Worker task def/payload (inputs) and Generic Worker expected task def/payload (outputs).
type TaskDefinitionTestCase ¶
type TaskDefinitionTestCase struct {
// Configuration options for the d2g translation
D2GConfig D2GConfiguration `json:"d2gConfig"`
// Detailed information about what the test case tests
Description string `json:"description"`
// Additional properties allowed
DockerWorkerTaskDefinition json.RawMessage `json:"dockerWorkerTaskDefinition"`
// Additional properties allowed
GenericWorkerTaskDefinition json.RawMessage `json:"genericWorkerTaskDefinition"`
// Name for the test case
Name string `json:"name"`
}
A test case contains a static input Docker Worker task definition, and an expected Generic Worker task definition output. The Docker Worker task definition is converted by d2g to a Generic Worker task definition. The test is successful if the generated Generic Worker task definition exactly matches the Generic Worker task definition in the test case.
type TaskPayloadTestCase ¶
type TaskPayloadTestCase struct {
// Configuration options for the d2g translation
D2GConfig D2GConfiguration `json:"d2gConfig"`
// Detailed information about what the test case tests
Description string `json:"description"`
// Additional properties allowed
DockerWorkerTaskPayload json.RawMessage `json:"dockerWorkerTaskPayload"`
// Additional properties allowed
GenericWorkerTaskPayload json.RawMessage `json:"genericWorkerTaskPayload"`
// Name for the test case
Name string `json:"name"`
}
A test case contains a static input Docker Worker task payload, and an expected Generic Worker task payload output. The Docker Worker task payload is converted by d2g to a Generic Worker task payload. The test is successful if the generated Generic Worker task payload exactly matches the Generic Worker task payload in the test case.
type TestSuite ¶
type TestSuite struct {
// Detailed information about what the test cases do and do not test
Description string `json:"description"`
// Name for the test suite
Name string `json:"name"`
// The test cases which this test suite contains
PayloadTests []TaskPayloadTestCase `json:"payloadTests,omitempty"`
// The test cases which this test suite contains
TaskDefTests []TaskDefinitionTestCase `json:"taskDefTests,omitempty"`
}
A suite of tests for a particular d2g feature or set of features