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

Commit

Permalink
Added script-config.yml example and example script
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasfj committed Oct 12, 2016
1 parent b72e5cc commit 42861aa
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
52 changes: 52 additions & 0 deletions examples/script-config.yml
@@ -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
7 changes: 7 additions & 0 deletions examples/script.py
@@ -0,0 +1,7 @@
#!/usr/bin/env python
import sys, json

payload = json.loads(sys.stdin.read())

print "Payload given:"
print payload

0 comments on commit 42861aa

Please sign in to comment.