This repository has been archived by the owner on Feb 27, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added script-config.yml example and example script
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Example configuration file for script engine deployment on hardware. | ||
transforms: | ||
- abs | ||
- env | ||
- secrets | ||
config: | ||
capacity: 1 | ||
credentials: | ||
# Taskcluster credentials with scopes like: | ||
# - assume:project:taskcluster:worker-test-scopes | ||
clientId: {$env: TASKCLUSTER_CLIENT_ID} | ||
accessToken: {$env: TASKCLUSTER_ACCESS_TOKEN} | ||
provisionerId: {$env: PROVISIONER_ID} # test-dummy-provisioner | ||
workerType: {$env: WORKER_TYPE} # dummy-worker-* | ||
workerGroup: {$env: WORKER_GROUP} # test-dummy-workers | ||
workerId: {$env: WORKER_ID} # dummy-worker-* | ||
engine: script | ||
engines: | ||
script: | ||
# Command should: | ||
# - Read JSON payload from stdin, | ||
# - Read TASK_ID and RUN_ID environment variables (if it wants them), | ||
# - Print log to stdout | ||
# - Write artifacts to working directory (a temporary folder is given) | ||
# - Exit zero to indicate successful task completetion | ||
command: ['python', {$abs: 'examples/script.py'}] | ||
schema: # schema for task.payload passed to command over stdin | ||
type: object | ||
properties: | ||
buildUrl: {type: string} | ||
required: | ||
- buildUrl | ||
expiration: 14 # artifact expiration in days | ||
logLevel: debug | ||
plugins: | ||
disabled: | ||
- interactive | ||
- artifacts | ||
- env | ||
pollingInterval: 5 | ||
queueBaseUrl: https://queue.taskcluster.net/v1 | ||
reclaimOffset: 120 | ||
temporaryFolder: /tmp/tc-worker/ | ||
serverIp: 127.0.0.1 | ||
serverPort: 8080 | ||
tlsCertificiate: '' | ||
tlsKey: '' | ||
statelessDNSSecret: '' | ||
statelessDNSDomain: 'localhost.local' # livelog won't work with this | ||
maxLifeCycle: 3600 # 1 hour | ||
minimumDiskSpace: 10000000 # 10 GB | ||
minimumMemory: 1000000 # 1 GB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env python | ||
import sys, json | ||
|
||
payload = json.loads(sys.stdin.read()) | ||
|
||
print "Payload given:" | ||
print payload |