Part 2: Install Rhodecode


UPDATE: March 21, 2012
Oh, hai.
I’ll be migrating this to mod_wsgi and changing this entire page. to reflect that.
Why? Because I’m also going to migrate a moinmoin instance to be hosted on the same apache instance. Also, having the repos accessible by apache:apache will make it easy to deal with.


This is a rabbit eating lettuce, which is green like celery.

Install python setuptools
Go to http://pypi.python.org/pypi/setuptools#downloads and find the latest release for python 2.6

cd
wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg#md5=bfa92100bd772d5a213eedd356d64086
sh setuptools-0.6c11-py2.6.egg
rm -f setuptools-0.6c11-py2.6.egg

Configure a python virtual environment

easy_install virtualenv virtualenvwrapper

use virtualenvs for our paste user:

su paste
mkdir /home/paste/.virtualenvs
exit

Modify the startup script for each shell instance for paste

su paste
echo >> /home/paste/.bashrc
echo export WORKON_HOME=\$HOME/.virtualenvs >> /home/paste/.bashrc
echo source /usr/bin/virtualenvwrapper.sh >> /home/paste/.bashrc
source /home/paste/.bashrc
#some virtual environment should be created /home/paste/.virtualenvs
ls -l -a /home/paste/.virtualenvs/
exit

Rhodecode Install

We are now moving onto the Rhodecode Installation

mkdir -p /var/www/rhodecode-venv /var/www/rhodecode
chown paste:paste /var/www/rhodecode-venv /var/www/rhodecode
su paste
cd #this is super critical :D
virtualenv --no-site-packages /var/www/rhodecode-venv #create the virtual environment for rhodecode
/var/www/rhodecode-venv/bin/easy_install --prefix=/var/www/rhodecode-venv rhodecode #install rhodecode accessible through the virtualenv
exit

tip: Check out Quick Primer: python virtual environments to learn more.

Installing celery and rabbitmq
Installing celery and rabbitmq will improve performance, but all will work without that. The suggestion is: “if you plan to use RhodeCode for say 7 to 10 repositories, RhodeCode will perform perfectly well without celery running.”

Whatever that vague statement means, disregard. Let’s go ahead and install celery along with rabbitmq.  Remember “if you make the decision to run RhodeCode with celery make sure you run celeryd using paster and message broker together with the application.”  This is because the paste script celeryd pulls the celeryd config from the paste config file.  We’ll get to this later.

Install celery
Following the celery install process

/var/www/rhodecode-venv/bin/easy_install --prefix=/var/www/rhodecode-venv Celery #install celery into the virtualenv

Install RabbitMQ server
Onto RabbitMQ installation: in relation to celery broker installation

Following rabbitmq server installation information

Install Erlang prerequisite for rabbitmq-server
According to the RabbitMQ docs

echo [fedora_el6] >> /etc/yum.repos.d/fedora_el6.repo #allow yum access to the fedora repo
echo name=fedora_el6 >> /etc/yum.repos.d/fedora_el6.repo
echo baseurl=http://download1.fedora.redhat.com/pub/epel/\$releasever/\$basearch/ >> /etc/yum.repos.d/fedora_el6.repo #the url might have changed
echo enabled=1 >> /etc/yum.repos.d/fedora_el6.repo
echo skip_if_unavailable=1 >> /etc/yum.repos.d/fedora_el6.repo
echo gpgcheck=0 >> /etc/yum.repos.d/fedora_el6.repo
yum -y install erlang #install erlang
sed 's/^enabled=1/enabled=0/' -i /etc/yum.repos.d/fedora_el6.repo && rm -f /etc/yum.repos.d/fedora_el6.repo # Disable fedora repo

