<commit_before>from fabric.api import *
from fabric.contrib import *
from fabfile.common import *
import mongo

@task
def install():
    '''
    Installs the BukGet generator system.
    '''
    
    # First step is to install mongodb (if not already installed) and then make
    # the mongodb environment a master.
    mongo.install()
    mongo.master()

    # Next we need to install the needed dependencies in order to actually use
    # this entertaining bit of python code.  This means installing the python
    # development headers, libyaml, and pip.
    yum('python-devel', 'libyaml', 'libyaml-devel')
    run('curl https://bootstrap.pypa.io/get-pip.py | python')

    # Next we will go ahead and clone the generator repository.
    with cd('/opt'):
        run('git clone git://github.com/BukGet/generator.git')

    # Now to actually install the generator
    with cd('/opt/generator'):
        run('pip install --upgrade ./')

    # next we need to set some cronjobs, as these are setting the pace for when
    # generation is occuring.
    cronjobs = [
        '0 */6 * * * root /usr/bin/bukgen_bukkit speedy',
        '0 1   * * 5 root /usr/bin/bukgen_bukkit speedy_full',
        '30 5  * * * root python /opt/devfiles/logreader.py',
    ]
    for job in cronjobs:
        if not files.contains('/etc/crontab', job):
            files.append('/etc/crontab', job)


@task
def upgrade():
    '''
    Upgrades the BukGet generator to the current version in git.
    '''
    with cd('/opt/generator'):
        run('pip install --upgrade ./')
<commit_msg>Added info for SSH keys & added fabric into install<commit_after>from fabric.api import *
from fabric.contrib import *
from fabfile.common import *
import mongo

@task
def install():
    '''
    Installs the BukGet generator system.
    '''
    
    # First step is to install mongodb (if not already installed) and then make
    # the mongodb environment a master.
    mongo.install()
    mongo.master()

    # Next we need to install the needed dependencies in order to actually use
    # this entertaining bit of python code.  This means installing the python
    # development headers, libyaml, and pip.
    yum('python-devel', 'libyaml', 'libyaml-devel')
    run('curl https://bootstrap.pypa.io/get-pip.py | python')
    run('pip install fabric')

    # Next we will go ahead and clone the generator repository.
    with cd('/opt'):
        run('git clone git://github.com/BukGet/generator.git')

    # Now to actually install the generator
    with cd('/opt/generator'):
        run('pip install --upgrade ./')

    # next we need to set some cronjobs, as these are setting the pace for when
    # generation is occuring.
    cronjobs = [
        '0 */6 * * * root /usr/bin/bukgen_bukkit speedy',
        '0 1   * * 5 root /usr/bin/bukgen_bukkit speedy_full',
        '30 5  * * * root python /opt/devfiles/logreader.py',
    ]
    for job in cronjobs:
        if not files.contains('/etc/crontab', job):
            files.append('/etc/crontab', job)
    run('ssh-keygen -t rsa -N ""')
    key = run('cat /root/.ssh/id_rsa.pub')
    print '\n'.join([
        '\n[!] System Built.  Please update the authorized_keys template with',
        '    the key below this message.  This key needs to be pushed out to',
        '    the rest of the environment in order for things like logrotate',
        '    to work.',
    ])
    print key

@task
def upgrade():
    '''
    Upgrades the BukGet generator to the current version in git.
    '''
    with cd('/opt/generator'):
        run('pip install --upgrade ./')

{'fraction_non_alphanumeric': 0.1137824993010903, 'fraction_numerical': 0.004473022085546547, 'mean_word_length': 2.5320829220138203, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7358773', 'n_tokens_mistral': 1101, 'n_tokens_neox': 1035, 'n_words': 383}