Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add CentOS 7 based Dockerfile #7

Merged
merged 42 commits into from
Jun 8, 2021
Merged

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented Jun 4, 2021

* Add CentOS 7 based Dockerfile
   - Builds from neubauergroup/centos-root-base:6.24.00
      - Has ROOT built with CMAKE_CXX_STANDARD=14
   - Use centos-release-scl and devtoolset-8 to get required gcc and BOOST versions for CentOS
   - Requires use of CMake option CMAKE_CXX_STANDARD=14 that matches that used in ROOT
      - Here that is C++14 (C++17 is incompatible for reasons not understood now)
      - $ root-config --cflags
        -pthread -std=c++14 -m64 -I/usr/local/root-cern/includ
* Move existing Dockerfile to base OS named directory
   - Dockerfile -> docker/debian/Dockerfile
* Adjust install paths to be under /usr/local/venv/ so Python binding builds pickup the virtual environment
* Split CI/CD into one workflow per Dockerfile
* Update to use hadolint/[email protected] GitHub Action
* Update hadolint ignores

@matthewfeickert matthewfeickert added enhancement New feature or request ci labels Jun 4, 2021
@matthewfeickert matthewfeickert self-assigned this Jun 4, 2021
@matthewfeickert
Copy link
Member Author

Seems that a more modern version of boost is required

#9 1.892 -- Found LHAPDF: /usr/local/lib/libLHAPDF.so (found suitable version "6.2.3", minimum required is "6.0") 
#9 1.915 CMake Error at /usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
#9 1.915   Could NOT find Boost: Found unsuitable version "1.53.0", but required is at
#9 1.915   least "1.54" (found /usr/include)
#9 1.915 Call Stack (most recent call first):
#9 1.915   /usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:443 (_FPHSA_FAILURE_MESSAGE)
#9 1.915   /usr/share/cmake3/Modules/FindBoost.cmake:2166 (find_package_handle_standard_args)
#9 1.915   CMakeLists.txt:96 (find_package)

@swertz
Copy link

swertz commented Jun 7, 2021

Hi, even though active development has stopped, we do try to provide minimal support.

This is strange, as it has been developed on CentOS 7, and some people are using it on CentOS 7 as we speak (@FlorianBury).

What is the error message?

@matthewfeickert
Copy link
Member Author

Hi, even though active development has stopped, we do try to provide minimal support.

🙇 Awesome and thank you!

This is strange, as it has been developed on CentOS 7, and some people are using it on CentOS 7 as we speak (@FlorianBury).

Ah that's actually quite good to know. I've only been able to get things to build with installing BOOST from source and then installing centos-release-scl so I can then install devtoolset-8 to get a modern gcc and then strangely can get things working only when building using C++14 (C++11 and C++17 fail). My guess is that this wasn't required for you to install @FlorianBury? @swertz, when developing, how did you install the versions of BOOT and get a C++14 or later compatible gcc/g++? Though package management with yum? Or building from source?

What is the error message?

At the moment I don't have a particular build error message, but I was getting situations where running the tests I've setup (the MoMEMta tutorial in the build image) would just run for over an hour without converging. I'm making some changes to the underlying base images I'm building on, so I'm going to see if that resolves things.

need to treat /usr/local/venv/ as the base for anything that has python
bindings to get it to be seen and known to the virtual environment
@FlorianBury
Copy link

Hi @matthewfeickert,

On my side I built MoMEMta from sources, using the following cvmfs modules

  • root/6.12.04-sl7_gcc73
  • boost/1.66.0_sl7_gcc73
  • python/python36_sl7_gcc73
  • cmake/cmake-3.9.6
  • lhapdf/6.1.6-sl7_gcc73
  • gcc/gcc-7.3.0-sl7_amd64

I am working as we speak with this setup and it works fine.

@swertz
Copy link

swertz commented Jun 8, 2021

strangely can get things working only when building using C++14 (C++11 and C++17 fail)

Yes I remember we had some issues because depending on the version, ROOT forces using exactly the same C++ standard as it was built with...

@swertz, when developing, how did you install the versions of BOOT and get a C++14 or later compatible gcc/g++? Though package management with yum? Or building from source?

The system provided environment modules with more recent GCC and BOOST versions. Which is another way to say they were built from source (just not by us)!

That being said, I've tried to build with recent GCC10 and ROOT 6.22 and it fails. I'm looking into it.

@swertz
Copy link

swertz commented Jun 8, 2021

Could you perhaps try pulling MoMEMta from https://github.com/swertz/MoMEMta/tree/cuba-4.2.1 ?

With this branch I manage to run an example on CentOS with GCC10 and ROOT 6.22 (with -DCMAKE_CXX_STANDARD=17).