Install rabbitmq-server
Use the RPM for Fedora: (Thanks Hussain http://hussainanjar.com/2011/04/installing-rabbitmq-on-centos5/)

cd
wget http://www.rabbitmq.com/releases/rabbitmq-server/v2.6.1/rabbitmq-server-2.6.1-1.noarch.rpm
yum -y --nogpgcheck localinstall ./rabbitmq-server-2.6.1-1.noarch.rpm
rm -f rabbitmq-server-2.6.1-1.noarch.rpm

Add rabbitmq-server to chkconfig db so that it came be easily managed to start on system boot

chkconfig --add rabbitmq-server
chkconfig --level 345 rabbitmq-server on
service rabbitmq-server start

check some things:

service rabbitmq-server status
netstat -apn | grep $(cat /var/run/rabbitmq/pid)

Configuring RabbitMQ server

rabbitmqctl add_user celeryuser RANDOMPASSWORD
rabbitmqctl add_vhost celeryvhost
rabbitmqctl set_permissions -p celeryvhost celeryuser ".*" ".*" ".*"

There is a note to NEVER use kill to stop RabbitMQ server, so use:

service rabbitmq-server stop

Finally on to RhodeCode
With reference to the Rhodecode setup documentation.

Install some python modules, including python-ldap, into your virtualenv
To have Rhodecode leverage LDAP for authentication, we’ll install python-ldap.

yum -y install openldap openldap-clients openldap-devel openssl-devel #horray, openldap-2.4.19 is already installed!
/var/www/rhodecode-venv/bin/easy_install --prefix=/var/www/rhodecode-venv pyasn1 pyasn1-modules
/var/www/rhodecode-venv/bin/easy_install --prefix=/var/www/rhodecode-venv python-ldap #ignore the various (not found) errors, a long as it builds "Instaled ...python_ldap...egg"

LDAP configuration takes place in the Rhodecode web UI, which will be covered later.

Configure RhodeCode and celery

su paste
/var/www/rhodecode-venv/bin/paster make-config RhodeCode /var/www/rhodecode-venv/production.ini
vim /var/www/rhodecode-venv/production.ini

set the following values in the paste config file:

email_to
error_email_from
app_email_from
smtp_server
force_https = false # we'll deal with this through apache ([11:36]  [the force_https] flag is for redirections and url for cloning)
use_celery = true
broker.vhost = celeryvhost
broker.user = celeryuser
broker.password = RANDOMPASSWORD
celery.send.task.error.emails = true
#celeryd.log.file = celeryd.log #we'll take care of logging via stdout of the paste instance that executes celeryd
celeryd.log.level = debug #leave this value as is, we'll set the value to WARNING at run time

Then exit vim and back to root:

exit

If you’re super interested, check out info on python paste config files here:
Paste: config file
paste.httpserver

Configure the root for the repos

mkdir /reporoot #make a directory to your repo root
chown paste:paste /reporoot/

You can copy existing repos over to this location, and rhodecode will learn of their existence and add them to it’s database when it starts.

Setup your sql database and admin user
The following is the database configuration script.

su paste
/var/www/rhodecode-venv/bin/paster setup-app -q /var/www/rhodecode-venv/production.ini
# Destory the DB
# enter /reporoot as the repo root
# enter an admin username, password
# enter the admin email etc.
exit #to get back to root

Create an init script for paster script celeryd

To support chkconfig properly, you must change the chkconfig line in the following init script.
the syntax is as follows:

chkconfig [run levels] [execution order at startup, S] [kill order at shutdown, K]

1) We’ll be using this at runlevel 5.
2) We’ll want to start it after rabbitmq-server starts.
3) We’ll kill it before rabbitmq-server dies.

cat /etc/init.d/rabbitmq-server | grep chkconf
find / -iname K05rabbitmq-server
find / -iname S80rabbitmq-server

From that info, here is a init script for paste_script_celeryd:
I’m very much interested in using the daemon() function of /etc/init.d/functions; but won’t be doing that for now.

vim /etc/init.d/paste-script-celeryd

#!/bin/sh
#
#
#
#
# chkconfig: 345 81 04
# description:
#init script for paste script celeryd, which was written by
#branded on freenode
#mbrownnyc everywhere else
#hacky init.d script for celeryd paste script
#

