Skip to content

Commit

Permalink
Merge branch 'master' into update_gzdev
Browse files Browse the repository at this point in the history
  • Loading branch information
j-rivero authored Apr 9, 2024
2 parents 9196b54 + f392d30 commit 9d71753
Show file tree
Hide file tree
Showing 8 changed files with 243 additions and 228 deletions.
2 changes: 1 addition & 1 deletion jenkins-scripts/docker/gz-source-generation.bash
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cmake .. -DPACKAGE_SOURCE_ONLY:BOOL=ON
make package_source
rm -fr \$PKG_DIR && mkdir \$PKG_DIR
find \${BUILD_DIR} -maxdepth 1 -name '*${VERSION}.tar.*' -exec mv {} \${PKG_DIR} \\;
find \${BUILD_DIR} -maxdepth 1 -name '*-${VERSION}.tar.*' -exec mv {} \${PKG_DIR} \\;
if [ $(ls 2>/dev/null -Ubad1 -- "\${PKG_DIR}" | wc -l) -gt 1 ]; then
echo "Found more than one file inside pkgs directory:"
Expand Down
25 changes: 5 additions & 20 deletions jenkins-scripts/dsl/_configs_/Globals.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ class Globals
static CRON_ON_WEEKEND = 'H H * * 6-7'
// Run nightly scheduler every 20 minutes being sure to
// run it at 9 just before the nightly creation.
static CRON_NIGHTLY_NODES = [
'*/20 9-23 * * *',
'*/20 0-8 * * *']
static CRON_NIGHTLY_NODES = '*/20 9-23 * * * \n20 0-8 * * *'

// Start the nightly generation 10 minutes after the nigthly node
// initial generation
Expand All @@ -29,16 +27,12 @@ class Globals

static gpu_by_distro = [ bionic : [ 'nvidia' ]]

static ros_ci = [ 'melodic' : ['bionic'] ,
'noetic' : ['focal'] ,
'foxy' : ['focal'] ,
'rolling' : ['jammy']]
static ros_ci = [ 'noetic' : ['focal'] ,
'foxy' : ['focal']]

// This should be in sync with archive_library
static gz_version_by_rosdistro = [ 'melodic' : ['9'] ,
'noetic' : ['11'] ,
'foxy' : ['11'] ,
'rolling' : ['11']]
static gz_version_by_rosdistro = [ 'noetic' : ['11'] ,
'foxy' : ['11']]

static String ign2gz(String str) {
str = str.replaceAll("ignitionrobotics","gazebosim")
Expand Down Expand Up @@ -121,15 +115,6 @@ class Globals
return [ 'melodic', 'noetic' ]
}

static ArrayList get_ros2_suported_distros()
{
return [ 'foxy', 'rolling' ]
}

static String get_ros2_development_distro() {
return 'rolling'
}

static String nontest_label(String original_label) {
return "(${original_label}) && !test-instance"
}
Expand Down
13 changes: 11 additions & 2 deletions jenkins-scripts/dsl/_configs_/OSRFSourceCreation.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,17 @@ class OSRFSourceCreation
-name ${canonical_package_name}-\${VERSION}.tar.* \
-printf "%f\\n")
if [[ -z \${tarball} ]] || [[ \$(wc -w <<< \${tarball}) != 1 ]]; then
echo "Tarball name extraction returned \${tarball} which is not a one word string"
exit 1
# There is one use case that can be valid but failed to find canonical_package_name
# which are package using _ (underscores) in their name like gz-fuel_tools. Workaround
# is to just search for the VERSION (not so safety but should work)
tarball=\$(find \${WORKSPACE}/${pkg_sources_dir} \
-type f \
-name *-\${VERSION}.tar.* \
-printf "%f\\n")
if [[ -z \${tarball} ]] || [[ \$(wc -w <<< \${tarball}) != 1 ]]; then
echo "Tarball name extraction returned \${tarball} which is not a one word string"
exit 1
fi
fi
echo "S3_FILES_TO_UPLOAD=\${tarball}" >> ${properties_file}
Expand Down
4 changes: 1 addition & 3 deletions jenkins-scripts/dsl/core.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ nightly_labeler.with
label Globals.nontest_label("master")

triggers {
Globals.CRON_NIGHTLY_NODES.each { cron_entry ->
cron(cron_entry)
}
cron(Globals.CRON_NIGHTLY_NODES)
}

steps
Expand Down
226 changes: 120 additions & 106 deletions jenkins-scripts/dsl/gazebo_libs.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -335,143 +335,157 @@ ciconf_per_lib_index.each { lib_name, lib_configs ->
def gz_job_name_prefix = lib_name.replaceAll('-','_')
def distro = ci_config.system.version
def arch = ci_config.system.arch
def categories_enabled = ci_config.ci_categories_enabled
def ws_checkout_dir = lib_name
if (ci_config.exclude.all?.contains(lib_name))
return
assert(lib_name)
assert(branch_names)
assert(ci_config)
assert(categories_enabled)

// CI branch jobs (-ci-$branch-) (pulling check every 5 minutes)
branches_with_collections.each { branch_and_collection ->
def gz_ci_job
branch_name = branch_and_collection.branch
if (ci_config.system.so == 'linux') {
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)
// Generate asan jobs on Linux
def gz_ci_asan_job = job("${gz_job_name_prefix}-ci_asan-${branch_name}-${distro}-${arch}")
generate_asan_ci_job(gz_ci_asan_job, lib_name, branch_name, ci_config)
gz_ci_asan_job.with
if (categories_enabled.contains('stable_branches'))
{
if (ci_config.system.so == 'linux') {
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)
if (categories_enabled.contains('stable_branches_asan'))
{
// Generate asan jobs on Linux
def gz_ci_asan_job = job("${gz_job_name_prefix}-ci_asan-${branch_name}-${distro}-${arch}")
generate_asan_ci_job(gz_ci_asan_job, lib_name, branch_name, ci_config)
gz_ci_asan_job.with
{
triggers {
scm(Globals.CRON_ON_WEEKEND)
}
}
logging_list['asan_ci'].add(
[collection: branch_and_collection.collection,
job_name: gz_ci_asan_job.name])
}
} else if (ci_config.system.so == 'darwin') {
gz_ci_job = job("${gz_job_name_prefix}-ci-${branch_name}-homebrew-${arch}")
generate_brew_ci_job(gz_ci_job, lib_name, branch_name, ci_config)
} else if (ci_config.system.so == 'windows') {
branch_number = branch_name - lib_name
Globals.gazebodistro_branch = true
gz_ci_job = job("${gz_job_name_prefix}-${branch_number}-win")
generate_win_ci_job(gz_ci_job, lib_name, branch_name, ci_config)
Globals.gazebodistro_branch = false
} else {
assert false : "Unexpected config.system.so type: ${ci_config.system.so}"
}

gz_ci_job.with
{
triggers {
scm(Globals.CRON_ON_WEEKEND)
scm('@daily')
}
}
logging_list['asan_ci'].add(
[collection: branch_and_collection.collection,
job_name: gz_ci_asan_job.name])
} else if (ci_config.system.so == 'darwin') {
gz_ci_job = job("${gz_job_name_prefix}-ci-${branch_name}-homebrew-${arch}")
generate_brew_ci_job(gz_ci_job, lib_name, branch_name, ci_config)
} else if (ci_config.system.so == 'windows') {
branch_number = branch_name - lib_name
Globals.gazebodistro_branch = true
gz_ci_job = job("${gz_job_name_prefix}-${branch_number}-win")
generate_win_ci_job(gz_ci_job, lib_name, branch_name, ci_config)
Globals.gazebodistro_branch = false
} else {
assert false : "Unexpected config.system.so type: ${ci_config.system.so}"
}

gz_ci_job.with
{
triggers {
scm('@daily')
}
}

logging_list['branch_ci'].add(
[collection: branch_and_collection.collection,
job_name: gz_ci_job.name])
logging_list['branch_ci'].add(
[collection: branch_and_collection.collection,
job_name: gz_ci_job.name])
} // end of daily category enabled
} // end_of_branch

if (ci_config.system.so == 'linux') {
def pre_setup_script = ci_config.pre_setup_script_hook?.get(lib_name)?.join('\n')
def extra_cmd = pre_setup_script ?: ""

def gz_ci_job_name = "${gz_job_name_prefix}-ci-pr_any-${distro}-${arch}"
def gz_ci_any_job = job(gz_ci_job_name)
OSRFLinuxCompilationAnyGitHub.create(gz_ci_any_job,
"gazebosim/${lib_name}",
is_testing_enabled(lib_name, ci_config),
ENABLE_CPPCHECK,
branch_names)
generate_label_by_requirements(gz_ci_any_job, lib_name, ci_config.requirements)
gz_ci_any_job.with
if (categories_enabled.contains('pr'))
{
if (ci_config.system.so == 'linux')
{
steps
def pre_setup_script = ci_config.pre_setup_script_hook?.get(lib_name)?.join('\n')
def extra_cmd = pre_setup_script ?: ""

def gz_ci_job_name = "${gz_job_name_prefix}-ci-pr_any-${distro}-${arch}"
def gz_ci_any_job = job(gz_ci_job_name)
OSRFLinuxCompilationAnyGitHub.create(gz_ci_any_job,
"gazebosim/${lib_name}",
is_testing_enabled(lib_name, ci_config),
ENABLE_CPPCHECK,
branch_names)
generate_label_by_requirements(gz_ci_any_job, lib_name, ci_config.requirements)
gz_ci_any_job.with
{
shell("""\
#!/bin/bash -xe

export DISTRO=${distro}

${GLOBAL_SHELL_CMD}
${extra_cmd}

export BUILDING_SOFTWARE_DIRECTORY=${lib_name}
export ARCH=${arch}
/bin/bash -xe ./scripts/jenkins-scripts/docker/${script_name_prefix}-compilation.bash
""".stripIndent())
} // end of steps
} // end of ci_any_job

if (! ci_config.exclude.abichecker?.contains(lib_name)) {
// ABI branch jobs (-ci-abichecker-) for non main branches
def abi_job_name = "${gz_job_name_prefix}-abichecker-any_to_any-ubuntu-${distro}-${arch}"
def abi_job = job(abi_job_name)
OSRFLinuxABIGitHub.create(abi_job)
GenericAnyJobGitHub.create(abi_job,
"gazebosim/${lib_name}",
branch_names - [ 'main'])
generate_label_by_requirements(abi_job, lib_name, ci_config.requirements)
abi_job.with
{
steps {
shell("""\
steps
{
shell("""\
#!/bin/bash -xe

export DISTRO=${distro}

${GLOBAL_SHELL_CMD}
${extra_cmd}

export BUILDING_SOFTWARE_DIRECTORY=${lib_name}
export ARCH=${arch}
export DEST_BRANCH=\${DEST_BRANCH:-\$ghprbTargetBranch}
export SRC_BRANCH=\${SRC_BRANCH:-\$ghprbSourceBranch}
export SRC_REPO=\${SRC_REPO:-\$ghprbAuthorRepoGitUrl}
export ABI_JOB_SOFTWARE_NAME=${lib_name}
/bin/bash -xe ./scripts/jenkins-scripts/docker/gz-abichecker.bash
/bin/bash -xe ./scripts/jenkins-scripts/docker/${script_name_prefix}-compilation.bash
""".stripIndent())
} // end of steps
} // end of with
} // end of ci_any_job

if (categories_enabled.contains('stable_branches') && \
(! ci_config.exclude.abichecker?.contains(lib_name)))
{
// ABI branch jobs (-ci-abichecker-) for non main branches
def abi_job_name = "${gz_job_name_prefix}-abichecker-any_to_any-ubuntu-${distro}-${arch}"
def abi_job = job(abi_job_name)
OSRFLinuxABIGitHub.create(abi_job)
GenericAnyJobGitHub.create(abi_job,
"gazebosim/${lib_name}",
branch_names - [ 'main'])
generate_label_by_requirements(abi_job, lib_name, ci_config.requirements)
abi_job.with
{
steps {
shell("""\
#!/bin/bash -xe

export DISTRO=${distro}

${GLOBAL_SHELL_CMD}
${extra_cmd}

export ARCH=${arch}
export DEST_BRANCH=\${DEST_BRANCH:-\$ghprbTargetBranch}
export SRC_BRANCH=\${SRC_BRANCH:-\$ghprbSourceBranch}
export SRC_REPO=\${SRC_REPO:-\$ghprbAuthorRepoGitUrl}
export ABI_JOB_SOFTWARE_NAME=${lib_name}
/bin/bash -xe ./scripts/jenkins-scripts/docker/gz-abichecker.bash
""".stripIndent())
} // end of steps
} // end of with
}
} else if (ci_config.system.so == 'darwin') {
// --------------------------------------------------------------
def gz_brew_ci_any_job_name = "${gz_job_name_prefix}-ci-pr_any-homebrew-amd64"
def gz_brew_ci_any_job = job(gz_brew_ci_any_job_name)
OSRFBrewCompilationAnyGitHub.create(gz_brew_ci_any_job,
"gazebosim/${lib_name}",
is_testing_enabled(lib_name, ci_config),
branch_names,
ENABLE_GITHUB_PR_INTEGRATION,
are_cmake_warnings_enabled(lib_name, ci_config))
add_brew_shell_build_step(gz_brew_ci_any_job, lib_name, ws_checkout_dir)
} else if (ci_config.system.so == 'windows') {
def gz_win_ci_any_job_name = "${gz_job_name_prefix}-pr-win"
def gz_win_ci_any_job = job(gz_win_ci_any_job_name)
Globals.gazebodistro_branch = true
OSRFWinCompilationAnyGitHub.create(gz_win_ci_any_job,
"gazebosim/${lib_name}",
is_testing_enabled(lib_name, ci_config),
branch_names,
ENABLE_GITHUB_PR_INTEGRATION,
are_cmake_warnings_enabled(lib_name, ci_config))
add_win_devel_bat_call(gz_win_ci_any_job, lib_name, ws_checkout_dir)
Globals.gazebodistro_branch = false
}
} else if (ci_config.system.so == 'darwin') {
// --------------------------------------------------------------
def gz_brew_ci_any_job_name = "${gz_job_name_prefix}-ci-pr_any-homebrew-amd64"
def gz_brew_ci_any_job = job(gz_brew_ci_any_job_name)
OSRFBrewCompilationAnyGitHub.create(gz_brew_ci_any_job,
"gazebosim/${lib_name}",
is_testing_enabled(lib_name, ci_config),
branch_names,
ENABLE_GITHUB_PR_INTEGRATION,
are_cmake_warnings_enabled(lib_name, ci_config))
add_brew_shell_build_step(gz_brew_ci_any_job, lib_name, ws_checkout_dir)
} else if (ci_config.system.so == 'windows') {
def gz_win_ci_any_job_name = "${gz_job_name_prefix}-pr-win"
def gz_win_ci_any_job = job(gz_win_ci_any_job_name)
Globals.gazebodistro_branch = true
OSRFWinCompilationAnyGitHub.create(gz_win_ci_any_job,
"gazebosim/${lib_name}",
is_testing_enabled(lib_name, ci_config),
branch_names,
ENABLE_GITHUB_PR_INTEGRATION,
are_cmake_warnings_enabled(lib_name, ci_config))
add_win_devel_bat_call(gz_win_ci_any_job, lib_name, ws_checkout_dir)
Globals.gazebodistro_branch = false
}
} //en of lib_configs
} //end of pr enabled
} //end of lib_configs
} // end of lib

pkgconf_per_src_index.each { pkg_src, pkg_src_configs ->
Expand Down
Loading

0 comments on commit 9d71753

Please sign in to comment.