Panda

Panda 1.2 released

We’ve just released version 1.2 of Panda.

Over the past couple of weeks we’ve been busy working on a couple of features:

  • Optionally storing videos on the local filesystem instead of S3.
  • Changing the clipping (thumbnail and screenshot) for videos through the admin interface.

Filesystem storage is great news if you want to host Panda yourself without relying on S3. It’s also great if you’re hacking on Panda because local storage is so much faster than waiting around for S3; also, it’s much easier to see what’s happening!

The second change allows you to specify that Panda should generate a range of clippings for your video when the encoding process happens. Then, through the admin interface, you can change the default clipping for the video. This will immediately be reflected in the screenshot displayed before the video starts playing, and in the default thumbnail if you’re making use of it.

thumbnails

The Getting Started guide has been updated to reflect these changes. There are also a few niceties which should make life simpler for new users of panda.

If you’re upgrading please note that the tmp_video_dir configuration option was renamed to private_tmp_path. It won’t hurt to take a look through the new panda_init.rb.example file either.

Playing with Panda without SimpleDB account

If you are interested in trying out panda without getting a SimpleDB account we’ve got good news for you!

There are currently 2 simpledb like tools at this moment(as far as I know). They won’t be for production use, but should be enough to play around or use it for development purpose.

I initially tried simplerdb, but found that the implementation is not complete, therefore not suitable for Panda use. Also it’s an in-memory db, so the data will be lost every time you stop simplerdb.

I then tried simplerdb-dev(the Python one). simpledb-dev stores data on file systems, so you don’t need to worry about losing data every time you stop simpledb-dev. However, EC2 vapors every time you restart the instance, so you still need to use
Amazon Elastic Block Store to keep your data.

Here are the quick steps to use simpledb-dev at Panda. Please give a try and let me know if you find any issues. If people find this solution useful, I will add simpledb-dev into next AMI release image, and also update the documentation.

  1. Setup simplerdb-dev on your EC2 instance.

    #You can skip this part if python version is already 2.5
    apt-get update
    apt-get install python2.5-dev
    rm /usr/bin/python
    ln -s /usr/bin/python2.5 /usr/bin/python
    
    # This step is to install easy_install, Python equivalent of Gems.
    # If you are installing Panda locally on your machine (I only tried on OSX Leopard),
    # you may already have easy_install, so you can skip it.
    curl -O http://peak.telecommunity.com/dist/ez_setup.py
    python ez_setup.py
    
    # Installing Web module
    easy_install web.py
    
    # Downloading simpledb-dev
    wget http://simpledb-dev.googlecode.com/files/simpledb-dev-0.1.5.zip
    unzip simpledb-dev-0.1.5.zip
    cd SimpleDB-Dev/
    cd src
    
    # Starting simpledb_dev server
    python simpledb_dev.py 8087 (can be any port number.).
    
  2. Open up another terminal, and follow up to “Configure Panda” section of Getting Started guide

  3. Override simpledb url, before “Create S3 buckets and SimpleDB domains” of Getting Started guide. Add the following line at the beginning of config/aws.rb file of Panda

    Amazon::SDB::Base::BASE_PATH = 'http://127.0.0.1:8087'
    
  4. Continue “Create S3 buckets and SimpleDB domains” of Getting Started guide. Once it’s all done, confirm via console that you can connect to simpledb-dev

    $cd /var/local/www/panda
    $merb -i
    ~ Loaded DEVELOPMENT Environment...
    ~ loading gem 'merb-assets' ...
    ~ loading gem 'merb-mailer' ...
    ~ loading gem 'merb_helpers' ...
    ~ loading gem 'uuid' ...
    ~ loading gem 'to_simple_xml' ...
    ~ loading gem 'rog' ...
    ~ loading gem 'amazon_sdb' ...
    ~ loading gem 'simple_db' ...
    ~ loading gem 'retryable' ...
    ~ loading gem 'activesupport' ...
    ~ loading gem 'rvideo' ...
    ~ loading gem 'panda' ...
    ~ loading gem 'gd_resize' ...
    ~ loading gem 'map_to_hash' ...
    ~ loading gem 'spec_eql_hash' ...
    ~ loading gem 'error_sender' ...
    ~ Compiling routes...
    ./config/aws.rb:1: warning: already initialized constant BASE_PATH
    ~ Starting Merb server listening at 0.0.0.0:4000
    irb(main):001:0> Amazon::SDB::Base::BASE_PATH
    => "http://127.0.0.1:8087"
    irb(main):002:0> User.query
    => [#<User:0xb71fda08 @key="admin", @new_record=false, @attributes=#<Amazon::SDB::
    Multimap:0xb71fd9e0 @size=nil, @mset={}>>]
    irb(main):003:0> Profile.query
    => [#<Profile:0xb71dc1c8 @key="561e38b0-706e-012b-b437-123138002d32", @new_record=false, @attributes=#<Amazon::SDB::Multimap:0xb71dc1a0 @size=nil, @mset={}>>, #<Profile:0xb71dc1b4 @key="562ef420-706e-012b-b437-123138002d32", @new_record=false, @attributes=#<Amazon::SDB::Multimap:0xb71dc164 @size=nil, @mset={}>>, #<Profile:0xb71dc18c @key="56101ea0-706e-012b-b437-123138002d32", @new_record=false, @attributes=#<Amazon::SDB::Multimap:0xb71dc128 @size=nil, @mset={}>>, #<Profile:0xb71dc150 @key="5621fa70-706e-012b-b437-123138002d32", @new_record=false, @attributes=#<Amazon::SDB::Multimap:0xb71dc0ec @size=nil, @mset={}>>, #<Profile:0xb71dc114 @key="56dd8600-706e-012b-b437-123138002d32", @new_record=false, @attributes=#<Amazon::SDB::Multimap:0xb71dc0b0 @size=nil, @mset={}>>]
    

Enjoy

Panda AMI 1.1 release

We made a several changes to the Panda AMI and released new image. We have updated the documentation - please see the “getting_started” page for details.

Here are the list of changes we made. We will keep ~/CHANGELOG (on the image) updated as we make changes in future.

  • Created CHANGELOG
  • Upgraded merb from 0.9.3 to 0.9.7
  • Upgraded Erubis from 2.4.1 to 2.6.2
  • Installed tlsmail gems.
  • Moved Panda directory from /usr/local/www to /var/local/www
  • Moved default tmp_video_dir directory from Merb.root + “/videos” to “/var/tmp/videos” and created the directory by default
  • Reflected the above directory change on nginx config file at /usr/local/nginx/conf/nginx-panda.conf
  • Removed private key from ~/.ssh/authorized_keys
  • Installed postfix
  • Installed less


If you are already using the old image there is no particular need to upgrade to the new Panda AMI. When you decide to pullĀ  the latest release of panda from stable branch, you will simply need to update merb and erubis.
Enjoy!