### BEGIN INIT INFO
# Provides:          paste-script-celeryd
# Required-Start:    $remote_fs $network
# Required-Stop:     $remote_fs $network
# Description:       Paste Script to launch celeryd reading config out of a paste config file
### END INIT INFO

  start()
  {
        if [ ! -f /var/run/paste/celeryd.pid ]; then #process isn't running probably
                echo Attempting to start celeryd paste script...  forking it up with \&
                su -c '/var/www/rhodecode-venv/bin/paster celeryd /var/www/rhodecode-venv/production.ini --pidfile=/var/run/paste/celeryd.pid -f /var/log/celerydpaster.log -l WARNING -q &' paste
                while [ ! -f /var/run/paste/celeryd.pid ]; do sleep 1 && echo .; done
                echo Done. PID is $(cat /var/run/paste/celeryd.pid).
        else
                echo The celeryd paste script has filed a paste PID $(cat /var/run/paste/celeryd.pid)
                echo It\'s likely started already at that PID.
        fi
  }
  stop()
  {
         if [ -f /var/run/paste/celeryd.pid ]; then #process is running probably
                echo sending SIGINT to the process $(cat /var/run/paste/celeryd.pid) to trigger a "Warm shutdown"
                pypasteceleryPID=$(cat /var/run/paste/celeryd.pid)
                kill -s INT $pypasteceleryPID
                echo Waiting for process to die...
                #umm... yea! http://stackoverflow.com/questions/696839/how-do-i-write-a-bash-script-to-restart-a-process-if-it-dies
                while [ -f /var/run/paste/celeryd.pid ]; do sleep 1 && echo .; done
                echo Truncating /var/log/celerydpaster.log to entries from last run only.
                sed -i '1,'$(expr $(grep -n -e "^----\s\*\*\*\*\s-----" /var/log/celerydpaster.log | cut -d':' -f1 | awk '$1 > max { max=$1 }; END { print max }') - 1)'d' /var/log/celerydpaster.log
        else
                echo /var/run/paste/celeryd.pid doesn\'t exist, so the celeryd paste script was not used to execute celeryd if celeryd is actually running.
                echo Otherwise it isn\'t running.
        fi

  }
  restart()
  {
        stop
        start
  }
  status()
  {
       if [ -f /var/run/paste/celeryd.pid ]; then
                echo celeryd paste script is running as PID $(cat /var/run/paste/celeryd.pid)
                tail -n 20 /var/log/celerydpaster.log
        else
                echo celeryd paste script isn\'t running.
        fi

  }

case "$1" in
    start)
                start
    ;;
    stop)
                stop
    ;;
    restart)
                stop
                start
    ;;
    status)
                status
    ;;
    *)
                echo $"Usage: $0 {start|stop|restart|status}"
        ;;
esac
exit 1
[esc]wq![enter]

Allow the script to be executable:

chmod +x /etc/init.d/paste-script-celeryd

Then add it to the chkconfig db and check status

chkconfig --add paste-script-celeryd
chkconfig --level 345 paste-script-celeryd on
mkdir -p /var/run/paste/
touch /var/log/celerydpaster.log
chown paste:paste /var/log/celerydpaster.log /var/run/paste/

find / -iname S81paste-script-celeryd
find / -iname K04paste-script-celeryd

service rabbitmq-server start #start rabbitmq
service paste-script-celeryd start #start celeryd
ls -l /proc/ | grep $(cat /var/run/paste/celeryd.pid) # the owner should be

Create an init script for paste serve

vim /etc/init.d/paste-serve-rhodecode

#!/bin/sh
#
#
#
#
# chkconfig: 345 82 03
# description:
#init script for paste serve rhodecode, which was written by
#branded on freenode
#mbrownnyc everywhere else
#

