<commit_before>python-django-repomgmt

This Django app implements everything you need to create APT repositories,
buildd infrastructure as well as automatic package building.

It expects access to an OpenStack Compute cloud to perform builds and uses
reprepro on the backend to manage the APT repositories, process incoming,
etc.

Setting it up should be fairly simple.

You need Django, django-tastypie, django-celery, sbuild and devscripts
installed.

These are the configuration options you need to add to your settings.py:

APT_REPO_BASE_URL

    The base URL by which your repositories will be reachable.

    E.g. if set to http://apt.example.com/, it's assumed that
    your web server is configured to expose e.g. the "cisco" repository
    under http://apt.example.com/cisco

POST_MK_SBUILD_CUSTOMISATION

    An argv to be executed in the schroot after mk-sbuild is done.

    E.g. to avoid using a proxy for a apt.example.com, you can do
    something like:

    POST_MK_SBUILD_CUSTOMISATION = ['bash', '-c', 'echo \'Acquire::HTTP::Proxy::apt.example.com "DIRECT";\' > /etc/apt/apt.conf.d/99noproxy']

BASE_URL

    The base URL of the repomgmt app. This is used to construct URLs
    where build nodes can fetch their puppet manifest.

BASE_TARBALL_URL

    A URL where the generated tarballs can be found. The tarballs generally
    land in /var/lib/schroot/tarballs, so you should configure a web server to
    serve that directory at this URL.

BASE_REPO_DIR

    The base directory where the repositories should be kept.
    Each repository will be represented by a subdirectory here.

TESTING

    If set to True, repomgmt will be in testing mode and won't write anything
    to disk.

It is also expected that django-celery is already configured. This should be as simple as adding something like this near the end of your settings.py:

    INSTALLED_APPS += ("djcelery", )
    import djcelery
    djcelery.setup_loader()

    BROKER_URL = 'amqp://guest:guest@localhost:5672/'

You also need to add the django.contrib.humanize app to INSTALLED_APPS.<commit_msg>Add my copy/paste file for spinning up a dev env<commit_after>python-django-repomgmt

This Django app implements everything you need to create APT repositories,
buildd infrastructure as well as automatic package building.

It expects access to an OpenStack Compute cloud to perform builds and uses
reprepro on the backend to manage the APT repositories, process incoming,
etc.

Setting it up should be fairly simple.

You need Django, django-tastypie, django-celery, sbuild and devscripts
installed.

These are the configuration options you need to add to your settings.py:

APT_REPO_BASE_URL

    The base URL by which your repositories will be reachable.

    E.g. if set to http://apt.example.com/, it's assumed that
    your web server is configured to expose e.g. the "cisco" repository
    under http://apt.example.com/cisco

POST_MK_SBUILD_CUSTOMISATION

    An argv to be executed in the schroot after mk-sbuild is done.

    E.g. to avoid using a proxy for a apt.example.com, you can do
    something like:

    POST_MK_SBUILD_CUSTOMISATION = ['bash', '-c', 'echo \'Acquire::HTTP::Proxy::apt.example.com "DIRECT";\' > /etc/apt/apt.conf.d/99noproxy']

BASE_URL

    The base URL of the repomgmt app. This is used to construct URLs
    where build nodes can fetch their puppet manifest.

BASE_TARBALL_URL

    A URL where the generated tarballs can be found. The tarballs generally
    land in /var/lib/schroot/tarballs, so you should configure a web server to
    serve that directory at this URL.

BASE_REPO_DIR

    The base directory where the repositories should be kept.
    Each repository will be represented by a subdirectory here.

TESTING

    If set to True, repomgmt will be in testing mode and won't write anything
    to disk.

It is also expected that django-celery is already configured. This should be as simple as adding something like this near the end of your settings.py:

    INSTALLED_APPS += ("djcelery", )
    import djcelery
    djcelery.setup_loader()

    BROKER_URL = 'amqp://guest:guest@localhost:5672/'

You also need to add the django.contrib.humanize app to INSTALLED_APPS.

= Quickly establishing a development environment =

A simple Puppet module is included, mostly intended for development purposes.
Fire up a fresh, clean Ubuntu VM and log in.

(This is a dump of my copy/paste file for this, it's not meant as a script)

sudo apt-get -y install git puppet
git clone https://github.com/sorenh/python-django-repomgmt
sudo -H puppet apply --modulepath python-django-repomgmt/puppet python-django-repomgmt/puppet/repomgmt/tests/install.pp 
cd buildd
screen
python manage.py runserver 0.0.0.0:8000

{'fraction_non_alphanumeric': 0.06059322033898305, 'fraction_numerical': 0.00423728813559322, 'mean_word_length': 3.725725725725726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '5575369', 'n_tokens_mistral': 1465, 'n_tokens_neox': 1364, 'n_words': 611}