Due to the early state of this project, there is a good chance that parts of these instructions are out of date at any given time. If you run into any such issue please let us know on our issue tracker.
Note
The following instructions are directed at what your eventual production environment will need. See Hacking on media-nommer for details on setting up a development environment.
For the sake of sanity, good deployment practices, and uniformity, we’re going to make some assumptions. It is perfectly fine if you’d like to deviate, but it will be much more difficult for us to help you:
For the sake of clarity, the media-nommer Python package contains the sources for feederd and ec2nommerd. You will want to install this package on whatever machine you’d like to run feederd on. You do not need to do any setup work for ec2nommerd, as those are ran on an EC2 instance that is based off of an AMI that we have created for you.
Since we are not yet distributing media-nommer on PyPi, the easiest way is to install the package is through pip:
pip install txrestapi twisted
pip install --upgrade git+http://github.com/duointeractive/media-nommer.git#egg=media_nommer
Note
If you don’t have access to pip, you may download a tarball/zip, from our GitHub project and install via the enclosed setup.py. See the requirements.txt within the project for dependencies.
We have to install Twisted before media-nommer because of an odd behavior with pip.
Tip
Any time that you upgrade or re-install Twisted, you must also re-install media-nommer.
After you have installed the media-nommer Python package on your machine(s), you’ll need to visit Amazon AWS and sign up for the following services:
It is important to understand that even if you already have an Amazon account, you need to sign up to each of these services specifically for your account to have access to said services. This is a very quick process, and typically involves looking over an agreement and accepting it.
Tip
Signing up for these services is outside the scope of this document. Please contact AWS support with questions regarding this step. Their community forums are also a great resource.
Fees are based on what you actually use, so signing up for these services will incur no costs unless you use them.
After you’ve signed up for all of the necessary services, there are a few steps to work through within the AWS Management Console. Sign in and take care of the following.
You will need to create a media_nommer EC2 Security Group through the AWS management console for your EC2 instances to be part of. You don’t need to add any rules, though, unless you want SSH access to the encoding nodes.
Warning
Failure to create an EC2 security group will result in media-nommer not being able to spawn EC2 instances, which means no encoding for you.
Click on the EC2 tab and find the Key Pairs link on the navigation bar. You can then either create or import a key pair. Make sure to keep track of the name of your keypair, as you’ll need to specify it in your media-nommer configuration later on.
Warning
Failure to create or import an SSH key pair will also lead to media-nommer being unable to spawn EC2 instances.
Once media-nommer is installed, create a directory to store a few files in. Within said directory, create a file called nomconf.py. You will want to add these settings values (at minimum):
# The AWS SSH key pair to use for creating instances. This is just the
# name of it, as per your Account Security Credentials panel on AWS.
EC2_KEY_NAME = 'xxxxxxxxx'
# The AWS credentials used to access SimpleDB, SQS, and EC2.
AWS_ACCESS_KEY_ID = 'YYYYYYYYYYYYYYYYYYYY'
AWS_SECRET_ACCESS_KEY = 'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ'
# The S3 bucket to store a copy of ``nomconf.py`` for nommer instances.
# NOTE: CREATE A BUCKET AND CHANGE THIS VALUE BEFORE YOU START!
CONFIG_S3_BUCKET = 'change-this-value'
# The AWS security groups to create EC2 instances under. They don't need
# any rules set.
EC2_SECURITY_GROUPS = ['media_nommer']
See media_nommer.conf.settings for a full list of settings (and their defaults) that you may override in your nomconf.py.
You will now want to start feederd using whatever init script or init daemon you use. We have had good results with Supervisor, but you can use whatever you’re comfortable with. Make sure that the server running feederd is reachable by the machines that will be sending API requests to start encoding jobs. Here is an example command string, assuming you’re in your top-level media-nommer directory (not media_nommer):
PYTHONPATH=media_nommer twistd -n --pidfile=feederd.pid feederd
From here, you’ll want to select and start using a Client API Libraries. These are what communicate with feederd‘s RESTful web API, and ultimately help get stuff done.