<commit_before>======================
Docker Tips and Tricks
======================

Docker is used to do development and continuous integration on ``tecken``.
Below is a list of miscellaneous techniques to make development easier.

Bashing whilst running
======================

If you have two terminals open, and run ``make run`` in one and ``make bash``
in another they are entirely separate containers. Meaning, if you, in the
second terminal where you started bash try editing a file like this:

.. code-block:: shell

    > jed /usr/local/lib/python3.5/site-packages/django/http/request.py

Any changes are ignored by the first container. The solution is to run this
command:

.. code-block:: shell

    $ docker-compose exec --user 0 web bash

When you run that, you'll first notice that it opens almost instantly
since there's no booting-up time. Also, if you, in a *third* terminal
now run ``docker-compose ps`` you'll see that there is no new container
started. Now, any changes you make to files in this bash gets used by
the Django runserver in the first terminal.

All the changes you make (e.g. print statements inside some Python
<<<<<<< HEAD
dependency) is wiped any and forgotten when you stop the first container.
=======
dependency) is wiped any and forgotten when you rebuild the containers.
>>>>>>> 2b8447dde08cdf15bd31d5c665be80b0ff06f8c8

This is aliased in the ``Makefile`` as ``make currentshell``.<commit_msg>correcting bad merge oops<commit_after>======================
Docker Tips and Tricks
======================

Docker is used to do development and continuous integration on ``tecken``.
Below is a list of miscellaneous techniques to make development easier.

Bashing whilst running
======================

If you have two terminals open, and run ``make run`` in one and ``make bash``
in another they are entirely separate containers. Meaning, if you, in the
second terminal where you started bash try editing a file like this:

.. code-block:: shell

    > jed /usr/local/lib/python3.5/site-packages/django/http/request.py

Any changes are ignored by the first container. The solution is to run this
command:

.. code-block:: shell

    $ docker-compose exec --user 0 web bash

When you run that, you'll first notice that it opens almost instantly
since there's no booting-up time. Also, if you, in a *third* terminal
now run ``docker-compose ps`` you'll see that there is no new container
started. Now, any changes you make to files in this bash gets used by
the Django runserver in the first terminal.

All the changes you make (e.g. print statements inside some Python
dependency) is wiped any and forgotten when you rebuild the containers.

This is aliased in the ``Makefile`` as ``make currentshell``.
{'fraction_non_alphanumeric': 0.11642335766423358, 'fraction_numerical': 0.010218978102189781, 'mean_word_length': 4.438492063492063, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 12, 'https://': 0, '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': '1016237', 'n_tokens_mistral': 763, 'n_tokens_neox': 698, 'n_words': 384}