NGA is proposing to accelerate the work of upgrading GeoNode鈥檚 codebase from Python 2.7 to 3.7, Django 1.11 to 2.1, and replace all Angular 1.4 with React and JavaScript code. We will coordinate this work as part of our GEOINT Services contract to make sure this work is completed and pushed back to the GeoNode community by the end of March 2020. Work related to GeoNode as part of the GEOINT Services program will be pushed back to the GeoNode community as part of our open source commitment when appropriate. All work will be performed by Boundless Spatial at the direction of NGA. The following document outlines the work required to deliver on this upgrade work.
We鈥檝e already begun work on the Angular 1.4 to React migration in another GNIP (https://github.com/GeoNode/geonode/issues/4129). This GNIP will focus on the Python 2 to 3 and Django 1.11 to 2.1 upgrades. We propose to complete the Python and Django upgrade process in the following order. Of note, this process is subject to change as we work on these items and uncover dependencies during the upgrade process.
Once all of this is done on master, the community will be able to decide which version we call this, and projects can start upgrading their own codebases if they choose to do so.
Key links:
Looks good. +1 馃憤
This work has been put on pause by NGA at the moment. We are working with them to identify who/when the work will be completed. Hope to have more information by the end of April.
@copaskevin Any news?
@frafra No news from NGA. The rumor is that they will be funding this work outside a different contract but it will more than likely not be coming from the contract awarded to us.
Any update on this proposal? We may be able to contribute some dedicated time late in the year / early next year to help with upgrade efforts.
Hi @GeoTob no particular updates up to now. GeoSolutions will probably invest some resources on this hopefully before the next year. It would be good to cooperate on this of course.
If our proposal gets funding, we will also be able to contribute. We will get more info later this year. Let麓s do it together.
Hi. SCISYS UK is sponsoring the code sprint at the up coming UK FOSS4G conference. We are using geonode in a number of uk government and private sector projects. It would be great to get some progress on this issue. Has there been any progress anywhere on this?
Regarding the mentioned proposal: If it is succesful the funding will not start before Oktober 2020. I am sorry.
It would be great to get some help from the community at the up-coming UK FOSS4G, this is a great forum for this?
Hey all, while I won't be at the up coming UK FOSS4G, I am going to be getting up to speed on this task and picking it up soon. The information is largely the same as described originally to my understanding, but for now the task is on my radar instead. Will keep you updated as I start making progress.
Nice, we have time set aside from late November onwards if help is still needed by then :-)
Just wondering if any one managed to make progress on this? If not I would like to propose that our team picks this up from 18 November. We would develop against a public fork of the latest stable release while keeping close to the plan outlined in the issue above.
Would obviously welcome any community contributions to our efforts.
@GeoTob What great news! We had this yesterday in gitter chat.
I hope it's okay to quote @travislbrundage here:
Well, I've been wrestling with that + trying to speed up the tests for GeoNode (there's some conversation before about it). So far I have only really done organization. I have a spreadsheet continued from the work coop had done with all the libraries that will need replacement or updating with Python3 (fortunately not too many). With this problem out of the way I'll start committing some updates to the unit tests to increase coverage/speed up if possible.
So it would be great if you two could get in contact and coordinate !
@ all ... I guess GeoSolutions also will jump soon into this. Probably from November.
The priority now is to close the 2.10.1 release. Then we will focus on Python3 upgrade.
We have two team members free after FOSS4G Oceania through to February - sounds like this won't be a problem to get done with everyone's help:) Let's coordinate in November?
* Dreamteam * 馃憤
This is excellent to hear! I welcome all the help I can getting this done. :)
There is not too much to update since I last posted as it took a while to get transitioned onto this task. I will reach out on the developer email list to create a more detailed post on progress and what I foresee going forward.
For now I am just trying to help with the 2.10.1 release + improve unit testing so the Python upgrade (hopefully) goes more smoothly. Looking forward to working with you all!
Hey all, making a quick update to this. The main post will be edited with key information and links. I've made some documents to keep track of work that needs to be done so people can work in parallel. You can find more detailed information in the thread I've made on the mailing list, also linked. Thanks for all the help and feedback :)
We now have a prototype working on Python3.
For testing purposes I've merged all the currently open PRs into my own fork at https://github.com/geotob/geonode, but once the PRs are merged we should be able to run against the master branch here.
If you want to test it out, I have pasted instructions below. Next steps from our point of view are:
GeoNode Python3 environment
(hoping this works ....)
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
pygdal compatible with your system's gdal (run gdal-config --version and pick a compatible pygdal version).NOTE: You will have to change the paths below to work with your version. You may be running a different version of Python3, and packages may be installed in the lib folder instead of lib64
2to3 -w venv/lib64/python3.7/site-packages/gsimporter
sed -i "s/ async/ asyn/g" venv/lib64/python3.7/site-packages/gsimporter/api.py
python3 manage.py migrate
SESSION_EXPIRED_CONTROL_ENABLED=False python3 manage.py runserver
@GeoTob regarding all the submitted PRs I'm wondering what's the rationale to merge several try/catch for maintaining the compatibility with the import of python 2. I guess the problem is Travis but then I would expect the required changes to make it pass.
cc @afabiani
@francbartoli just compatibility reasons really:
Once we're confident everything works on python3 it'll be trivial to remove the try..excepts
Thanks @GeoTob, as already expressed on gitter I strong believe the priority on master is to make the switch to python 3 as soon as possible rather than avoid problems for people checking out. Anybody who can help out in whatever form is welcome, including the port of Travis to python 3.
In my honest opinion, I think the strategy to make sure the tests pass against py2 and py3 in parallel is a little bit too much conservative but I can be wrong.
I agree with @francbartoli on this one.
@francbartoli I think we can disagree here - keeping compatibility has helped our team upgrade all apps and most dependencies to python3 and lets us rely on the existing test runners to make sure we haven't broken anything along the way.
I can see absolutely no downside in keeping master from breaking as long as possible, even if that means we have to temporarily accept a code quality issue around try..except imports. But again, it will be trivial to remove those once everything works on python 3 and the test runners have been upgraded.
So for now, compatibility helps us to work in parallel across teams and make small, incremental & testable changes .... I'm failing to see how changing this would make us go even faster ?
@GeoTob that is a valid point but we need to think about the cost of maintaining this.
Adding more code will increase maintenance cost, will make it harder to add unit tests, etc. etc.
I agree @simboss and sorry if it wasn't clear -- we have to drop python2 compatibility for Django 2+ in any case, so this is a temporary crutch to help us make the transition easier. We can remove all those lines once everything works in python 3.
Most helpful comment
@ all ... I guess GeoSolutions also will jump soon into this. Probably from November.
The priority now is to close the 2.10.1 release. Then we will focus on Python3 upgrade.