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

May Orion build on CentOS 8? #3764

Closed
fgalan opened this issue Jan 27, 2021 · 7 comments
Closed

May Orion build on CentOS 8? #3764

fgalan opened this issue Jan 27, 2021 · 7 comments
Milestone

Comments

@fgalan
Copy link
Member

fgalan commented Jan 27, 2021

It would be a good idea to evaluate this, doing a pass-through of the building procedure at https://fiware-orion.readthedocs.io/en/master/admin/build_source/index.html and see how it goes.

@mapedraza
Copy link
Collaborator

mapedraza commented Feb 11, 2021

I got Orion Context Broker running on CentOS-8.3.2011 using task/3132_driver_migration_first_stage branch using mongo-c-driver-1.16.0

Some comments about the installation:

  • Installing scons fails. It is not needed anymore since it is needed only for mongo legacy driver
  • It is needed to change CMakeLists.txt file to ignore some warnings while compiling
    • Used sed -i '87s/.*/set (CMAKE_CXX_FLAGS "-Wall -Wno-unknown-pragmas -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -Werror -Wno-deprecated-declarations -fno-var-tracking-assignments -Wno-format-truncation -Wno-stringop-truncation -Wno-maybe-uninitialized")/' to replace the line

I attach a portion of dockerile (not tested yet as dockerfile) with the modifications needed

  adduser --comment "${ORION_USER}" ${ORION_USER} && \
   # Install dependencies
   yum -y install epel-release && \
   yum -y install \
     boost-devel \
     bzip2 \
     cmake \
     gnutls-devel \
     libgcrypt-devel \
     libcurl-devel \
     openssl-devel \
     libuuid-devel \
     make \
     nc \
     git \
     gcc-c++ \
#      scons \
     tar \
     which \
     cyrus-sasl-devel && \
   # Install libmicrohttpd from source
   cd /opt && \
   curl -kOL http://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.70.tar.gz && \
   tar xvf libmicrohttpd-0.9.70.tar.gz && \
   cd libmicrohttpd-0.9.70 && \
   ./configure --disable-messages --disable-postprocessor --disable-dauth && \
   make && \
   make install && \
   ldconfig && \
   # Install mongodb driver from source
   cd /opt && \
   wget https://github.com/mongodb/mongo-c-driver/releases/download/1.16.0/mongo-c-driver-1.16.0.tar.gz && \
   tar xfvz mongo-c-driver-1.16.0.tar.gz && \
   cd mongo-c-driver-1.16.0 && \
   mkdir cmake-build && \
   cd cmake-build && \
   cmake3 -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..   && \
   make && \
   sudo make install && \
   # Coppy generated dynamic libraries to make them available from Orion
   cd src && \
   cp libmongoc/libmongoc-1.0.so.0 /lib64/libmongoc-1.0.so.0 && \
   cp libbson/libbson-1.0.so.0 /lib64/libbson-1.0.so.0 && \
   # Install rapidjson from source
   cd /opt && \
   curl -kOL https://github.com/miloyip/rapidjson/archive/v1.1.0.tar.gz && \
   tar xfz v1.1.0.tar.gz && \
   mv rapidjson-1.1.0/include/rapidjson/ /usr/local/include && \
   # Install git (not used in dockerfile)
   yum -y install git
   # Install orion from source - replaced env variables
   cd /opt && \
   git clone https://github.com/telefonicaid/fiware-orion.git && \
   cd fiware-orion/ && \
   git checkout task/3132_driver_migration_first_stage && \
   sed -i '87s/.*/set (CMAKE_CXX_FLAGS "-Wall -Wno-unknown-pragmas -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -Werror -Wno-deprecated-declarations -fno-var-tracking-assignments -Wno-format-truncation -Wno-stringop-truncation -Wno-maybe-uninitialized")/' CMakeLists.txt && \
   make && \
   make install && \

@fgalan
Copy link
Member Author

fgalan commented Feb 16, 2021

Could you run the so built contextBroker (e.g. contextBroker -fg) and provide the result of curl localhost:1026/version to know the exact library version you get in CentOS 8? (It may be needed for documentation purposes)

@mapedraza
Copy link
Collaborator

Orion's response:

"orion" : {
  "version" : "2.5.0-next",
  "uptime" : "0 d, 0 h, 0 m, 21 s",
  "git_hash" : "4af8845493d3ba984493f489151f5a24595d7419",
  "compile_time" : "Tue Feb 16 06:28:12 EST 2021",
  "compiled_by" : "root",
  "compiled_in" : "localhost.localdomain",
  "release_date" : "Tue Feb 16 06:28:12 EST 2021",
  "doc" : "https://fiware-orion.rtfd.io/",
  "libversions": {
     "boost": "1_66",
     "libcurl": "libcurl/7.61.1 OpenSSL/1.1.1g zlib/1.2.11 brotli/1.0.6 libidn2/2.2.0 libpsl/0.20.2 (+libidn2/2.2.0) libssh/0.9.4/openssl/zlib nghttp2/1.33.0",
     "libmicrohttpd": "0.9.70",
     "openssl": "1.1",
     "rapidjson": "1.1.0",
     "mongodriver": "legacy-1.1.2"
  }
}
}

@fgalan
Copy link
Member Author

fgalan commented Feb 23, 2021

PR #3790 (to be landed soon in PR #3622) has modified the building so now the Mongo C libraries are statically linked so this can be removed from the receipt above:

   # Coppy generated dynamic libraries to make them available from Orion
   cd src && \
   cp libmongoc/libmongoc-1.0.so.0 /lib64/libmongoc-1.0.so.0 && \
   cp libbson/libbson-1.0.so.0 /lib64/libbson-1.0.so.0 && \

@mapedraza
Copy link
Collaborator

mapedraza commented Feb 24, 2021

gcc and cmake versions used to compile Orion Context Broker on Centos8

[root@localhost ~]# cmake --version
cmake version 3.11.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).
[root@localhost ~]# cmake3 --version
cmake version 3.11.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).
[root@localhost ~]# gcc --version
gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@mapedraza
Copy link
Collaborator

Some snippets for legacy driver support

Installing scons

wget http://repo.okay.com.mx/centos/8/x86_64/release/scons-2.3.0-2.el8.noarch.rpm
yum localinstall scons-2.3.0-2.el8.noarch.rpm

Building mongo-cxx-driver lastest version (1.1.3)

   cd /opt && \
   curl -kOL https://github.com/mongodb/mongo-cxx-driver/archive/legacy-1.1.3.tar.gz && \
   tar xfz legacy-1.1.3.tar.gz && \
   cd mongo-cxx-driver-legacy-1.1.3 && \
# Apply patch to make driver compatible with OpenSSL 1.1.x
# https://github.com/mongodb/mongo-cxx-driver/pull/615
   wget https://patch-diff.githubusercontent.com/raw/mongodb/mongo-cxx-driver/pull/615.patch
   git apply 615.patch
# Modify SConstruct file to disable warnings
   sed -i '873s/.*/                         "-Winvalid-pch","-Wno-nonnull-compare","-Wno-format-truncation"] )/' SConstruct && \
   scons  --use-sasl-client --ssl

@fgalan fgalan added this to the 3.0.0 milestone Apr 12, 2021
@fgalan
Copy link
Member Author

fgalan commented Apr 12, 2021

Done in PR #3622

@fgalan fgalan closed this as completed Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants