Skip to content

Commit

Permalink
Merge branch 'master' into jrivero/abichecker-static-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
j-rivero authored Oct 13, 2023
2 parents 23463b7 + 312fa95 commit c046c37
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 29 deletions.
59 changes: 50 additions & 9 deletions jenkins-scripts/dsl/gazebo_libs.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ boolean is_testing_enabled(lib_name, ci_config)
return ! ci_config.tests_disabled?.contains(lib_name)
}


/*
* Generate an index that facilitates the operations with the yaml values,
* avoiding to parse them several times.
*
* ci_configs_by_lib index structure:
* # ci_configs_by_lib index structure:
* lib_name : [ ci_config_name : [ .branch .collection ] ]
*
* The index main keys are the lib names (i.e: gz-cmake) and associated them
Expand All @@ -71,16 +70,33 @@ boolean is_testing_enabled(lib_name, ci_config)
*
* index[gz-cmake][jammy] -> [ branch: gz-cmake3, collection: garden ,
* branch: gz-cmake3, collection: harmonic]
*
* # pkgconf_per_src_inde index structure:
* pkg_src_name : [ packaging_config_name : [ .lib_name .collection ] ]
*
* The index main keys are package source names (i.e gz-cmake3 or gz-harmonic and associated them
* another map of packaging configuration names supported as keys (i.e: jammy) with the
* list of associated items composed by a map: lib_name (canonical name for the source package)
* (and collection)
*
* index[gz-cmake3][jammy] -> [ lib_name: gz-cmake, collection: harmonic ]
*/
void generate_ciconfigs_by_lib(config, configs_per_lib_index)
void generate_ciconfigs_by_lib(config, ciconf_per_lib_index, pkgconf_per_src_index)
{
config.collections.each { collection ->
collection.libs.each { lib ->
def libName = lib.name
def branch = lib.repo.current_branch
collection.ci.configs.each { config_name ->
configs_per_lib_index["$libName"]["${config_name}"] = configs_per_lib_index["$libName"]["${config_name}"]?: []
configs_per_lib_index["$libName"]["${config_name}"].contains(branch) ?: configs_per_lib_index["$libName"]["${config_name}"] << [branch: branch, collection: collection.name]
ciconf_per_lib_index[libName][config_name] = ciconf_per_lib_index[libName][config_name]?: []
ciconf_per_lib_index[libName][config_name].contains(branch) ?: ciconf_per_lib_index[libName][config_name] << [branch: branch, collection: collection.name]
}
def pkg_name = lib.name + lib.major_version
if (collection.packaging.linux?.ignore_major_version?.contains(libName))
pkg_name = lib.name
collection.packaging.configs?.each { config_name ->
pkgconf_per_src_index[pkg_name][config_name] = pkgconf_per_src_index[pkg_name][config_name]?: []
pkgconf_per_src_index[pkg_name][config_name] << [ lib_name: libName, collection: collection.name ]
}
}
}
Expand Down Expand Up @@ -122,11 +138,12 @@ void generate_ci_job(gz_ci_job, lib_name, branch, ci_config,
}
}

def configs_per_lib_index = [:].withDefault { [:] }
generate_ciconfigs_by_lib(gz_collections_yaml, configs_per_lib_index)
def ciconf_per_lib_index = [:].withDefault { [:] }
def pkgconf_per_src_index = [:].withDefault { [:] }
generate_ciconfigs_by_lib(gz_collections_yaml, ciconf_per_lib_index, pkgconf_per_src_index)

// Generate PR jobs: 1 per ci configuration on each lib
configs_per_lib_index.each { lib_name, lib_configs ->
ciconf_per_lib_index.each { lib_name, lib_configs ->
lib_configs.each { ci_configs ->
def config_name = ci_configs.getKey()
def ci_config = gz_collections_yaml.ci_configs.find{ it.name == config_name }
Expand All @@ -138,6 +155,11 @@ configs_per_lib_index.each { lib_name, lib_configs ->
assert(branch_names)
assert(ci_config)

if (ci_config.exclude.contains(lib_name))
return

// Main PR jobs (-ci-pr_any-) (pulling check every 5 minutes)
// --------------------------------------------------------------
def distro = ci_config.system.version
def arch = ci_config.system.arch
def gz_job_name_prefix = lib_name.replaceAll('-','_')
Expand Down Expand Up @@ -209,7 +231,6 @@ configs_per_lib_index.each { lib_name, lib_configs ->
// TODO: remove after testing
if (branch_and_collection.collection != 'harmonic')
return

branch_name = branch_and_collection.branch
def gz_ci_job = job("${gz_job_name_prefix}-ci-${branch_name}-${distro}-${arch}")
generate_ci_job(gz_ci_job, lib_name, branch_name, ci_config)
Expand All @@ -227,6 +248,26 @@ configs_per_lib_index.each { lib_name, lib_configs ->
} //en of lib_configs
} // end of lib

pkgconf_per_src_index.each { pkg_src, pkg_src_configs ->
pkg_src_configs.each { pkg_src_config ->
def config_name = pkg_src_config.getKey()
def pkg_config = gz_collections_yaml.packaging_configs.find{ it.name == config_name }
// lib_names are the same in all the entries
def canonical_lib_name = pkg_src_config.getValue()[0].lib_name

if (pkg_config.exclude?.contains(canonical_lib_name))
return

def gz_source_job = job("${pkg_src}-source")
OSRFSourceCreation.create(gz_source_job, [
PACKAGE: pkg_src ,
SOURCE_REPO_URI: "https://github.com/gazebosim/${canonical_lib_name}.git"])
OSRFSourceCreation.call_uploader_and_releasepy(gz_source_job,
'repository_uploader_packages',
'_releasepy')
}
}

if (WRITE_JOB_LOG) {
File log_file = new File("jobs.txt")
logging_list.each { log_type, items ->
Expand Down
65 changes: 47 additions & 18 deletions jenkins-scripts/dsl/gz-collections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ collections:
configs:
- bionic
packaging:
configs:
- bionic
linux:
package_name:
ignore_major_version:
- ign-citadel
- name: 'fortress'
Expand Down Expand Up @@ -174,10 +175,11 @@ collections:
configs:
- focal
packaging:
configs:
- focal
linux:
package_name:
ignore_major_version:
- gz-fortress
ignore_major_version:
- gz-fortress
- name: 'garden'
libs:
- name: gz-cmake
Expand Down Expand Up @@ -252,10 +254,11 @@ collections:
configs:
- focal
packaging:
configs:
- focal
linux:
package_name:
ignore_major_version:
- gz-garden
ignore_major_version:
- gz-garden
- name: 'harmonic'
libs:
- name: gz-cmake
Expand Down Expand Up @@ -330,13 +333,11 @@ collections:
configs:
- jammy
packaging:
configs:
- jammy
linux:
package_name:
ignore_major_version:
- gz-harmonic
nightly:
distros:
- jammy
ignore_major_version:
- gz-harmonic
- name: 'ionic'
libs:
- name: gz-cmake
Expand Down Expand Up @@ -408,12 +409,11 @@ collections:
- jammy
packaging:
linux:
package_name:
ignore_major_version:
- gz-ionic
ignore_major_version:
- gz-ionic
nightly:
distros:
- jammy
distros:
- jammy
- name: '__upcoming__'
libs:
- name: gz-cmake
Expand Down Expand Up @@ -484,6 +484,8 @@ collections:
configs:
- jammy
packaging:
configs:
- jammy
exclude:
- __upcoming__
ci_configs:
Expand Down Expand Up @@ -561,3 +563,30 @@ ci_configs:
gz-physics:
- "export MAKE_JOBS=1"
tests_disabled:
packaging_configs:
- name: bionic
system:
so: linux
distribution: ubuntu
version: bionic
arch:
- i386
- amd64
- arm64
- name: focal
system:
so: linux
distribution: ubuntu
version: focal
arch:
- amd64
- arm64
- name: jammy
system:
so: linux
distribution: ubuntu
version: jammy
arch:
- amd64
- arm64
- armhf
2 changes: 1 addition & 1 deletion jenkins-scripts/dsl/ignition_collection.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ String get_debbuilder_name(parsed_yaml_lib, parsed_yaml_packaging)
{
major_version = parsed_yaml_lib.major_version

ignore_major_version = parsed_yaml_packaging.linux?.package_name?.ignore_major_version
ignore_major_version = parsed_yaml_packaging.linux?.ignore_major_version
if (ignore_major_version && ignore_major_version.contains(parsed_yaml_lib.name))
major_version = ""

Expand Down
10 changes: 9 additions & 1 deletion jenkins-scripts/lib/_homebrew_base_setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ fi

git -C $(${BREW_BINARY} --repo) fsck
export HOMEBREW_UPDATE_TO_TAG=1
${BREW_BINARY} update

# There might be a background process that blocks `brew update`, so we try to
# run it several times until it succeeds.
# See https://github.com/Homebrew/brew/issues/1155
brew_update_retry_count=0
until ${BREW_BINARY} update || (( brew_update_retry_count++ > 6 ))
do
sleep 10
done
# manually exclude a ruby warning that jenkins thinks is from clang
# https://github.com/osrf/homebrew-simulation/issues/1343
${BREW_BINARY} install ${BREW_BASE_DEPENDCIES} \
Expand Down

0 comments on commit c046c37

Please sign in to comment.