### BEGIN INIT INFO
# Provides:          paste-serve-rhodecode
# Required-Start:    $remote_fs $network
# Required-Stop:     $remote_fs $network
# Description:       Paste httpserver to serve rhodecode over http
### END INIT INFO

  start()
  {
        if [ ! -f /var/run/paste/rhodecode.pid ]; then #process isn't running probably
                echo Attempting to start paste serve rhodecode...  daemonizing
                su -c '/var/www/rhodecode-venv/bin/paster serve /var/www/rhodecode-venv/production.ini --daemon --user=paste --pid-file=/var/run/paste/rhodecode.pid --log-file=/var/log/pasteserve.log' paste
                while [ ! -f /var/run/paste/rhodecode.pid ]; do sleep 3 && echo .; done
                echo Done. PID is $(cat /var/run/paste/rhodecode.pid).
        else
                echo The paste serve rhodecode has filed a paste PID $(cat /var/run/paste/rhodecode.pid)
                echo It\'s likely started already at that PID.
        fi
  }
  stop()
  {
        if [ -f /var/run/paste/rhodecode.pid ]; then #process is running probably
                echo Telling daemonized paste httpserve process to die
                su -c '/var/www/rhodecode-venv/bin/paster serve --stop-daemon --pid-file=/var/run/paste/rhodecode.pid' paste
                echo Waiting for process to die...
                while [ -f /var/run/paste/rhodecode.pid ]; do sleep 1 && echo .; done
        else
                echo /var/run/paste/rhodecode.pid doesn\'t exist, so the paste httpserve process was not used to executed using the proper config, if paste is running.
                echo Otherwise it isn\'t running.
        fi
  }
  restart()
  {
        stop
        start
  }
  status()
  {
        if [ -f /var/run/paste/rhodecode.pid ]; then
                echo paste httpserve process is running as PID $(cat /var/run/paste/rhodecode.pid)
                su -c '/var/www/rhodecode-venv/bin/paster serve /var/www/rhodecode-venv/production.ini --status --pid-file=/var/run/paste/rhodecode.pid' paste
        else
                echo paste serve rhodecode isn\'t running.
        fi

  }

case "$1" in
    start)
                start
    ;;
    stop)
                stop
    ;;
    restart)
                stop
                start
    ;;
    status)
                status
    ;;
    *)
                echo $"Usage: $0 {start|stop|restart|status}"
        ;;
esac
exit 1
[esc]wq![enter]

Allow the script to be executable:

chmod +x /etc/init.d/paste-serve-rhodecode

Then add it to the chkconfig db:

chkconfig --add paste-serve-rhodecode
chkconfig --level 345 paste-serve-rhodecode on

Then touch and chown the log, start the service and review status:

