media_nommer.conf

This module contains settings-related things that are used by ec2nommerd and feederd. You will most likely be interested in the settings module within this one, as that’s where all of the settings and their values reside.

When the ec2nommerd and feederd Twisted plugins start, they use the update_settings_from_module() to override the defaults in the settings module with those specified by the user, typically via a user-provided module named nomconf.py (though that name can change with command line arguments).

If you need access to settings, simply import the global settings like this:

from media_nommer.conf import settings
media_nommer.conf.update_settings_from_module(settings_module)[source]

Given another module with settings in uppercase variables on the module, override the defaults in media_nommer.conf.settings with the values from the given module.

Parameters:settings_module (module) – A module with settings as upper-case attributes set. This is typically nomconf.py, although the user can elect to name them something else.

settings

This module contains default global settings. When ec2nommerd and feederd daemons are started, media_nommer.conf.update_settings_from_module() takes the settings that the user explicitly set and overrides these defaults.

You may override any of these global defaults in your nomconf.py file. You will need to at the least provide the following settings:

media_nommer.conf.settings.AWS_ACCESS_KEY_ID = None

Default: None (User must provide)

These AWS credentials are used for job state management via SimpleDB, and queueing with SQS.

media_nommer.conf.settings.AWS_SECRET_ACCESS_KEY = None

Default: None (User must provide)

These AWS credentials are used for job state management via SimpleDB, and queueing with SQS.

media_nommer.conf.settings.CONFIG_S3_BUCKET = 'nommer_config'

Default: 'nommer_config'

The S3 bucket to store a copy of nomconf.py for nommer instances.

media_nommer.conf.settings.EC2_AMI_ID = 'ami-eb558182'

Default: The latest upstream AMI compatible with this git revision.

The AMI ID for the media-nommer EC2 instance.

media_nommer.conf.settings.EC2_INSTANCE_TYPE = 'm1.large'

Default: 'm1.large'

The type of instance to run on. Must be at least m1.large. t1.micro and t1.small instances are NOT supported by the default AMI.

media_nommer.conf.settings.EC2_KEY_NAME = None

Default: None (User must provide)

The AWS SSH key name with which to launch the EC2 instances.

media_nommer.conf.settings.EC2_SECURITY_GROUPS = ['media_nommer']

Default: ['media_nommer']

The AWS security groups to create EC2 instances under.

media_nommer.conf.settings.FEEDERD_ABANDON_INACTIVE_JOBS_THRESH = 32400

Default: 3600 * 24

If a job sticks in an un-finished state after this long (in seconds), it is considered abandoned, and feederd will kill discard it.

media_nommer.conf.settings.FEEDERD_ALLOW_EC2_LAUNCHES = True

Default: True

When True, allow the launching of new EC2 encoder instances.

media_nommer.conf.settings.FEEDERD_AUTO_SCALE_INTERVAL = 60

Default: 60

How often feederd should see if it needs to spawn additional EC2 instances.

media_nommer.conf.settings.FEEDERD_JOB_STATE_CHANGE_CHECK_INTERVAL = 60

Default: 60

How often feederd will check for job state changes.

media_nommer.conf.settings.FEEDERD_PRUNE_JOBS_INTERVAL = 300

Default: 60 * 5

How often feederd will check for abandoned or expired jobs.

media_nommer.conf.settings.JOB_OVERFLOW_THRESH = 2

Default: 2

If the number of unfinished jobs exceeds our capacity (MAX_ENCODING_JOBS_PER_EC2_INSTANCE * <Number of Active EC2 instances>) by this number of jobs, look at starting new instances if we have not already exceeded MAX_NUM_EC2_INSTANCES.

media_nommer.conf.settings.MAX_ENCODING_JOBS_PER_EC2_INSTANCE = 2

Default: 2

The maximum number of jobs that should ever run on a single EC2 instance at the same time.

media_nommer.conf.settings.MAX_NUM_EC2_INSTANCES = 3

Default: 3

The maximum number of EC2 instances to run at a time.

