<commit_before>from deployer.console import confirm
from deployer.contrib.commands import wget
from deployer.contrib.services.apt_get import AptGet
from deployer.contrib.services.config import Config
from deployer.contrib.services.upstart import UpstartService
from deployer.query import Q
from deployer.service import Service, required_property, isolate_host
from pygments.lexers import IniLexer


# /etc/redis.conf template
config_template = \
"""
# Redis configuration file

# Authentication
%(password)s

# Save location
dbfilename %(database_file)s
dir %(directory)s

# Auto save
# (after 60 seconds if at least one key has been changed)
# e.g. save 60 1
%(auto_save)s

port %(port)s

%(bind)s
"""

@isolate_host
class Redis(Service):
    """
    Key/Value storage server
    """
    # Port and slug should be unique between all redis installations on one
    # host.
    port = 6379
    database = 0
    slug = required_property()
    password = <PASSWORD>_property()

    # username for the server process
    username = required_property()

    # Bind to interface, e.g. '127.0.0.1'
    bind = None

    # Download URL
        # redis_download_url = 'http://redis.googlecode.com/files/redis-2.4.18.tar.gz'
    redis_download_url = 'http://redis.googlecode.com/files/redis-2.6.7.tar.gz'

    # directory for the database file, or None for the home directory
    @property
    def directory(self):
      # Fallback to home directory
      return self.host.get_home_directory()

    # Make persisntent True, when you want to save this database to the disk.
    persistent = False

    @property
    def database_file(self):
        return 'redis-db-%s.rdb' % self.slug

    @property
    def config_file(self):
        return '/etc/redis-%s.conf' % self.slug

    class packages(AptGet):
        # Packages required for building redis
        packages = ('make', 'gcc',  'telnet', 'build-essential')<commit_msg>No redis password by default<commit_after>from deployer.console import confirm
from deployer.contrib.commands import wget
from deployer.contrib.services.apt_get import AptGet
from deployer.contrib.services.config import Config
from deployer.contrib.services.upstart import UpstartService
from deployer.query import Q
from deployer.service import Service, required_property, isolate_host
from pygments.lexers import IniLexer


# /etc/redis.conf template
config_template = \
"""
# Redis configuration file

# Authentication
%(password)s

# Save location
dbfilename %(database_file)s
dir %(directory)s

# Auto save
# (after 60 seconds if at least one key has been changed)
# e.g. save 60 1
%(auto_save)s

port %(port)s

%(bind)s
"""

@isolate_host
class Redis(Service):
    """
    Key/Value storage server
    """
    # Port and slug should be unique between all redis installations on one
    # host.
    port = 6379
    database = 0
    password = <PASSWORD>
    slug = required_property()

    # username for the server process
    username = required_property()

    # Bind to interface, e.g. '127.0.0.1'
    bind = None

    # Download URL
        # redis_download_url = 'http://redis.googlecode.com/files/redis-2.4.18.tar.gz'
    redis_download_url = 'http://redis.googlecode.com/files/redis-2.6.7.tar.gz'

    # directory for the database file, or None for the home directory
    @property
    def directory(self):
      # Fallback to home directory
      return self.host.get_home_directory()

    # Make persisntent True, when you want to save this database to the disk.
    persistent = False

    @property
    def database_file(self):
        return 'redis-db-%s.rdb' % self.slug

    @property
    def config_file(self):
        return '/etc/redis-%s.conf' % self.slug

    class packages(AptGet):
        # Packages required for building redis
        packages = ('make', 'gcc',  'telnet', 'build-essential')
{'fraction_non_alphanumeric': 0.09801876955161627, 'fraction_numerical': 0.011991657977059436, 'mean_word_length': 3.3258173618940248, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4103684', 'n_tokens_mistral': 1239, 'n_tokens_neox': 1180, 'n_words': 353}