Project:Infrastructure/Service Catalog/Packages-v5

Architecture
packages.gentoo.org has 5 main components:

- nginx frontend: Handles SSL termination and proxies request to app backend, also handles caching content. - thin.packages: Thin ruby server that handles users requests. Runs behind nginx. - Sidekiq: A ruby workqueue, this queue works on re-indexing. - Elasticsearch: Holds the actual search index; sidekiq keeps the indices updated and the thin.packages server sends elasticsearch queries. - redis: A small dependency for sidekiq to store its workqueue. - memcache: In addition to nginx, the rails app also relies on memcache to avoid expensive computations. - Cron: A cronjob runs every N minutes, grabs the most up to date copy of the rsync tree (w/generated metadata) and inserts items into the sidekiq queue for processing.

Deployment
The app can be 90% deployed from puppet. There are additional requirements once puppet has installed of the dependencies:

su gpackages RAILS_ENV=production bin/first-time

It should do all the things to make the site work.