media_nommer.conf.settings.NOMMERD_HEARTBEAT_INTERVAL = 60

Default: 60

Used by EC2 nodes to determine how long to wait between sending a status update via SimpleDB. The node will also check for inactivity greater than the configured value in NOMMERD_MAX_INACTIVITY, and terminate itself if inactivity has exceeded that value, and NOMMERD_TERMINATE_WHEN_IDLE is True.

media_nommer.conf.settings.NOMMERD_MAX_INACTIVITY = 600

Default: 60 * 50

How many seconds of inactivity (not working on any jobs) before an instance will terminate itself.

media_nommer.conf.settings.NOMMERD_NEW_JOB_CHECK_INTERVAL = 60

Default: 60

An interval (in seconds) to wait between calls to AWS to check for new jobs.

media_nommer.conf.settings.NOMMERD_QTFASTSTART_BIN_PATH = '/home/nom/.virtualenvs/media_nommer/bin/qtfaststart'

The path to the qtfaststart bin used by ec2nommerd.

media_nommer.conf.settings.NOMMERD_TERMINATE_WHEN_IDLE = True

Default: True

When True, allow the termination of idle EC2 instances based on the NOMMERD_MAX_INACTIVITY setting. It is important to keep in mind that you pay for an entire hour when you start an EC2 instance, so setting this timeout to anything below 10 minutes is probably a waste of money. This timeout is in seconds.

media_nommer.conf.settings.SIMPLEDB_EC2_NOMMER_STATE_DOMAIN = 'media_nommer_ec2nommer_state'

Default: 'media_nommer_ec2nommer_state'

The SimpleDB domain for storing heartbeat information from the EC2 encoder instances.

media_nommer.conf.settings.SIMPLEDB_JOB_STATE_DOMAIN = 'media_nommer'

Default: 'media_nommer'

The SimpleDB domain name for storing encoding job state in. For example, the date the job was created, the current state of the job (PENDING, ENCODING, FINISHED, etc.), and the Nommer being used to do the encoding.

media_nommer.conf.settings.SQS_JOB_STATE_CHANGE_QUEUE_NAME = 'media_nommer_jstate'

Default: 'media_nommer_jstate'

The SQS queue used to notify feederd of changes in job state. For example, when a job goes from PENDING to DOWNLOADING or ENCODING.

media_nommer.conf.settings.SQS_NEW_JOB_QUEUE_NAME = 'media_nommer'

Default: 'media_nommer'

The SQS queue used to notify ec2nommerd of new jobs.

media_nommer.conf.settings.STORAGE_BACKENDS = {'s3': 'media_nommer.core.storage_backends.s3.S3Backend', 'http': 'media_nommer.core.storage_backends.http.HTTPBackend', 'file': 'media_nommer.core.storage_backends.file.FileBackend', 'https': 'media_nommer.core.storage_backends.http.HTTPBackend'}

Default: (All included storage backends)

Storage backends. The protocol is the key, the value is the backend class used to work with said protocol.

utils

Various configuration-related utility methods.

media_nommer.conf.utils.download_settings(nomconf_uri)[source]

Given the URI to a S3 location with a valid nomconf.py, download it to the current user’s home directory.

Tip

This is used on the media-nommer EC2 AMIs. This won’t run on local development machines.

Parameters:nomconf_uri (str) – The URI to your setup’s nomconf.py file. Make Sure to specify AWS keys and IDs if using the S3 protocol.
media_nommer.conf.utils.upload_settings(nomconf_module)[source]

Given a user-defined nomconf module (already imported), push said file to the S3 conf bucket, as defined by settings.CONFIG_S3_BUCKET. This is used by the nommers that require access to the config, like FFmpegNommer.

Parameters:nomconf_module (module) – The user’s nomconf module. This may be called something other than nomconf, but the uploaded filename will always be nomconf.py, so the EC2 nodes can find it in your settings.CONFIG_S3_BUCKET.

Table Of Contents

Previous topic

media-nommer module reference

Next topic

media_nommer.core

This Page