From 2187a7db74d5b4d6056dfacd7f2eb2850430fded Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Fri, 4 Mar 2022 21:25:49 +0000 Subject: [PATCH] Troggle status update in handbook --- handbook/troggle/trogdjangup.html | 57 +++++++++++++++++++++---------- handbook/troggle/trogstatus.html | 19 +++++++++-- handbook/website-history.html | 2 +- 3 files changed, 57 insertions(+), 21 deletions(-) diff --git a/handbook/troggle/trogdjangup.html b/handbook/troggle/trogdjangup.html index 39b8c1dc9..718d3b097 100644 --- a/handbook/troggle/trogdjangup.html +++ b/handbook/troggle/trogdjangup.html @@ -69,10 +69,15 @@

Major, minor and releases

-

Django release 2.2.20 is major-version 2, minor-version 2, and patch-release 20. 2.2 is the "feature release" and patch releases within each feature release are not meant to break anything. They are just to fix bugs. -

Things will break between feature releases which come out every 8 months. We plan on upgrading troggle on the server whenever we upgrade the server operating system, which we do only every 2-3 years between Debian LTS releases. -

You will come to rely extensively on the release notes and versions documentation which is maintained by django. -

You will also need to read the django guide to upgrading to newer versions. +

Django release 3.2.10 is major-version 3, minor-version 2, and patch-release 10. 3.2 is the "feature release" and patch releases within each +feature release are not meant to break anything. They are just to fix bugs. +

Things will break between feature releases which come +out every 8 months. We plan on upgrading troggle on the server whenever we upgrade the server operating system, which we do only every 2-3 years +between Debian LTS releases. +

You will come to rely extensively on the release notes and versions +documentation which is maintained by django. +

You will also need to read the django guide to upgrading to newer +versions.

Django plugins ("apps")

Documentation for the plugins is highly variable and plugin projects, being run by volunteers, can just die unexpectedly. For the django-registration plugin there are two sources of current information:
@@ -86,14 +91,17 @@ pypi.org/project/django-extensions/ (only available for django 2.2 and later). ]

Troggle software development

-

Upgrading the version of django used by troggle is a serious programming job. It is not just a matter of editing a few config files. You will need a full troggle software development environment set up on your machine including, most definitely, the capability of running the troggle test suite. See how to set up a troggle software development laptop. Note particularly that you will find sqlite database browser software very helpful and that you will need to know git. +

Upgrading the version of django used by troggle can be a serious programming job. It is not just a matter of editing a few config files. You +will need a full troggle software development environment set up on your machine including, most definitely, the capability of running the +troggle test suite. See how to set up a troggle software development laptop. Note particularly that you will find +sqlite database browser software very helpful and that you will need to know git.

Important Tricks

There are six critical tricks that make everything much, much easier:

  1. Use pip venv or virtualenv to set up a virtual python environment within which you can easily and quickly change the specific releases of python, django, django's dependencies and django plugins. - With a previously created venv py37d22 start it up like this:
    - cd py37d22
    + With a previously created venv py39d32 start it up like this:
    + cd py39d32
    source bin/activate
    python --version
    cd troggle
    @@ -102,21 +110,31 @@ python manage.py check -v 3
    django-admin check
    python manage.py test -v 3 --traceback
    -
  2. Use the highest release number when upgrading between minor-versions of django.
    So we went from 1.8.19 to 1.9.13 to 1.10.8 to 1.11.29 to 2.0.13 to 2.1.15 then 2.2.19 (.20 was not released then) and next we will go to 3.2.x . +
  3. Use the highest release number when upgrading between minor-versions of django.
    +So we went from 1.8.19 to 1.9.13 to 1.10.8 to 1.11.29 to 2.0.13 to 2.1.15 then 2.2.19 (variously patched at .20, .24, .25) and then 3.2.10 when +we upgraded debian 10 (buster) to 11 (bullseye).
  4. Use the django 'check' maintenance system at the most verbose setting at each release
    troggle$ python manage.py check -v 3 --deploy
    troggle$ python -Wall manage.py check
  5. Use our test suite (and if you see errors, run it with -v 3)
    troggle$ python manage.py test [-v 3]
    -
  6. Read all the release notes for all the intermediate releases. So from 1.1.29 we read 14 sets of notes: for 2.0, 2.0.1, 2.0.2... up to 2.0.13 . -
  7. Seriously learn how to use the traceback webpage produced by django when a page crashes. There is a full record of every variable value hidden in there. -
  8. You will be doing a lot of local testing just on your development machine. The default is to use the webserver built into Django: python manage.py runserver 0.0.0.0:8000 -v 3. Alternatively you can install and use gunicorn: +
  9. Read all the release notes for all the intermediate releases. So from 1.1.29 we read 14 sets of notes: for 2.0, 2.0.1, 2.0.2... up to 2.0.13 . +
  10. Seriously learn how to use the traceback webpage produced by django when a page crashes. There is a full record of every variable value +hidden in there. +
  11. You will be doing a lot of local testing just on your development machine. The default is to use the webserver built into Django: +python manage.py runserver 0.0.0.0:8000 -v 3. Alternatively you can install and use gunicorn: gunicorn --reload -w 9 -b :8000 wsgi. the '-w' flag is for the number of worker threads and should be 2n+1 where n is the number of cpu cores on your machine.
+

Deprecation warnings and python versions

-

The individual releases within a minor version don't break anything but do fix bugs. So if you are on 1.10.x there is no point in getting 1.11.1 to work and you should go straight to 1.11.29 . +

