From 6826bdd305b1a9b9a15368e213405fa34b6de2ab Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Wed, 9 Oct 2024 15:22:39 +0200 Subject: [PATCH 1/3] Add a check to avoid infinite number of builds archived by a job (#1187) * Add a check to avoid infinite number of builds archived by a job * Restrict the builds to keep to 75 in infinite configurations --------- Signed-off-by: Jose Luis Rivero --- .../dsl/_configs_/OSRFLinuxBackportPkg.groovy | 1 + jenkins-scripts/dsl/brew_release.dsl | 1 + jenkins-scripts/dsl/debian.dsl | 1 + jenkins-scripts/dsl/dsl_checks.bash | 9 +++++++-- jenkins-scripts/dsl/extra.dsl | 1 + 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/jenkins-scripts/dsl/_configs_/OSRFLinuxBackportPkg.groovy b/jenkins-scripts/dsl/_configs_/OSRFLinuxBackportPkg.groovy index a49e44f67..077e57e56 100644 --- a/jenkins-scripts/dsl/_configs_/OSRFLinuxBackportPkg.groovy +++ b/jenkins-scripts/dsl/_configs_/OSRFLinuxBackportPkg.groovy @@ -40,6 +40,7 @@ class OSRFLinuxBackportPkg logRotator { artifactNumToKeep(20) + numToKeep(75) } parameters { diff --git a/jenkins-scripts/dsl/brew_release.dsl b/jenkins-scripts/dsl/brew_release.dsl index 938959645..704c28e08 100644 --- a/jenkins-scripts/dsl/brew_release.dsl +++ b/jenkins-scripts/dsl/brew_release.dsl @@ -145,6 +145,7 @@ bottle_job_builder.with logRotator { artifactNumToKeep(10) + numToKeep(75) } axes { diff --git a/jenkins-scripts/dsl/debian.dsl b/jenkins-scripts/dsl/debian.dsl index bd87834ab..55160bf25 100644 --- a/jenkins-scripts/dsl/debian.dsl +++ b/jenkins-scripts/dsl/debian.dsl @@ -105,6 +105,7 @@ ratt_pkg_job.with logRotator { artifactNumToKeep(10) + numToKeep(75) } concurrentBuild(true) diff --git a/jenkins-scripts/dsl/dsl_checks.bash b/jenkins-scripts/dsl/dsl_checks.bash index 876750389..6f6932610 100755 --- a/jenkins-scripts/dsl/dsl_checks.bash +++ b/jenkins-scripts/dsl/dsl_checks.bash @@ -63,8 +63,6 @@ if [[ -n ${empty_branches_on_github_triggered} ]]; then exit 1 fi -# re-enable after https://github.com/gazebo-tooling/release-tools/issues/1095 - # Filter out the previous auto jobs filtered_dir=$(mktemp -d) cp -- *-abichecker-*.xml "${filtered_dir}" @@ -76,3 +74,10 @@ if [[ -n ${repeated} ]]; then echo "please exclude one of the versions in the yaml file to reduce the server workload" exit 1 fi + +avoid_infinite_build_archive=$(grep '-1' -- *.xml || true) +if [[ -n ${avoid_infinite_build_archive} ]]; then + echo "Found a job setup to keep infinite number of builds. This is BAD" + echo "${avoid_infinite_build_archive}" + exit 1 +fi diff --git a/jenkins-scripts/dsl/extra.dsl b/jenkins-scripts/dsl/extra.dsl index 59d6feeeb..3731dea48 100644 --- a/jenkins-scripts/dsl/extra.dsl +++ b/jenkins-scripts/dsl/extra.dsl @@ -79,6 +79,7 @@ gbp_repo_debbuilds.each { software -> logRotator { artifactNumToKeep(10) + numToKeep(75) } concurrentBuild(true) From 8483b5c73e47aa1e098f7dbbee29a7b3fc0ae3b8 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Mon, 14 Oct 2024 16:14:52 +0200 Subject: [PATCH 2/3] Fix release.py ssh clone URL for vendor packages (#1189) --- release.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release.py b/release.py index 262851709..111d147f0 100755 --- a/release.py +++ b/release.py @@ -558,8 +558,8 @@ def get_vendor_github_repo(package_name) -> str: def get_vendor_repo_url(package_name) -> str: # Clone needs ssh for real pushing operations. In simulation prefer https to avoid # unexpected pushes and facilitate testing - protocol = 'https://github.com/' if DRY_RUN else 'ssh://git@github.com:' - return f"{protocol}{get_vendor_github_repo(package_name)}" + protocol = 'https://github.com' if DRY_RUN else 'ssh://git@github.com' + return f"{protocol}/{get_vendor_github_repo(package_name)}" def prepare_vendor_pr_temp_workspace(package_name, ws_dir) -> Tuple[str, str, str]: From 389a7d6924b42e2ac09e744b389ce3325c7ea5d2 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Tue, 29 Oct 2024 12:47:18 -0700 Subject: [PATCH 3/3] Replace /usr/local with HOMEBREW_PREFIX (#1190) One of our brew build scripts has a HOMEBREW_PREFIX variable, but it also has many paths hard-coded to /usr/local. In preparation for supporting arm-based CI machines that use brew from /opt/homebrew, use the HOMEBREW_PREFIX variable more widely. Signed-off-by: Steve Peters --- .../project-default-devel-homebrew-amd64.bash | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/jenkins-scripts/lib/project-default-devel-homebrew-amd64.bash b/jenkins-scripts/lib/project-default-devel-homebrew-amd64.bash index 91817a4d2..0b86233bd 100644 --- a/jenkins-scripts/lib/project-default-devel-homebrew-amd64.bash +++ b/jenkins-scripts/lib/project-default-devel-homebrew-amd64.bash @@ -24,7 +24,7 @@ export HOMEBREW_PREFIX=/usr/local export HOMEBREW_CELLAR=${HOMEBREW_PREFIX}/Cellar export PATH=${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin:$PATH -export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python +export PYTHONPATH=$PYTHONPATH:${HOMEBREW_PREFIX}/lib/python # make verbose mode? MAKE_VERBOSE_STR="" @@ -90,7 +90,7 @@ if [[ -n "${PIP_PACKAGES_NEEDED}" ]]; then brew install python3 PIP=pip3 if ! which ${PIP}; then - PIP=/usr/local/opt/python/bin/pip3 + PIP=${HOMEBREW_PREFIX}/opt/python/bin/pip3 fi # TODO use a python3 venv instead. ${PIP} install --break-system-packages ${PIP_PACKAGES_NEEDED} @@ -98,7 +98,7 @@ fi if [[ -z "${DISABLE_CCACHE}" ]]; then brew install ccache - export PATH=/usr/local/opt/ccache/libexec:$PATH + export PATH=${HOMEBREW_PREFIX}/opt/ccache/libexec:$PATH fi echo '# END SECTION' @@ -123,33 +123,33 @@ export DISPLAY=$(ps ax \ CMAKE_ARGS="" # set CMAKE_PREFIX_PATH if we are using qt@5 if brew ruby -e "exit ! '${PROJECT_FORMULA}'.f.recursive_dependencies.map(&:name).keep_if { |d| d == 'qt@5' }.empty?"; then - export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:/usr/local/opt/qt@5 + export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:${HOMEBREW_PREFIX}/opt/qt@5 fi # set cmake args if we are using qwt-qt5 if brew ruby -e "exit ! '${PROJECT_FORMULA}'.f.recursive_dependencies.map(&:name).keep_if { |d| d == 'qwt-qt5' }.empty?"; then - CMAKE_ARGS="${CMAKE_ARGS} -DQWT_WIN_INCLUDE_DIR=/usr/local/opt/qwt-qt5/lib/qwt.framework/Headers -DQWT_WIN_LIBRARY_DIR=/usr/local/opt/qwt-qt5/lib" + CMAKE_ARGS="${CMAKE_ARGS} -DQWT_WIN_INCLUDE_DIR=${HOMEBREW_PREFIX}/opt/qwt-qt5/lib/qwt.framework/Headers -DQWT_WIN_LIBRARY_DIR=${HOMEBREW_PREFIX}/opt/qwt-qt5/lib" fi # Workaround for cmake@3.21.4: set PATH if brew ruby -e "exit ! '${PROJECT_FORMULA}'.f.recursive_dependencies.map(&:name).keep_if { |d| d == 'osrf/simulation/cmake@3.21.4' }.empty?"; then - export PATH=/usr/local/opt/cmake@3.21.4/bin:${PATH} + export PATH=${HOMEBREW_PREFIX}/opt/cmake@3.21.4/bin:${PATH} fi # Workaround for ffmpeg 4: set PKG_CONFIG_PATH if we are using ffmpeg@4 if brew ruby -e "exit ! '${PROJECT_FORMULA}'.f.recursive_dependencies.map(&:name).keep_if { |d| d == 'osrf/simulation/ffmpeg@4' }.empty?"; then - export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/opt/ffmpeg@4/lib/pkgconfig + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${HOMEBREW_PREFIX}/opt/ffmpeg@4/lib/pkgconfig fi # Workaround for tbb@2020_u3: set CPATH, LIBRARY_PATH, and CMAKE_PREFIX_PATH if brew ruby -e "exit ! '${PROJECT_FORMULA}'.f.recursive_dependencies.map(&:name).keep_if { |d| d == 'osrf/simulation/tbb@2020_u3' }.empty?"; then - export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:/usr/local/opt/tbb@2020_u3 - export CPATH=${CPATH}:/usr/local/opt/tbb@2020_u3/include - export LIBRARY_PATH=${LIBRARY_PATH}:/usr/local/opt/tbb@2020_u3/lib + export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:${HOMEBREW_PREFIX}/opt/tbb@2020_u3 + export CPATH=${CPATH}:${HOMEBREW_PREFIX}/opt/tbb@2020_u3/include + export LIBRARY_PATH=${LIBRARY_PATH}:${HOMEBREW_PREFIX}/opt/tbb@2020_u3/lib fi # if we are using gts, need to add gettext library path since it is keg-only if brew ruby -e "exit ! '${PROJECT_FORMULA}'.f.recursive_dependencies.map(&:name).keep_if { |d| d == 'gettext' }.empty?"; then - export LIBRARY_PATH=${LIBRARY_PATH}:/usr/local/opt/gettext/lib + export LIBRARY_PATH=${LIBRARY_PATH}:${HOMEBREW_PREFIX}/opt/gettext/lib fi # if we are using boost, need to add icu4c library path since it is keg-only if brew ruby -e "exit ! '${PROJECT_FORMULA}'.f.recursive_dependencies.map(&:name).keep_if { |d| d == 'icu4c' }.empty?"; then - export LIBRARY_PATH=${LIBRARY_PATH}:/usr/local/opt/icu4c/lib + export LIBRARY_PATH=${LIBRARY_PATH}:${HOMEBREW_PREFIX}/opt/icu4c/lib fi # set Python3_EXECUTABLE if this homebrew formula defines the python_cmake_arg method if brew ruby -e "exit '${PROJECT_FORMULA}'.f.respond_to?(:python_cmake_arg)"; then @@ -158,13 +158,13 @@ fi # if we are using dart@6.10.0 (custom OR port), need to add dartsim library path since it is keg-only if brew ruby -e "exit ! '${PROJECT_FORMULA}'.f.recursive_dependencies.map(&:name).keep_if { |d| d == 'osrf/simulation/dartsim@6.10.0' }.empty?"; then - export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:/usr/local/opt/dartsim@6.10.0 - export DYLD_FALLBACK_LIBRARY_PATH=${DYLD_FALLBACK_LIBRARY_PATH}:/usr/local/opt/dartsim@6.10.0/lib:/usr/local/opt/octomap/local - export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/opt/dartsim@6.10.0/lib/pkgconfig + export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:${HOMEBREW_PREFIX}/opt/dartsim@6.10.0 + export DYLD_FALLBACK_LIBRARY_PATH=${DYLD_FALLBACK_LIBRARY_PATH}:${HOMEBREW_PREFIX}/opt/dartsim@6.10.0/lib:${HOMEBREW_PREFIX}/opt/octomap/local + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${HOMEBREW_PREFIX}/opt/dartsim@6.10.0/lib/pkgconfig fi cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/${PROJECT_FORMULA}/HEAD \ + -DCMAKE_INSTALL_PREFIX=${HOMEBREW_PREFIX}/Cellar/${PROJECT_FORMULA}/HEAD \ ${CMAKE_ARGS} \ ${WORKSPACE}/${PROJECT_PATH} echo '# END SECTION'