Correctly apply v3.6.0 (Ubuntu 24.04) patch#1956
Correctly apply v3.6.0 (Ubuntu 24.04) patch#1956spwoodcock wants to merge 2 commits intoOpenDroneMap:masterfrom
Conversation
* Changes to support building on Ubuntu 24.04 and windows-2022 Github runner.
* Update Python to 3.12
* Install dependencies in virtual environment
* Run python scripts from the virtual environment)
* Update dependencies
* Ubuntu dependencies in snap/snapcraft24.yaml
* Python dependencies in requirements.txt
* Windows dependencies built in OpenDroneMap/windows-deps repo
* Update CUDA
* 12.8.1 on Windows
* 13.0.0 on Ubuntu)
* Run tests as part of docker build
* Use exact commits to specify dependencies that are built from source, instead of branch names
* Use upstream versions of Libraries:
* PDAL
* PDAL-Python
* untwine
* ExifRead
* draco
* Build windows builds with -j2
* Use Micasense's latest version of dls.py
* Update failing unit tests to match current behavior
The Merging shouldn't change these lines on Line 13 in 756cb08 |
|
Excellent. Will test this afternoon and revert. |
There was a problem hiding this comment.
Needs this change to address lack of overwrite on point cloud classification (add overwrite flag to line 163 of opendm/dem/pdal.py):
https://github.com/OpenDroneMap/ODM/pull/1950/files
But even then the python gdal issue remains:
[INFO] running "/code/venv/bin/python3" "/code/opendm/tiles/hsv_merge.py" "/code/odm_dem/dtm.previewcolor.tif" "/code/odm_dem/dtm.previewhillshade.tif" "/code/odm_dem/dtm.previewcolored_hillshade.tif"
/code/venv/lib/python3.12/site-packages/osgeo/gdal.py:312: FutureWarning: Neither gdal.UseExceptions() nor gdal.DontUseExceptions() has been explicitly called. In GDAL 4.0, exceptions will be enabled by default.
warnings.warn(
Traceback (most recent call last):
File "/code/opendm/tiles/hsv_merge.py", line 198, in <module>
rScanline = rBand.ReadAsArray(0, i, hillband.XSize, 1, hillband.XSize, 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/code/venv/lib/python3.12/site-packages/osgeo/gdal.py", line 5283, in ReadAsArray
from osgeo import gdal_array
File "/code/venv/lib/python3.12/site-packages/osgeo/gdal_array.py", line 10, in <module>
from . import _gdal_array
ImportError: cannot import name '_gdal_array' from 'osgeo' (/code/venv/lib/python3.12/site-packages/osgeo/__init__.py)
[WARNING] Cannot generate colored hillshade: Child returned 1
[INFO] running gdal_translate -outsize 1400 0 -of png "None" "/code/opensfm/stats/dtm.png" --config GDAL_CACHEMAX 46.6%
ERROR 4: None: No such file or directory
===== Dumping Info for Geeks (developers need this to fix bugs) =====
Child returned 1
Traceback (most recent call last):
File "/code/stages/odm_app.py", line 82, in execute
self.first_stage.run()
File "/code/opendm/types.py", line 470, in run
self.next_stage.run(outputs)
File "/code/opendm/types.py", line 470, in run
self.next_stage.run(outputs)
File "/code/opendm/types.py", line 470, in run
self.next_stage.run(outputs)
[Previous line repeated 8 more times]
File "/code/opendm/types.py", line 449, in run
self.process(self.args, outputs)
File "/code/stages/odm_report.py", line 214, in process
system.run("gdal_translate -outsize {} 0 -of png \"{}\" \"{}\" --config GDAL_CACHEMAX {}%".format(image_target_size, colored_hillshade_dem, osfm_dem, get_max_memory()))
File "/code/opendm/system.py", line 112, in run
raise SubprocessException("Child returned {}".format(retcode), retcode)
opendm.system.SubprocessException: Child returned 1
I'm not comfortable letting the master branch sit broken for much longer, as we are formally rolling release. Perhaps we do follow the path of worst case and resolve commit by commit. |
|
Unsurprisingly, by contrast this finishes successfully Not sure the best procedure for cherry picking, but happy to do so and test each commit in sequence with guidance. |
Looks like it's mostly just one relevant pull request from Nathan adding JPEG XL support and his branch is still out there, the consequential 24.04 one aside: But, I don't know norms around hard pushes on remote branches well enough. My temptation would be: And then open back up and pull in the JPEG XL pull request, and then we work from there on sorting 24.04. But definitely interested in thoughts from @spwoodcock and @NathanMOlson. |
|
Don't try to merge the JPEG XL PR before 24.04, it depends on the 24.04 work. |
Ah, of course. |
|
Yeah something is bodged in the commits & I think the easiest approach is a reset & merging / cherry-picking what we need - I'll take a look today 👍 (and will run the same tests on the final code) |
|
My assumption was that something went wrong with the merge, but I don't think that's the case (I have done a fair bit of diffing and manual inspection and things seem to be in place). Could it actually be an error with the 24.04 upgrade? Steps from here1. Quick fix
2. RevertIf no luck in the next few hours, I'll make a quick PR to revert both: 3. InvestigateThen I'll do some investigation / testing of We can bundle the JPEG XL PR in with the 24.04 upgrade if that's ok @NathanMOlson 🙏 |
|
I have a feeling the issue is this: Lines 23 to 25 in 756cb08 For windows we are installing GDAL 3.11.1, but for MacOS and Linux we install 3.8.4. 3.8.4 is actually the correct version for Ubuntu 24.04, however in order to install this version correctly we need an older version of As the underlying system gdal version does appear to be 3.11.1, hence the errors above when accessing the shared modules. Building and testing now 👍 |
|
ok that failed to build - makes sense as we install libgdal from Ubuntu 24.04, which will clearly be 3.8.4 🤦 Will take another route. I also see you have already been here! #1904 (comment) |
|
I think I found the issue! We are extracting dependencies from the snapcraft yamls. package-repositories:
- type: apt
ppa: ubuntugis/ubuntugis-unstable
# Ensure prioritised above standard repo for GDAL version 3.11.1
priority: 1001
However, when the use I'm hoping updating configure.sh to add the PPA will fix this - testing a build now. |
|
Hopefully: UBUNTU_VERSION=$(lsb_release -r)
if [[ "$UBUNTU_VERSION" == *"20.04"* ]]; then
echo "Enabling PPA for Ubuntu GIS"
sudo $APT_GET install -y -qq --no-install-recommends software-properties-common
sudo add-apt-repository ppa:ubuntugis/ppa
sudo $APT_GET update
elif [[ "$UBUNTU_VERSION" == *"24.04"* ]]; then
echo "Enabling ubuntugis-unstable PPA for Ubuntu 24.04"
sudo $APT_GET install -y -qq --no-install-recommends software-properties-common
sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo $APT_GET update
fi |
|
I wonder if anyone would be opposed to basing this on Debian Trixie instead of Ubuntu 24.04 going forward? https://packages.debian.org/source/trixie/gdal |
24.04-->master(#1904) #19423.6.0release, which I believe is a working tag currently.masterin line with3.6.0, so hopefully everything works 🤞Related to #1949
Note
If this doesn't work, then in the worst case we could manually reset
masterHEAD to before these changes, then cherry-pick exactly what we needed on top, and force push.