The individual releases within a minor version don't break anything but do fix bugs. So if you are on 3.1.x there is no point +in getting 3.2.1 to work and you should go straight to the latest available on your machine of the 3.2 feature release, i.e. 3.2.10 on debian 11.

check --deploy gives django warnings about security issues in your settings as well as django deprecation warnings.
--Wall is a standard python option and gives warnings of deprecated python features used by django and all the current plugins. So it tells us that django 1.11.29 is using a deprecated python language feature which will be removed from the language in python 3.9 . Python version compatibilities are documented at the top of each x.0 release note. From Django 3.0 it requires python 3.6. +-Wall is a standard python option and gives warnings of deprecated python features used by django and all the current plugins. So it +tells us that django 1.11.29 is using a deprecated python language feature which will be removed from the language in python 3.9 . Python +version compatibilities are documented at the top of each x.0 release note. From Django 4.0 it requires python 3.8.

The upgrade process

Django migrations - prior reading

@@ -133,7 +151,7 @@

Running troggle before and after a Django migration

  1. ensure that you have the exact version of python installed on your machine as is live for troggle on the server, e.g. do $ sudo apt install python3.7.5. -
  2. create a venv using the version of python to be used. +
  3. create a venv using the version of python to be used.
    We have a script to help you do this in :troggle:venv-trog.sh
  4. do a clean install of django and troggle.
  5. check the versions of plugins using pip list -o
  6. open two terminal windows: @@ -175,7 +193,7 @@ pytz==2021.1 sqlparse==0.4.1 Unidecode==1.2.0 -Although the above all work fine, on debian buster we are actually using the standard installs which are older: +Although the above all work fine, on debian buster we were actually using the standard installs which are older:
    $ pip freeze
     confusable-homoglyphs==3.2.0
     Django==2.2.19
    @@ -188,10 +206,13 @@ Unidecode==1.0.23

    To upgrade pip istelf, do $ pip install --upgrade pip

    Django database dependencies

    -

    On the expo server we run MariaDB as the database which has its own dependencies. In particular +

    On the expo server we run MariaDB as the database which has its own dependencies. In particular under debian buster we +had to use MariaDB v1.3.10 which was the latest version supported by buster:

    mysqlclient==1.3.10
    -
    which is technically incompatible with Django 2.2 which requires 1.3.13. This incompatibility is a policy choice by the Django team. Wookey ran the Django system tests with this (April 2020) and it works fine. +which is technically incompatible with Django 2.2 which requires 1.3.13. +This incompatibility is a policy choice by the Django team. Wookey ran the Django system tests with 1.3.10 (April 2020) and it worked fine. +Django just didn't support it because they couldn't spare the effort to test it.

    To run Django's system test suite:

    This is only necessary if we hit a policy-imposed incomatibility, as we did with mysqlclient==1.3.10 . We have only ever had to do this once. @@ -200,7 +221,7 @@ Follow the instructions in the "Unit tests" section installed locally at docs/in This involves running git clone on the django source repo to download the tests. We hope we never have to do this again but in case we get incomprehensible bugs in future, we should be prepared to do so.


    -

    We should not need to anything until we move from django 2.2 LTS to 3.2 LTS which we may never do. +

    Current upgrade status is documented: here.

    diff --git a/handbook/troggle/trogstatus.html b/handbook/troggle/trogstatus.html index ad2a68a11..11fc56000 100644 --- a/handbook/troggle/trogstatus.html +++ b/handbook/troggle/trogstatus.html @@ -27,8 +27,23 @@ In the course of these migrations several unused or partly-used django plugins w

    April 2021

    Lockdown has been good to troggle. During March and April Philip migrated troggle up to Django 2.2.19, excising the ancient and unused user registration system on the way. Django 2.2 LTS is a long-term stable relase which will be in-support by Django until April next year. Wookey discovered and ran the Django system testsuite on the Debian server thus enabling us to use a necessary (but obstensibly outdated) link between Django and the database MariaDB. As of April 9th troggle is now running on software which is actually 'in date'.

    We plan to stick with this configuration for a year.

    -

    Next April (2022) we may upgrade to the forthcoming debian stable release 11 bullseye. At that point debian will have python 3.8 as standard. We also hope to migrate to django 3.2 LTS which will be a year old by then and which will be supported until April 2025. -

    With any luck that will be the last of our involvement with django migrations as we may not move on from using django 3.2 until we stop using django altogether, see troggle architecture speculations. + + +

    March 2022

    + +

    The week beginning 7th March we plan to upgrade to the debian release 11 bullseye. +At this point 'debian stable' is bullseye and has python 3.9 as +standard. We will also migrate to Django 3.2 LTS which will be a year old by then and which will be supported until April 2024. +Bullseye will be in support until June 2026. + +

    Django migrations are not nearly as painful as they used to be, and troggle is already compatible with Django 4.0.3 (though we won't use that). +So the presure to migrate from Django is now very greatly lessened. However, see troggle architecture speculations +and possible migration from Django. + + +

    We should not need to anything until we move from django 3.2 LTS to 4.2 LTS before April 2024. +


    git logo Return to:
    diff --git a/handbook/website-history.html b/handbook/website-history.html index 67cb9d6e8..987808e0d 100644 --- a/handbook/website-history.html +++ b/handbook/website-history.html @@ -33,7 +33,7 @@ summary {

    Early history

    -Over 42 years, CUCC has developed methods for handling such information. Refinements in data +Over more than 4 decades, CUCC has developed methods for handling such information. Refinements in data management were made necessary by improved quantity and quality of survey; but refinements in data management also helped to drive those improvements. The first CUCC Austria expedition, in 1976, produced only Grade 1 survey for the most part (ref