@matthewfeickert
Copy link
Member Author

On my side I built MoMEMta from sources, using the following cvmfs modules

  • root/6.12.04-sl7_gcc73
  • boost/1.66.0_sl7_gcc73
  • python/python36_sl7_gcc73
  • cmake/cmake-3.9.6
  • lhapdf/6.1.6-sl7_gcc73
  • gcc/gcc-7.3.0-sl7_amd64

Yeah, the problem with CVFMS is that it is like the world's biggest virtual environment with special cases — there are plenty of modules that exist on it that you can't easily get setup with the same configurations outside. But this is at least a helpful listing of versions to have — thanks @FlorianBury.

Yes I remember we had some issues because depending on the version, ROOT forces using exactly the same C++ standard as it was built with...

Ah this is good to know, given that I currently have ROOT being built with CMAKE_CXX_STANDARD=11

The system provided environment modules with more recent GCC and BOOST versions. Which is another way to say they were built from source (just not by us)!

I can rebuild the ROOT docker image with centos-release-scl and devtoolset-8 (installed through yum to get modern enough g++ to use CMAKE_CXX_STANDARD=17. The trick though is finding BOOST packaged that is new enough that it is newer than v1.53.00.

That being said, I've tried to build with recent GCC10 and ROOT 6.22 and it fails. I'm looking into it.

At the moment the build for docker/centos/Dockerfile is passing for me if I do source scl_source enable devtoolset-8, but then during runtime the examples from the tutorial seem unable to converge (while the basically identical Docker image sans the installed libraries is able to complete the examples in under 2 minutes).

Could you perhaps try pulling MoMEMta from https://github.com/swertz/MoMEMta/tree/cuba-4.2.1 ?

With this branch I manage to run an example on CentOS with GCC10 and ROOT 6.22 (with -DCMAKE_CXX_STANDARD=17).

Yeah, once I rebuild the neubauergroup/centos-root-base:6.24.00 image with CMAKE_CXX_STANDARD=17 I'll try again from this branch on your fork @swertz. 👍 I had just been building off of the v1.0.0 tag instead of master as I wanted a release tag for reproduciblity.

@swertz
Copy link

swertz commented Jun 8, 2021

I've tried building and installing the examples from the Tutorials as in your test setup, using the GCC10/ROOT622 build on COS7, and it finishes running in a few minutes.

I'm not sure if this is really because of something that was changed between v1.0.0 and the master, or between the master and my cuba-4.2.1 branch... But if you manage to get it work using that branch I'm happy to merge it and tag a bugfix release that could pull!

@matthewfeickert
Copy link
Member Author

I've tried building and installing the examples from the Tutorials as in your test setup, using the GCC10/ROOT622 build on COS7, and it finishes running in a few minutes.

I'm not sure if this is really because of something that was changed between v1.0.0 and the master, or between the master and my cuba-4.2.1 branch... But if you manage to get it work using that branch I'm happy to merge it and tag a bugfix release that could pull!

Thanks! This is all useful info. I'll use this as some guides for debugging and hopefully be able to provide some example failing and working workflows later on today.

@swertz
Copy link

swertz commented Jun 8, 2021

Btw, looking at your test job output, the example runs an infinite loop when iterating over the events:

54225: [2021-06-08 09:16:07.902] [debug] Event -1 result: 3.59128e-18 +- 4.39119e-20

Which would point to an issue with the ROOT/TTreeReader setup rather than with MoMEMta itself...?
(see here in the tutorial source)

@matthewfeickert
Copy link
Member Author

matthewfeickert commented Jun 8, 2021

@swertz I have things working now that I've rebuilt the ROOT base image with CMAKE_CXX_STANDARD=14, so I think my docker/centos/Dockerfile should be sufficient now.

I've also built against your fork's cuba-4.2.1 branch and that also passes on CMAKE_CXX_STANDARD=14. 👍 If you think the revisions are substantial enough on your side, it might be nice to have a v1.0.1 patch release and maybe also a note in the README that you need ROOT and MoMEMta to be build with the same CMAKE_CXX_STANDARD.

@swertz
Copy link

swertz commented Jun 10, 2021

Thanks for checking! Good that it is solved 👍

I have added a note about the C++ standard in the README and a v1.0.1 tag to MoMEMta that you can pull in your container images: https://github.com/MoMEMta/MoMEMta/releases/tag/v1.0.1

@matthewfeickert
Copy link
Member Author

I have added a note about the C++ standard in the README and a v1.0.1 tag to MoMEMta that you can pull in your container images: https://github.com/MoMEMta/MoMEMta/releases/tag/v1.0.1

Fantastic! Thank you very much @swertz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable devtools in CentOS based Docker images by default Make Blue Waters compatible Docker image
3 participants