touch /var/log/pasteserve.log
chown paste:paste /var/log/pasteserve.log
service paste-serve-rhodecode start
ls -l /proc/ | grep $(cat /var/run/paste/rhodecode.pid) # the owner should be paste
  1. January 6, 2012 at 7:46 pm

    Hi,
    This is a great tutorial, I have configured Rhodecode, Celery and RabbitMQ like you had mentioned. Now, is there any way to see whether Rhodecode is using Celery and RabbitMQ? I’m not sure on how to check that.

    Please let me know on how it can be done.

    Thanks,
    Vairav

  2. January 6, 2012 at 7:59 pm

    Thanks Vairav!

    The best thing to do is to tail the celery log file (/var/log/celerydpaster.log) which is contained in the init.d script line:

    su -c ‘/var/www/rhodecode-venv/bin/paster celeryd /var/www/rhodecode-venv/production.ini –pidfile=/var/run/paste/celeryd.pid -f /var/log/celerydpaster.log -l WARNING -q &’ paste

    You can also change the log level with -l. Check out the messin’s celeryd paste script’s help by running the following (I think):

    /var/www/rhodecode-venv/bin/paster celeryd -?

  3. January 6, 2012 at 9:57 pm

    I’ve done it the same way like you had mentioned and this is log as follows:

    [2012-01-06 18:54:49,906: DEBUG/MainProcess] Start from server, version: 8.0, properties: {u'information': u'Licensed under the MPL.  See http://www.rabbitmq.com/', u'product': u'RabbitMQ', u'copyright': u'Copyright (C) 2007-2011 VMware, Inc.', u'capabilities': {}, u'platform': u'Erlang/OTP', u'version': u'2.7.1'}, mechanisms: [u'PLAIN', u'AMQPLAIN'], locales: [u'en_US']
    [2012-01-06 18:54:49,906: DEBUG/MainProcess] Open OK! known_hosts []
    [2012-01-06 18:54:49,906: DEBUG/MainProcess] Consumer: Connection established.
    [2012-01-06 18:54:49,907: DEBUG/MainProcess] using channel_id: 1
    [2012-01-06 18:54:49,907: DEBUG/MainProcess] Channel open
    [2012-01-06 18:54:49,908: DEBUG/MainProcess] basic.qos: prefetch_count->8
    [2012-01-06 18:54:49,909: DEBUG/MainProcess] using channel_id: 2
    [2012-01-06 18:54:49,909: DEBUG/MainProcess] Channel open
    [2012-01-06 18:54:49,912: DEBUG/MainProcess] Consumer: Starting message consumer...
    [2012-01-06 18:54:49,913: DEBUG/MainProcess] Consumer: Ready to accept tasks!
    

    I then logged into http://localhost:55672/ to check the RabbitMQ to see if the channels were registered. All of them seem to be fine, and when I perform any actions like, Re-Indexing Whoosh, pushing, pulling from repository, I dont see any Messages in the RabbitMQ.
    The Total Messages is always 0.

    Could you please guide me on why this is always 0? Does it mean that RhodeCode is not using it?

    Thank you again, and I’ve done all the steps till Redmine at my work and people just love it :) Thank you and hope you write more tutorials for people like us :)

    –Vairav

  4. January 7, 2012 at 7:16 am

    Vairav,

    Hmm… interesting. My suggestion is to…

    http://groups.google.com/group/rhodecode/browse_thread/thread/5d7fc1c49c26ed10

    Cool.

    I never had a chance to dive into this interaction, but did notice that when my RabbitMQ instance was down, that no email was sent from rhodecode. So maybe it is only used for certain processes?

  5. January 8, 2012 at 1:34 am

    Oh yeah, I kinda posted that on the RhodeCode discussion group so that I can get some idea on what interactions are being done by Celery with RabbitMQ.

    Few interesting things are that, when I start Celery with my production.ini, it registers itself with RabbitMQ and starts 2 channels for communication. Also, the next interesting things is that, in RabbitMQ, it consumes about 12-20 worker threads. But, when I checked the celeryvhost, I doesn’t show any messages received, nor messages processed, no any producers or consumers also.

    Similarly, I tried to re-build the Whoosh index from scratch, but when I executed that task from the front-end, I saw it starting the console, but the most interesting part is that, the entire indexing gets completed, and after that completes, RhodeCode sends a messages to Celery using the celery lib for the indexing process. This is like the most confusing part for me, because why would RhodeCode send this process again to Celery when it already executed the command on it console.

    Anyways, these are just my observation and I might be missing something. Hope this information helps some people like me who are reading your blog :)

  6. January 9, 2012 at 2:31 pm

    I got a reply on the post that I had made on the RhodeCode group and found out that I need to set the following to false:

    celery.always.eager = false

    Once when I set that value up in the ‘production.ini’, I started Celery first like you had mentioned, then I started up Rhodecode.
    This time, I did the same re-indexing of the repo, and I could see the logs popping up on the ‘celeryd.log’ file stating that it has received the request from Rhodecode and that it has started processing.

    A sample log for your reference is:

    [2012-01-09 11:29:21,945: INFO/MainProcess] Got task from broker: rhodecode.lib.celerylib.tasks.whoosh_index[d2a167d3-9a0b-4c89-a17c-0fe3abe380b3]
    [2012-01-09 11:29:21,963: DEBUG/MainProcess] Mediator: Running callback for task: rhodecode.lib.celerylib.tasks.whoosh_index[d2a167d3-9a0b-4c89-a17c-0fe3abe380b3]
    [2012-01-09 11:29:21,964: DEBUG/MainProcess] TaskPool: Apply <function execute_and_trace at 0x3dee140> (args:('rhodecode.lib.celerylib.tasks.whoosh_index', 'd2a167d3-9a0b-4c89-a17c-0fe3abe380b3', (u'/home/vairav/mercurial/repos', u'True'), {}) kwargs:{'hostname': 'Vairav', 'request': {'chord': None, 'retries': 0, 'hostname': 'Vairav', 'taskset': None, 'is_eager': False, 'loglevel': 10, 'delivery_info': {'consumer_tag': u'2', 'routing_key': u'celery', 'exchange': u'celery'}, 'logfile': None, 'id': 'd2a167d3-9a0b-4c89-a17c-0fe3abe380b3'}})
    [2012-01-09 11:29:21,964: DEBUG/MainProcess] Task accepted: rhodecode.lib.celerylib.tasks.whoosh_index[d2a167d3-9a0b-4c89-a17c-0fe3abe380b3] pid:29535
    [2012-01-09 11:29:21,964: INFO/PoolWorker-3] running task with lockkey task_1313d52bb5c5993b7edfe3e07ea80790.lock
    [2012-01-09 11:29:22,020: INFO/PoolWorker-3] initializing db for Engine(sqlite:////home/vairav/Downloads/HG/RhodeCode/rhodecode.db)
    [2012-01-09 11:29:22,020: INFO/PoolWorker-3] scanning for repositories in /home/vairav/mercurial/repos
    [2012-01-09 11:29:22,048: DEBUG/PoolWorker-3] settings ui from db[hooks]changegroup.repo_size:python:rhodecode.lib.hooks.repo_size
    [2012-01-09 11:29:22,048: DEBUG/PoolWorker-3] settings ui from db[hooks]pretxnchangegroup.push_logger:python:rhodecode.lib.hooks.log_push_action
    [2012-01-09 11:29:22,049: DEBUG/PoolWorker-3] settings ui from db[hooks]preoutgoing.pull_logger:python:rhodecode.lib.hooks.log_pull_action
    [2012-01-09 11:29:22,049: DEBUG/PoolWorker-3] settings ui from db[format]dotencode:false
    [2012-01-09 11:29:22,049: DEBUG/PoolWorker-3] settings ui from db[extensions]largefiles:
    [2012-01-09 11:29:22,049: DEBUG/PoolWorker-3] settings ui from db[web]push_ssl:false
    [2012-01-09 11:29:22,049: DEBUG/PoolWorker-3] settings ui from db[web]allow_archive:gz zip bz2
    [2012-01-09 11:29:22,049: DEBUG/PoolWorker-3] settings ui from db[web]allow_push:*
    [2012-01-09 11:29:22,049: DEBUG/PoolWorker-3] settings ui from db[web]baseurl:/
    [2012-01-09 11:29:22,049: DEBUG/PoolWorker-3] settings ui from db[paths]/:/home/vairav/mercurial/repos
    [2012-01-09 11:29:22,051: WARNING/PoolWorker-3] Not trusting file /home/vairav/mercurial/repos/testrepo/.hg/hgrc from untrusted user www-data, group hg
    [2012-01-09 11:29:22,056: WARNING/PoolWorker-3] 2012-01-09 11:29:22,056 - whooshIndexer - DEBUG - removing previous index
    [2012-01-09 11:29:22,085: WARNING/PoolWorker-3] 2012-01-09 11:29:22,085 - whooshIndexer - DEBUG - building index @ /home/vairav/mercurial/repos/testrepo
    [2012-01-09 11:29:22,086: WARNING/PoolWorker-3] 2012-01-09 11:29:22,086 - whooshIndexer - DEBUG -     >> /home/vairav/mercurial/repos/testrepo/newfile
    [2012-01-09 11:29:22,087: WARNING/PoolWorker-3] 2012-01-09 11:29:22,087 - whooshIndexer - DEBUG - >> COMMITING CHANGES <<
    [2012-01-09 11:29:22,090: WARNING/PoolWorker-3] 2012-01-09 11:29:22,090 - whooshIndexer - DEBUG - >>> FINISHED BUILDING INDEX <<<
    [2012-01-09 11:29:22,090: DEBUG/PoolWorker-3] worker exiting after 1 tasks
    [2012-01-09 11:29:22,090: INFO/PoolWorker-3] process shutting down
    [2012-01-09 11:29:22,090: DEBUG/PoolWorker-3] running all "atexit" finalizers with priority >= 0
    [2012-01-09 11:29:22,090: INFO/MainProcess] Task rhodecode.lib.celerylib.tasks.whoosh_index[d2a167d3-9a0b-4c89-a17c-0fe3abe380b3] succeeded in 0.126000881195s: None
    [2012-01-09 11:29:22,090: DEBUG/PoolWorker-3] running the remaining "atexit" finalizers
    [2012-01-09 11:29:22,090: INFO/PoolWorker-3] process exiting with exitcode 0
    [2012-01-09 11:29:22,501: DEBUG/MainProcess] Supervisor: cleaning up worker 0
    [2012-01-09 11:29:22,501: DEBUG/MainProcess] Supervisor: worked 0 joined
    [2012-01-09 11:29:22,502: DEBUG/MainProcess] added worker
    [2012-01-09 11:29:22,503: INFO/PoolWorker-5] child process calling self.run()
    

    Thank you for all the help and hope this information helps you also.
    Another small thing is that, once when these systems are working together, I’m seeing a major performance increase :)

    Thanks again,
    Vairav

  7. January 9, 2012 at 4:25 pm

    Excellent. So I will advise to change this in the configuration and cite these comments (and link your web page).

    A quick search for what that option does returns: http://ask.github.com/celery/configuration.html#celery-always-eager

    “If this is True, all tasks will be executed locally by blocking until the task returns. apply_async() and Task.delay() will return an EagerResult instance, which emulates the API and behavior of AsyncResult, except the result is already evaluated.

    That is, tasks will be executed locally instead of being sent to the queue.”

    So, it eliminates the use of the queue, running the jobs asynchronously; which may have some effect within itself (?). Interested to find out a solid answer on what this option does, and the effect it will have. Why marcin chose this setting by default?

    For instance, is there a problem with the queue name or the configuration of the queue so that it was unavailable to accept jobs?

    Thanks!

  8. January 9, 2012 at 7:20 pm

    That is true, even I have some doubts on why this was chosen as the default setting. But then, when with Celery I guess the main thing that marcin was looking out was to perform all the processes asynchronously.
    So under that consideration, I guess he gave the defaults as ‘false’ for ‘celery.always.eager’.

    Thanks a lot for this excellent post and hope all these comments helps out people who are looking for information.

    Have you by chance configured ReviewBoard with Rhodecode for performing code reviews? I’m getting some errors with Reviewboard while doing “View Diff”. Just a query :)

    Thanks again!

  9. January 10, 2012 at 10:57 am

    Matt Zuba and Marcin both wrote responses on the thread (http://groups.google.com/group/rhodecode/browse_thread/thread/5d7fc1c49c26ed10).

    It appears celery.always.eager is set to false by default, as Marcin states, by definition, the synchronousity basically nullifies the whole purpose of using celery.

    Thanks for the praise. Occasionally I get a “ton” of hits (my biggest day was 100 hits, so “ton” is relative), other than that not many people comment or rate the posts. Posts related to this project target a bit of a niche audience anyway.

    I haven’t looked into ReviewBoard. If you use it, do a write up on your site on installation and configuration and I’ll happily link it!

  10. January 10, 2012 at 2:14 pm

    Thank you so much, I’ve posted my problem on the Reviewboard group to see if I can sort the issue out. Also, I’ve started writing up the how-to on my site and I will notify you once when I’m done.

    Thanks again!
    Vairav

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 41 other followers

%d bloggers like this: