Skip to content

Queue Server Configuration

Vladislav Alekseev edited this page Dec 27, 2019 · 23 revisions

This configuration is described by QueueServerRunConfiguration.swift source file. It defines how workers and queue operate.

Keys

analyticsConfiguration

This is a JSON object. It configures analytics services that Emcee can use to report various events.

To enable reporting to graphite, add graphiteConfiguration as below:

{
    "analyticsConfiguration": {
        "graphiteConfiguration": {
            "socketAddress": "graphite.example.com:2111",
            "metricPrefix": "your.own.emcee.graphite.prefix"
        }
    }
}

Replace graphite.example.com:2111 with your graphite address and port, and set your own graphite metric prefix instead of your.own.emcee.graphite.prefix.

To enable reporting to Sentry, add sentryConfiguration as below:

{
    "analyticsConfiguration": {
        "sentryConfiguration": {
            "dsn": "your_sentry_dsn"
        }
    }
}

You will need to specify Sentry DSN instead of your_sentry_dsn.

If you don't want any analytics, provide an empty JSON object:

{
    "analyticsConfiguration": {}
}

checkAgainTimeInterval and reportAliveInterval

This is currently an implementation detail of Emcee. It is recommended to set these values to 30 seconds.

checkAgainTimeInterval defines how often workers poll the queue for buckets to execute.

reportAliveInterval defines how often workers report their aliveness. If worker won't report aliveness for this amount of time, queue will consider the worker as silent (dead) and re-schedule its buckets back to queue to avoid losing them.

workerDeploymentDestinations

This is an array of computers that will be used as Emcee workers. The computer that is running shared queue can also be Emcee worker.

Each element of this array describes how Emcee can reach the computer.

This is an array of Deployment Destination objects.

deploymentDestinationConfigurations

This is an array of Destination Configuration objects. These objects describe the capabilities of each worker. Each worker must have its own destination configuration.

queueServerTerminationPolicy

Defines when queue will terminate itself. Useful if you upgrading Emcee on your CI. The previous version of Emcee queue will eventually terminate itself.

The following values are supported:

stayAlive

{
    "queueServerTerminationPolicy": {
        "caseId": "stayAlive"
    }
}

In this mode, Emcee queue server (and its workers) will not terminate automatically at all.

after

{
    "queueServerTerminationPolicy": {
        "caseId": "after",
        "period": 600
    }
}

In this mode, Emcee queue server will stop accepting new jobs after the given period of time (600 seconds in this example). Then it will finish all ongoing jobs and terminate itself.

afterBeingIdle

{
    "queueServerTerminationPolicy": {
        "caseId": "afterBeingIdle",
        "period": 600
    }
}

In this mode, Emcee queue server will stop accepting new jobs after being unused for the given period of time (600 seconds in this example). "Being used" means:

  • Workers send back test execution results (/bucketResult request)

  • Deleting job from the queue (/jobDelete request)

  • Fetching job results from the queue (/jobResults request)

  • Worker registration event (/registerWorker request)

  • Scheduling tests/creating new job event (/scheduleTests request)

Being unused means none of the events above happen for the given period of time. After being unused for long enough, queue will stop accepting new jobs. It will finish all ongoing jobs and then terminate itself.

Sample JSON Contents

{
    "analyticsConfiguration": {},
    "plugins": [],
    "checkAgainTimeInterval": 30,
    "reportAliveInterval": 30,
    "deploymentDestinationConfigurations": [
        {
            "destinationIdentifier": "test-runner01.example.com",
            "numberOfSimulators": 3
        },
        {
            "destinationIdentifier": "test-runner02.example.com",
            "numberOfSimulators": 6
        }
    ],
    "queueServerTerminationPolicy": {
        "caseId": "afterBeingIdle",
        "period": 3600
    },
    "workerDeploymentDestinations": [
        {
            "host": "test-runner01.example.com",
            "password": "password",
            "port": 22,
            "remote_deployment_path": "/Users/USER/remote_ui_tests.noindex/",
            "username": "USER"
        },
        {
            "host": "test-runner02.example.com",
            "password": "password",
            "port": 22,
            "remote_deployment_path": "/Users/USER/remote_ui_tests.noindex/",
            "username": "USER"
        }
    ]
}
Clone this wiki locally