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

Unify the vcpkg package set across all gz libs. Remove all packages before every build. #907

Merged
merged 11 commits into from
Apr 13, 2023

Conversation

j-rivero
Copy link
Contributor

@j-rivero j-rivero commented Apr 12, 2023

Fix #904.

The current non-declared behavior in our Windows CI nodes is to never remove a vcpkg package from a CI system once it is installed by any job in Jenkins. Historical reasons for this are in #904. This effectively creates the same effect that having a unified set of packages available for all the builds.

This PR implements that reality by:

With this the PR can clean up all packages installed by vcpkg:

The clean up brings the bad side effect of the need to go through the installations of packages all the times for all the libs with all dependencies. This is done in a reasonable amount of time (see testing) since we are using an static snapshot of vcpkg packages and vcpkg has implemented the binary caching a while ago so all the runs does not need to compile anything new but install existing zips. To make the binary caching to work I needed to add a Temp path for this because the default for the LOCAL SYSTEM user by the Jenkins Server was not writable for it:

Testing

  • First gz-sim7 build compiling all the packages Build Status.

Searching for missing support in the configuration of the libraries: I've only found relevant the expected lack of Dart. There are other minor (platform related things) like the lack of swing, psutils or doxygen.

  • Second gz-sim7 build to see the cache in action Build Status.

    • 🕐 Takes exactly the same time than in Beefy currently, 49min.
  • The simple gz-utils using the installation of all packages Build Status

    • 🕐 Time comparison with current system: 2min6s vs 4min44s.

@j-rivero j-rivero force-pushed the jrivero/use_common_deps_vcpkg branch from 0809aaf to 14640e0 Compare April 12, 2023 16:58
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
@j-rivero j-rivero force-pushed the jrivero/use_common_deps_vcpkg branch from 14640e0 to f433a46 Compare April 12, 2023 17:02
@j-rivero j-rivero marked this pull request as ready for review April 12, 2023 17:24
@j-rivero
Copy link
Contributor Author

j-rivero commented Apr 12, 2023

For reference, the package list obtained from current beefy:

assimp:x64-windows                                 5.0.1#5          The Open Asset import library
atlmfc:x64-windows                                 0#1              a stub package that ensures VS has ATL/MFC insta...
boost-assert:x64-windows                           1.78.0           Boost assert module
boost-config:x64-windows                           1.78.0           Boost config module
boost-core:x64-windows                             1.78.0           Boost core module
boost-static-assert:x64-windows                    1.78.0           Boost static_assert module
boost-throw-exception:x64-windows                  1.78.0           Boost throw_exception module
boost-uninstall:x64-windows                        1.78.0           Internal vcpkg port used to uninstall Boost
boost-vcpkg-helpers:x64-windows                    1.78.0#1         Internal vcpkg port used to modularize Boost
brotli:x64-windows                                 1.0.9#2          a generic-purpose lossless compression algorithm...
bullet3:x64-windows                                3.17#4           Bullet Physics is a professional collision detec...
bzip2:x64-windows                                  1.0.8#2          bzip2 is a freely available, patent free, high-q...
ccd:x64-windows                                    2.1-4#3          Library for collision detection between two conv...
console-bridge:x64-windows                         1.0.1#2          a ROS-independent package for logging that seaml...
cppzmq:x64-windows                                 4.8.1            lightweight messaging kernel, C++ bindings
cuda:x64-windows                                   10.1#9           A parallel computing platform and programming model
curl:x64-windows                                   7.81.0           A library for transferring data with URLs
curl[non-http]:x64-windows                                          Enables protocols beyond HTTP/HTTPS/HTTP2
curl[schannel]:x64-windows                                          SSL support (Secure Channel)
curl[ssl]:x64-windows                                               Default SSL backend
curl[sspi]:x64-windows                                              SSPI support
dirent:x64-windows                                 1.23.2#1         Dirent is a C/C++ programming interface that all...
dlfcn-win32:x64-windows                            1.1.1#6          dlfcn-win32 is an implementation of dlfcn for Wi...
double-conversion:x64-windows                      3.2.0            Efficient binary-decimal and decimal-binary conv...
egl-registry:x64-windows                           2021-11-23       the EGL API and Extension Registry
eigen3:x64-windows                                 3.4.0            C++ template library for linear algebra: matrice...
expat:x64-windows                                  2.4.1            XML parser library written in C
fcl:x64-windows                                    0.7.0#3          a library for performing three types of proximit...
ffmpeg:x64-windows                                 4.4.1#9          a library to decode, encode, transcode, mux, dem...
ffmpeg[avcodec]:x64-windows                                         Build the avcodec library
ffmpeg[avdevice]:x64-windows                                        Build the avdevice library
ffmpeg[avfilter]:x64-windows                                        Build the avfilter library
ffmpeg[avformat]:x64-windows                                        Build the avformat library
ffmpeg[swresample]:x64-windows                                      Build the swresample library
ffmpeg[swscale]:x64-windows                                         Build the swscale library
freeglut:x64-windows                               3.2.1#7          Open source implementation of GLUT with source a...
freeimage:x64-windows                              3.18.0#22        Support library for graphics image formats
freetype:x64-windows                               2.11.1           A library to render fonts.
freetype[brotli]:x64-windows                                        Support decompression of WOFF2 streams
freetype[bzip2]:x64-windows                                         Support bzip2 compressed fonts.
freetype[png]:x64-windows                                           Support PNG compressed OpenType embedded bitmaps.
freetype[zlib]:x64-windows                                          Use zlib instead of internal library for DEFLATE
gdal:x64-windows                                   3.4.1#2          The Geographic Data Abstraction Library for read...
gdal[hdf5]:x64-windows                                              Enable HDF5 support
gdal[netcdf]:x64-windows                                            Enable NetCDF support
gdal[postgresql]:x64-windows                                        Enable PostgreSQL support
gdal[supported-default-features]:x64-windows                        Default set of features, dependent on platform
geos:x64-windows                                   3.10.0           Geometry Engine Open Source
gettext:x64-windows                                0.21#9           GNU gettext provides libintl and a set of tools ...
gflags:x64-windows                                 2.2.2#5          A C++ library that implements commandline flags ...
glib:x64-windows                                   2.70.1#2         Portable, general-purpose utility library.
gts:x64-windows                                    0.7.6#4          A Library intended to provide a set of useful fu...
harfbuzz:x64-windows                               3.2.0#1          HarfBuzz OpenType text shaping engine
hdf5:x64-windows                                   1.12.1#4         HDF5 is a data model, library, and file format f...
hdf5[szip]:x64-windows                                              Build with szip
hdf5[zlib]:x64-windows                                              Build with zlib
icu:x64-windows                                    69.1#18          Mature and widely used Unicode and localization ...
imgui:x64-windows                                  1.87             Bloat-free Immediate Mode Graphical User interfa...
imgui[freetype]:x64-windows                                         Build font atlases using FreeType instead of stb...
irrlicht:x64-windows                               1.8.4#13         The Irrlicht Engine is an open source realtime 3...
jasper:x64-windows                                 2.0.33#3         Open source implementation of the JPEG-2000 Part...
jasper[opengl]:x64-windows                                          Enable the use of the OpenGL/GLUT Library
jsoncpp:x64-windows                                1.9.5            jsoncpp is an implementation of a JSON reader an...
jxrlib:x64-windows                                 2019.10.9#3      Open source implementation of the jpegxr image f...
kubazip:x64-windows                                0.1.19#1         A portable, simple zip library written in C
lcms:x64-windows                                   2.12#3           Little CMS.
libffi:x64-windows                                 3.4.2#4          Portable, high level programming interface to va...
libgeotiff:x64-windows                             1.7.0            Libgeotiff is an open source library on top of l...
libiconv:x64-windows                               1.16#11          GNU Unicode text conversion
libjpeg-turbo:x64-windows                          2.1.2            libjpeg-turbo is a JPEG image codec that uses SI...
liblzma:x64-windows                                5.2.5#4          Compression library with an API similar to that ...
libpng:x64-windows                                 1.6.37#16        libpng is a library implementing an interface fo...
libpq:x64-windows                                  12.9#1           The official database access API of postgresql
libpq[openssl]:x64-windows                                          support for encrypted client connections and ran...
libpq[zlib]:x64-windows                                             Use zlib (else --without-zlib)
libraw:x64-windows                                 201903#7         raw image decoder library
libwebp:x64-windows                                1.2.1            WebP codec: library to encode and decode images ...
libwebp[nearlossless]:x64-windows                                   Enable near-lossless encoding
libwebp[simd]:x64-windows                                           Enable any SIMD optimization.
libwebp[unicode]:x64-windows                                        Build Unicode executables. (Adds definition UNIC...
libxml2:x64-windows                                2.9.12#4         Libxml2 is the XML C parser and toolkit develope...
libyaml:x64-windows                                0.2.5#3          A C library for parsing and emitting YAML.
libzip:x64-windows                                 1.8.0            A library for reading, creating, and modifying z...
libzip[bzip2]:x64-windows                                           Support bzip2-compressed zip archives
libzip[default-aes]:x64-windows                                     Use default AES
libzip[wincrypto]:x64-windows                                       AES (encryption) support using Windows Crypto API
minizip:x64-windows                                1.2.11#10        Zip compression library
netcdf-c:x64-windows                               4.8.1#2          A set of self-describing, machine-independent da...
netcdf-c[dap]:x64-windows                                           Build with DAP remote access client support
netcdf-c[hdf5]:x64-windows                                          Build with HDF5 support
netcdf-c[nczarr]:x64-windows                                        Build with NCZarr cloud storage access support
netcdf-c[netcdf-4]:x64-windows                                      Build with netCDF-4 support
netcdf-c[platform-default-features]:x64-windows                     Enable platform-dependent default features
nlohmann-json:x64-windows                          3.10.5           JSON for Modern C++
octomap:x64-windows                                1.9.5#2          An Efficient Probabilistic 3D Mapping Framework ...
ogre22:x64-windows                                 2.1.9999~2021... 3D Object-Oriented Graphics Rendering Engine
ogre2:x64-windows                                  2.0.9999~2021... 3D Object-Oriented Graphics Rendering Engine
ogre:x64-windows                                   1.12.9#7         3D Object-Oriented Graphics Rendering Engine
ogre[assimp]:x64-windows                                            Use assimp
ogre[freeimage]:x64-windows                                         Build with FreeImage support
ogre[overlay]:x64-windows                                           Build overlay component
ogre[zziplib]:x64-windows                                           Build with zziplib support (GPL)
openexr:x64-windows                                2.5.0#3          OpenEXR is a high dynamic-range (HDR) image file...
opengl:x64-windows                                 0.0#9            Open Graphics Library (OpenGL)[3][4][5] is a cro...
openjpeg:x64-windows                               2.4.0            OpenJPEG is an open-source JPEG 2000 codec writt...
openssl:x64-windows                                1.1.1m#2         OpenSSL is an open source project that provides ...
pcre2:x64-windows                                  10.39#2          Regular Expression pattern matching using the sa...
pcre:x64-windows                                   8.45#2           Perl Compatible Regular Expressions
pkgconf:x64-windows                                1.8.0#2          pkgconf is a program which helps to configure co...
poly2tri:x64-windows                               2020-07-21#2     The Clipper library performs clipping and offset...
polyclipping:x64-windows                           6.4.2#10         The Clipper library performs clipping and offset...
proj4:x64-windows                                  8.2.1#1          PROJ library for cartographic projections
proj4[net]:x64-windows                                              Enable network support
proj4[tiff]:x64-windows                                             Enable TIFF support to read some grids
protobuf:x64-windows                               3.18.0#1         Protocol Buffers - Google's data interchange format
pugixml:x64-windows                                1.11.4#1         Light-weight, simple and fast XML parser for C++...
pybind11:x64-windows                               2.9.1            pybind11 is a lightweight header-only library th...
python3:x64-windows                                3.10.1#6         The Python programming language
qt5-activeqt:x64-windows                           5.15.2#1         Qt5 ActiveQt Module - ActiveX components
qt5-base:x64-windows                               5.15.2#20        Qt5 Application Framework Base Module. Includes ...
qt5-declarative:x64-windows                        5.15.2#3         Qt5 Declarative (Quick 2) Module. Includes QtQui...
qt5-imageformats:x64-windows                       5.15.2#1         Qt5 Image Formats Module - Plugins for additiona...
qt5-multimedia:x64-windows                         5.15.2#1         Qt5 Multimedia Module - Classes and widgets for ...
qt5-networkauth:x64-windows                        5.15.2#1         Qt5 Network Authorization Module
qt5-quickcontrols2:x64-windows                     5.15.2#1         Qt5 QuickControls2 Module.
qt5-svg:x64-windows                                5.15.2#2         Qt5 SVG Module - provides classes for displaying...
qt5-tools:x64-windows                              5.15.2#1         Qt5 Tools Module; Includes deployment tools and ...
qt5-winextras:x64-windows                          5.15.2#1         Qt5 Windows Extras Module. Provides platform-spe...
qt5:x64-windows                                    5.15.2#1         Qt5 Application Framework
qt5[activeqt]:x64-windows                                           Windows Only
qt5[declarative]:x64-windows                                        
qt5[essentials]:x64-windows                                         Build the essential qt modules
qt5[imageformats]:x64-windows                                       
qt5[multimedia]:x64-windows                                         
qt5[networkauth]:x64-windows                                        
qt5[quickcontrols2]:x64-windows                                     
qt5[svg]:x64-windows                                                
qt5[tools]:x64-windows                                              
qwt:x64-windows                                    6.2.0#2          qt widgets library for technical applications
rapidjson:x64-windows                              2020-09-14#2     A fast JSON parser/generator for C++ with both S...
sdl2:x64-windows                                   2.0.20           Simple DirectMedia Layer is a cross-platform dev...
sqlite3:x64-windows                                3.37.2#1         SQLite is a software library that implements a s...
sqlite3[tool]:x64-windows                                           Build sqlite3 executable
stb:x64-windows                                    2020-09-14#1     public domain header-only libraries
szip:x64-windows                                   2.1.1#7          Szip compression software, providing lossless co...
tiff:x64-windows                                   4.3.0#5          A library that supports the manipulation of TIFF...
tiff[jpeg]:x64-windows                                              Support JPEG compression in TIFF image files
tiff[lzma]:x64-windows                                              Support LZMA compression in TIFF image files
tiff[zip]:x64-windows                                               Support ZIP/deflate compression in TIFF image files
tinyxml2:x64-windows                               9.0.0            A simple, small, efficient, C++ XML parser
utfcpp:x64-windows                                 3.2.1            UTF-8 with C++ in a Portable Way
vcpkg-cmake-config:x64-windows                     2022-02-06       
vcpkg-cmake:x64-windows                            2022-01-19       
vcpkg-pkgconfig-get-modules:x64-windows            2022-02-10       
vcpkg-tool-meson:x64-windows                       0.60.2#2         Meson build system
zeromq:x64-windows                                 4.3.4#4          The ZeroMQ lightweight messaging kernel is a lib...
zlib:x64-windows                                   1.2.11#13        A compression library
zstd:x64-windows                                   1.5.2#1          Zstandard - Fast real-time compression algorithm
zziplib:x64-windows                                0.13.71#3        library providing read access on ZIP-archives

Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea seems okay to me since we don't run into conflicting versions of dependencies on windows. I just have a few minor comments. Thanks for following up on this @j-rivero!

@@ -4,10 +4,8 @@ set VCS_DIRECTORY=gz-common
set PLATFORM_TO_BUILD=x86_amd64
set IGN_CLEAN_WORKSPACE=true

set DEPEN_PKGS=assimp ffmpeg freeimage gts tinyxml2
for /f %%i in ('python "%SCRIPT_DIR%\tools\detect_cmake_major_version.py" "%WORKSPACE%\%VCS_DIRECTORY%\CMakeLists.txt"') do set GZ_MAJOR_VERSION=%%i
if %GZ_MAJOR_VERSION% GEQ 5 (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can also remove the if block then.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ouch, removed 05a2dcf

@@ -5,7 +5,6 @@ set PLATFORM_TO_BUILD=x86_amd64
set IGN_CLEAN_WORKSPACE=true

:: tinyxml2 from msgs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ouch, removed 05a2dcf

@@ -4,10 +4,8 @@ set VCS_DIRECTORY=gz-physics
set PLATFORM_TO_BUILD=x86_amd64
set IGN_CLEAN_WORKSPACE=true

set DEPEN_PKGS=eigen3 tinyxml2
for /f %%i in ('python "%SCRIPT_DIR%\tools\detect_cmake_major_version.py" "%WORKSPACE%\%VCS_DIRECTORY%\CMakeLists.txt"') do set GZ_MAJOR_VERSION=%%i
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove version checking logic since it's not needed anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed a1452e9

call %win_lib% :remove_vcpkg_installation || goto :error
echo # BEGIN SECTION: install all vcpkg dependencies
call %win_lib% :setup_vcpkg_all_dependencies || goto :error
echo # END SECTION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice (maybe a follow-up PR) to print the list of installed packages and their versions for debugging purposes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+100. I'll do it after merging this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@nuclearsandwich nuclearsandwich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I have one question and one observation to confirm but neither is blocking. Thanks for this big improvement to consistent builds across hosts!

call %LIB_DIR%\windows_env_vars.bat || goto :error
if [%VCPKG_INSTALLED_FILES_DIR%]==[] (
echo VCPKG_INSTALLED_FILES_DIR seems empty, refuse to delete
goto :error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there situations where we'd expect this directory to be empty, such as with a freshly provisioned host, and if so is the goto :error recoverable or would this halt the build?

set VCPKG_CMD=%VCPKG_DIR%\vcpkg.exe
set VCPKG_CMAKE_TOOLCHAIN_FILE=%VCPKG_DIR%/scripts/buildsystems/vcpkg.cmake
if NOT DEFINED VCPKG_SNAPSHOT (
:: see https://github.com/microsoft/vcpkg/releases
set VCPKG_SNAPSHOT=2022.02.23
)
:: Set of common gz dependencies expected up to Garden
set VCPKG_DEPENDENCIES_LEGACY=assimp boost-core bullet3 ccd console-bridge cppzmq cuda curl dlfcn-win32 eigen3 fcl ffmpeg freeimage gdal gflags glib gts jsoncpp libyaml libzip ogre ogre2 ogre22 openssl protobuf pybind11 qt5 qt5-winextras qwt sqlite3 tinyxml2 zeromq
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, the per-package dependencies have all been dropped in favor of this single list of dependencies. I think that's fine because the packaging for Windows is done using conda-forge and so there's limited utility in using the vcpkg installations to try and smoke out missing dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, the per-package dependencies have all been dropped in favor of this single list of dependencies. I think that's fine because the packaging for Windows is done using conda-forge and so there's limited utility in using the vcpkg installations to try and smoke out missing dependencies.

This is correct.

Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
@j-rivero j-rivero merged commit a8ddb76 into master Apr 13, 2023
@j-rivero j-rivero deleted the jrivero/use_common_deps_vcpkg branch April 13, 2023 09:46
@azeey
Copy link
Contributor

azeey commented Apr 13, 2023

I just noticed the sdformat windows build has taken more than 2 hours and 40 minutes. The previous build on the same machine was 35 minutes. Is that a one time thing or is this to be the expected runtime?

@j-rivero
Copy link
Contributor Author

I just noticed the sdformat windows build has taken more than 2 hours and 40 minutes. The previous build on the same machine was 35 minutes. Is that a one time thing or is this to be the expected runtime?

That should be a one time process of compiling + generating packages. I just relaunch sdformat-ci-main on both nodes to see the times:

  • Nuc Build Status
  • Beefy Build Status

Compilation is starting on both after around 4 minutes of running. There is a bit of overhead but should be very few minutes (less than 5) not hours. Please let me know if you see more delays.

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

Successfully merging this pull request may close these issues.

vcpkg installation needs to assure that packages installed are the expected
3 participants