Havarti

A quaint cheese shop that plays nicely in The Cloud
Download

Havarti Ranking & Summary

Advertisement

  • Rating:
  • License:
  • The Apache License 2.0
  • Price:
  • FREE
  • Publisher Name:
  • Jake Basile
  • Publisher web site:
  • http://code.jakebasile.com/

Havarti Tags


Havarti Description

havarti is a quaint cheese shop that plays nicely in The Cloud.InstallationHavarti is a Flask app with a Celery downloader. Anything that can handle that can run it, but here are some suggestions on how to run it.HerokuThe default way of hosting Havarti is with Heroku, MongoHQ, and S3. git clone git@github.com:jakebasile/Havarti.git && cd havarti heroku apps:create --stack cedar heroku addons:add mongohq:free heroku config:add STORAGE=s3storage \ AWS_ACCOUNT_KEY_ID=< Your AWS Key ID > \ AWS_SECRET_KEY_ID=< Your AWS Secret > \ MONGO_KEY=MONGOHQ_URL git push heroku master heroku scale web=1 downloader=1You can also use Rackspace Cloud Files to store the cache by changing the config line to: heroku config:add STORAGE=rackspacestorage \ RACKSPACE_USERNAME=< Your Rackspace Username > \ RACKSPACE_KEY=< Your Rackspace API Key > \ MONGO_KEY=MONGOHQ_URLLocalMaybe you don't want to be a cool cat and run Havarti on Heroku. You want to run it locally. Here's one way to do it. First, install Havarti somewhere: virtualenv havarti-install cd havarti-install source bin/activate pip install havarti gunicorn supervisorThis will install Havarti, Gunicorn, and Supervisor to run it all. Now, make a supervisord.conf file in this directory:file=supervisord.sockchmod=0777supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterfacelogfile=logs/supervisor.txtloglevel=infopidfile=supervisord.pidserverurl=unix://supervisord.sockcommand=mongodstdout_logfile=logs/mongodb.txtstderr_logfile=logs/mongodb-err.txtpriority=1command=bin/gunicorn -w 3 --preload -b 0.0.0.0:80 havarti:appstdout_logfile=logs/havarti.txtstderr_logfile=logs/havarti-err.txtenvironment=STORAGE=localstoragepriority=2command=bin/celery --app=havarti worker -l infostdout_logfile=logs/celery.txtstderr_logfile=logs/celery-err.txtenvironment=STORAGE=localstoragepriority=3This assumes that you have MongoDB installed previously. Then, again from this directory, just create the directories needed and start Supervisor! mkdir logs sudo mkdir -p /data/db sudo bin/supervisordYou can now control the processes through supervisorctl. Check out Supervisor's documentation for more info on it.UsageHavarti acts as a proxy for PyPI, intercepting requests for packages. When it recieves a package request, it follows a simple decision tree:- Is package/version cached?- Yes: serve cached package.- No: Mark package for caching, serve PyPI package.Havarti checks for new versions with every request, so you are always able to get the very newest version of whatever package you require (and then the new version will be cached from then on).DownloadingJust substitute your Havarti Index URL when using Pip. Your Havarti Index URL is wherever you hosted Havarti + '/i/', e.g. 'http://random-phrase-5000.herokuapp.com/i/'. pip install -i http://random-phrase-5000.herokuapp.com/i/ reapYou can add this to your pip.conf to save some keystrokes.UploadingYou can also upload packages to Havarti directly. These will not be pushed to PyPI, but are available to anyone with the Havarti url. To upload, just use your Havarti Upload URL with setup.py. Your Havarti Upload URL is wherever you hosted Havarti + '/u/', e.g. 'http://random-phrase-5000.herokuapp.com/u/'. python setup.py sdist upload -r http://random-phrase-5000.herokuapp.com/u/You can also set this up in a .pypirc file to save even more keystrokes.Product's homepage


Havarti Related Software