Dockerizing LANDIS-II - issues with GDAL

126 views
Skip to first unread message

cvisi...@gmail.com

unread,
Jan 6, 2019, 7:05:41 AM1/6/19
to LANDIS-II Developers
Hello all -

I am attempting to build a docker image with LANDIS-II v7 included for use on our high-performance linux server. I have followed the instructions for a linux installation on the GitHub page and have successfully compiled and ran linux locally (although I cannot seem to reproduce it on another local linux machine).

In any case, I am stuck at this error:


I assume this is due to the following warning when I am compiling the source code:


I have tried to manually install the Gdal.Core package whilst compiling by adding this line under <ItemGroup> in the Console.csproj file:

<PackageReference Include="Gdal.Core" Version="1.0.0" allowedVersions="[1.0, 2.0)" />

This resulted in the package files being located in /home/casey/.nuget/packages/gdal.core/1.0.0/runtimes/linux-x64/native

There are no missing libraries that I can see:


Any help would be greatly appreciated as I have given this a fair go but am not a windows user. Please note that since this is being dockerized all of the setup and installation must be per the command line. I imagine there a simple solution I am overlooking but I just can't crack it.  Is there a way to exclude the GDAL.NET and GDAL.NET.Core packages from the build?

Thanks again and happy to share the Dockerfile once it is working with anyone who is interested.

Cheers,
Casey Visintin

cvisi...@gmail.com

unread,
Jan 8, 2019, 5:26:49 AM1/8/19
to LANDIS-II Developers
UPDATE: After quite a bit more forensic work, I think I have discovered the issue. Unfortunately, the resolution seems to be out of my control so I look to all of you to help me out or provide some wisdom.

The NuGet.Config file in the build source code directory lists two package sources:

<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="landis-ii-v7" value="https://www.myget.org/F/landis-ii-v7/api/v3/index.json" />
</packageSources>
</configuration>
<?xml version="1.0" encoding="utf-8"?>

This is problematic because there is a package with the same ID and Version in both of these repositories. I am not sure if the push of Landis.RasterIO.Gdal to Nuget.org was intentional but it seems to be causing issues in the build (on Linux anyways). This is because the package on Nuget.org depends on Gdal.Net and Gdal.Net.Core - neither of which are available for .NetCore2.0 or include support files for a Linux system architecture. The package on Myget.org, on the other hand, depends on Gdal.Core Version 1.0.0 - this is compatible with Linux. So when the package on MyGet.org is used, the software builds and works as intended.

At first I couldn't work out why the install worked on some linux machines and not other others, despite having identical system builds. It turns out that the version of Nuget that is included in Dotnet SDK for Linux does not allow prioritisation of package sources with duplicate packages (I don't think any new versions do). Rather, it simply uses the package that is downloaded first - dependent on the server loads at a given time. Thus, there can be some unpredictable results...

So...perhaps the simplest solution is to change the Landis.RasterIO.Gdal version number on NuGet to 2.0.1 (as it is newer). This will allow the correct package to be sourced each time and the instructions for a linux build of LANDIS-II version 7 on GitHub to be executed without error. Unless, of course, there is a way to specify the source with each package - but I can't find a way to do this.

Another solution may be to duplicate and rename the package on MyGet.org to identify its use for Linux (e.g. Landis.RasterIO.Gdal.Linux). Just throwing out ideas here.

Please let me know and thanks again for all of your help and great work developing the software.

Cheers,
Casey

cvisi...@gmail.com

unread,
Jan 9, 2019, 5:09:17 AM1/9/19
to LANDIS-II Developers
UPDATE 2:

After some help from one of the developer community members, the duplicate packages on Nuget.org and Myget.org have been resolved. So I now have a working dockerised build of Landis-II for deployment on a server. Please hit me up if you would like a copy to look at.

Thanks again everyone.

Cheers,
Casey

Kelsey

unread,
Jan 10, 2019, 8:20:36 AM1/10/19
to LANDIS-II Developers
Hi Casey,

I would definitely like to see a copy of your docker build. I have also created a docker build of Landis-II (version 6.2 converted to use .NetCore and Nuget to run on linux) and am currently working on creating a build for singularity. It would be great to be able to compare your build to mine.

Best,
Kelsey

janer...@gmail.com

unread,
Mar 5, 2019, 2:07:08 PM3/5/19
to LANDIS-II Developers
Hi Casey and Kelsey,

Is there a way I could see a copy of your docker builds as well? I need to create one for Windows, but it would be helpful to see working versions. Thanks!

Jane

Josef Brůna

unread,
Apr 24, 2019, 9:32:35 AM4/24/19
to LANDIS-II Developers
Hi, I would also like to test the docker version
Thank you
Josef

Charles Maxwell

unread,
Sep 10, 2019, 12:50:52 PM9/10/19
to LANDIS-II Developers
Hello Casey,
I'm going to try to set up LANDIS on my university's HPC and would appreciate the chance to look at the copy of the container you built.
Thanks,

charles
Reply all
Reply to author
Forward
0 new messages