Permalink
Browse files

Added brief descriptions and author names to install/, jobs/, misc/ge…

…n_invite_code/
  • Loading branch information...
sundresh committed Dec 2, 2011
1 parent 8a9d77a commit 4b10e681cb49e5c16aba4429dfbfadfd9b512463
View
@@ -1,3 +1,13 @@
#
# Djangy installer -- apache web server.
#
# As a stopgap, apache needs to run on the master node, because the main
# controller/website hasn't been transitioned over to run using Gunicorn.
# Apache sits behind the nginx frontend, just like Gunicorn processes.
#
# Author: Sameer Sundresh <sameer@sundresh.org>
#
import os.path
from core import *
@@ -1,3 +1,15 @@
#
# Djangy installer -- application uids/gids.
#
# Each application on Djangy runs as a separate host uid/gid. At first, we
# tried running code as uid/gid without any entries in /etc/passwd or
# /etc/group, but apache wouldn't allow that. We then switched over to
# running applicatinos using Gunicorn, but kept this code in place, since
# we use different uid/gid pairs for setup, web servers, and (planned, not
# fully implemented) cron jobs.
#
# Author: Sameer Sundresh <sameer@sundresh.org>
#
import re
from core import *
View
@@ -1,4 +1,10 @@
#! /usr/bin/env python
#
# Perform a backup of the Djangy system state.
#
# Author: Dave Paola <dpaola2@gmail.com>
#
import subprocess, dump_archive, os
from s3put import *
View
@@ -1,3 +1,13 @@
#
# Declarative decorators and predicates for Djangy's installer.
#
# The idea is you specify how things should be, and the code either
# verifies that it is so, or performs actions to make it so, or
# fails with an exception if the system is in a conflicting state.
#
# Author: Sameer Sundresh <sameer@sundresh.org>
#
import grp, os, os.path, pwd, shutil, subprocess, tempfile
View
@@ -1,3 +1,10 @@
#
# Djangy installer -- MySQL database configuration.
#
# Authors: Sameer Sundresh <sameer@sundresh.org>
# Dave Paola <dpaola2@gmail.com>
#
import os.path
import config
from core import *
View
@@ -8,6 +8,9 @@
# Creates an archive file called djangy_dump_YYYY-MM-DD_hh-mm-ss.fff.tar.gz
# in the current directory.
#
# Author: Sameer Sundresh <sameer@sundresh.org>
#
import os, os.path, re, shutil, subprocess, sys, tempfile, time
# This is the MySQL root password on the old master node whose state you're
View
@@ -1,3 +1,9 @@
#
# Djangy installer -- configure the git server.
#
# Author: Sameer Sundresh <sameer@sundresh.org>
#
import os, os.path, subprocess
from core import *
View
@@ -1,4 +1,10 @@
#!/usr/bin/env python
#
# Djangy installer. See core.py for the basic definitions of the
# declarative installer DSL used here.
#
# Author: Sameer Sundresh <sameer@sundresh.org>
#
import os, sys
import config
from core import *
View
@@ -1,4 +1,11 @@
#!/usr/bin/env python
#
# Install a Djangy system dump created by dump_archive.py
# Useful for deploying a new clone of a Djangy server.
#
# Author: Sameer Sundresh <sameer@sundresh.org>
#
import os, os.path, re, subprocess, sys, time
from core import *
import config
View
@@ -1,3 +1,13 @@
#
# Djangy installer -- nginx front-end web server.
#
# Configure the front-end nginx proxy/caching server, if this is a front-end
# node. A single nginx front-end node can proxy to applications running on
# multiple middle-tier application nodes.
#
# Author: Sameer Sundresh <sameer@sundresh.org>
#
import os, os.path
from core import *
View
@@ -1,4 +1,9 @@
#! /usr/bin/env python
#
# Download a file from the backups Amazon S3 bucket.
#
# Author: Dave Paola <dpaola2@gmail.com>
#
import S3, sys, config, os
View
@@ -1,4 +1,9 @@
#! /usr/bin/env python
#
# List the files contained in the backups Amazon S3 bucket.
#
# Author: Dave Paola <dpaola2@gmail.com>
#
import S3, sys, config, os
View
@@ -1,4 +1,9 @@
#! /usr/bin/env python
#
# Upload a file to the backups Amazon S3 bucket.
#
# Author: Dave Paola <dpaola2@gmail.com>
#
import S3, sys, config, os
from core import read_file
View
@@ -1,4 +1,9 @@
#! /srv/djangy/run/python-virtual/bin/python
#
# Report usage information to the billing agent.
#
# Author: Dave Paola <dpaola2@gmail.com>
#
from master_api import report_all_usage
import sys
@@ -1,4 +1,10 @@
#!/usr/bin/env python
#
# Generate random invitation codes of the form "adjective adjective noun."
# You can customize the adjectives.txt and nouns.txt files to suit your tastes.
#
# Author: Sameer Sundresh <sameer@sundresh.org>
#
import random, sys
@@ -20,8 +26,13 @@ def choose_word(words):
adj2 = choose_word(adjectives)
while adj1[-1] == adj2[-1]:
adj2 = choose_word(adjectives)
# For some reason, results looked better to me when the last letter of
# the first word came alphabetically before the last letter of the
# second word. Clearly, this is a superficial proxy for the actual
# semantic interaction between adjectives.
if adj1[-1] > adj2[-1]:
(adj1, adj2) = (adj2, adj1)
# Zombie usually sounds better as the second adjective than the first.
if adj1 == 'zombie':
(adj1, adj2) = (adj2, adj1)
noun = choose_word(nouns)

0 comments on commit 4b10e68

Please sign in to comment.