Scriptworker Readme

https://travis-ci.org/mozilla-releng/scriptworker.svg?branch=master https://coveralls.io/repos/github/mozilla-releng/scriptworker/badge.svg?branch=master Documentation Status

Scriptworker implements the TaskCluster worker model, then launches a pre-defined script.

This worker was designed for Releng processes that need specific, limited, and pre-defined capabilities.

Free software: MPL2 license

Usage

Credentials can live in ./scriptworker.yaml, ./secrets.json, ~/.scriptworker, or in environment variables: TASKCLUSTER_ACCESS_TOKEN, TASKCLUSTER_CLIENT_ID, and TASKCLUSTER_CERTIFICATE.

  • Launch: scriptworker [config_path]

Building a docker image

First, create a secrets.json. For integration testing, you’ll need to define the integration_credentials; to do any other authenticated work, you’ll need to define credentials.

Then:

PY_DOT_VERSION=3.7  # or 3.6
docker build -t scriptworker-test-$PY_DOT_VERSION --build-arg PY_DOT_VERSION=$PY_DOT_VERSION  --file docker/Dockerfile.test .

Testing

Note: GPG tests require gpg 2.0.x!

Without integration tests, install tox, then

NO_TESTS_OVER_WIRE=1 tox -e py36

With integration tests, first create a client with the scopes:

assume:project:taskcluster:worker-test-scopes
queue:cancel-task:test-dummy-scheduler/*

Then create a ./secrets.json or ~/.scriptworker that looks like:

{
    "integration_credentials": {
        "clientId": "...",
        "accessToken": "...",
        "certificate": "..."
    }
}

(certificate is only specified if using temp creds)

then

tox

It’s also possible to test in docker. First, build the docker image, making sure to add integration credentials to secrets.json. Then:

docker run -i scriptworker-test-$PY_DOT_VERSION

GPG Homedir testing

Sometimes it’s nice to be able to test things like rebuild_gpg_homedirs. To do so, build the docker image, then:

docker run -i scriptworker-test-$PY_DOT_VERSION gpg
# in the docker shell,
rebuild_gpg_homedirs gnupg.yaml

Indices and tables