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

Migrate Windows jobs for -ci-pr_any- and -ci-${branch}- to use gz-collections.yaml #1071

Merged
merged 21 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
if: steps.dsl_check.outputs.run_job == 'true'
run: |
# somehow the Jenkins views changed the portlet_ id on every run.
diff -qr -I '.*<id>dashboard_portlet_.*</id>.*' /tmp/current_xml_configuration /tmp/pr_xml_configuration > /tmp/xml_config_files_changed.diff || true
diff -qr -I '.*<id>dashboard_portlet_.*</id>.*' /tmp/current_xml_configuration /tmp/pr_xml_configuration | sort > /tmp/xml_config_files_changed.diff || true
diff -ur -I '.*<id>dashboard_portlet_.*</id>.*' /tmp/current_xml_configuration /tmp/pr_xml_configuration > /tmp/xml_config_content_changed.diff || true
diff -ur /tmp/current_log_generated /tmp/pr_log_generated > /tmp/log_content_changed.diff || true
- name: Archive files changes
Expand Down
5 changes: 2 additions & 3 deletions jenkins-scripts/dsl/core.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ update_vcpkg_snapshot_job.with
}
}

def ignition_testing_software = 'gazebo'
def testing_vcpkg_job = job("_vcpkg_testing_snapshot")
OSRFWinCompilationAnyGitHub.create(testing_vcpkg_job,
"gazebosim/ign-${ignition_testing_software}",
"gazebosim/gz-sim",
NO_TESTING, NO_BRANCHES, NO_GITHUB_PR_INTEGRATION)
testing_vcpkg_job.with
{
Expand All @@ -48,7 +47,7 @@ testing_vcpkg_job.with

batchFile("""\
call "%WORKSPACE%/scripts/jenkins-scripts/vcpkg-bootstrap.bat" || exit /B %errorlevel%
call "%WORKSPACE%/scripts/jenkins-scripts/ign_${ignition_testing_software}-default-devel-windows-amd64.bat"
call "%WORKSPACE%/scripts/jenkins-scripts/gz_sim-default-devel-windows-amd64.bat"
""".stripIndent())
}
}
Expand Down
13 changes: 11 additions & 2 deletions jenkins-scripts/dsl/dsl_checks.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,17 @@ if [[ -n ${not_null} ]]; then
exit 1
fi

# Check for existing scripts
for f in $(grep -Eh -o './scripts/.*.bash' -- *.xml | sort | uniq); do
# Check for existing scripts. Lines:
# 1. lookg for ./scripts/. and exclude comment lnes
# 2. replaces %WORKSPACE% by .
# 3. grab only the path from ./scripts/
# 4. remove spurious "
# 5. sor and uniq to get clean output
for f in $(grep -Eh './scripts/.*' -- *.xml | grep -v '//' | \
sed 's/%WORKSPACE%/./g' | \
grep -Eh -o './scripts/.*' | awk '{print $1}' | \
sed 's/"//g' | \
sort | uniq); do
if ! test -f "${f}"; then
echo "${f} script not found in the repository"
fi
Expand Down
49 changes: 48 additions & 1 deletion jenkins-scripts/dsl/gazebo_libs.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,33 @@ void generate_brew_ci_job(gz_brew_ci_job, lib_name, branch, ci_config)
add_brew_shell_build_step(gz_brew_ci_job, lib_name, ws_checkout_dir)
}

void add_win_devel_bat_call(gz_win_ci_job, lib_name, ws_checkout_dir)
{
def script_name_prefix = cleanup_library_name(lib_name)
gz_win_ci_job.with
{
steps {
batchFile("""\
set VCS_DIRECTORY=${ws_checkout_dir}
call "./scripts/jenkins-scripts/${script_name_prefix}-default-devel-windows-amd64.bat"
""".stripIndent())
}
}
}

void generate_win_ci_job(gz_win_ci_job, lib_name, branch, ci_config)
{
def ws_checkout_dir = lib_name
OSRFWinCompilation.create(gz_win_ci_job,
is_testing_enabled(lib_name, ci_config),
are_cmake_warnings_enabled(lib_name, ci_config))
OSRFGitHub.create(gz_win_ci_job,
"gazebosim/${lib_name}",
branch,
ws_checkout_dir)
add_win_devel_bat_call(gz_win_ci_job, lib_name, ws_checkout_dir)
}

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)
Expand All @@ -197,6 +224,7 @@ 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 ws_checkout_dir = lib_name
if (ci_config.exclude.all?.contains(lib_name))
return
assert(lib_name)
Expand All @@ -213,6 +241,14 @@ ciconf_per_lib_index.each { lib_name, lib_configs ->
} 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
Expand Down Expand Up @@ -292,14 +328,25 @@ ciconf_per_lib_index.each { lib_name, lib_configs ->
// --------------------------------------------------------------
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)
def ws_checkout_dir = lib_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 lib
Expand Down
51 changes: 51 additions & 0 deletions jenkins-scripts/dsl/gz-collections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ collections:
configs:
- bionic
- brew
- win
packaging:
configs:
- bionic
Expand Down Expand Up @@ -176,6 +177,7 @@ collections:
configs:
- focal
- brew
- win
packaging:
configs:
- focal
Expand Down Expand Up @@ -256,6 +258,7 @@ collections:
configs:
- focal
- brew
- win
packaging:
configs:
- focal
Expand Down Expand Up @@ -336,6 +339,7 @@ collections:
configs:
- jammy
- brew
- win
packaging:
configs:
- jammy
Expand Down Expand Up @@ -412,6 +416,7 @@ collections:
configs:
- jammy
- brew
- win
packaging:
configs:
- jammy
Expand All @@ -431,6 +436,7 @@ collections:
configs:
- jammy
- brew
- win
packaging:
configs:
- jammy
Expand Down Expand Up @@ -547,6 +553,51 @@ ci_configs:
- gz-transport
- gz-utils
- sdformat
- name: win
system:
so: windows
distribution: windows
version: "10"
arch: amd64
requirements:
exclude:
all:
- ign-citadel
- gz-fortress
- gz-garden
- gz-harmonic
- gz-ionic
- __upcoming__
cmake_warnings_disabled:
- gz-cmake
- gz-common
- gz-fuel-tools
- gz-sim
- gz-gui
- gz-launch
- gz-math
- gz-msgs
- gz-physics
- gz-rendering
- gz-sensors
- gz-tools
- gz-transport
- gz-utils
- ign-cmake
- ign-common
- ign-fuel-tools
- ign-sim
- ign-gui
- ign-launch
- ign-math
- ign-msgs
- ign-physics
- ign-rendering
- ign-sensors
- ign-tools
- ign-transport
- ign-utils
- sdformat
packaging_configs:
- name: bionic
system:
Expand Down
52 changes: 1 addition & 51 deletions jenkins-scripts/dsl/ignition.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -642,61 +642,11 @@ gz_software.each { gz_sw ->
enable_cmake_warnings(gz_sw))
gz_win_ci_any_job.with
{
steps {
batchFile("""\
call "./scripts/jenkins-scripts/ign_${gz_sw}-default-devel-windows-amd64.bat"
""".stripIndent())
}
description 'Automatic generated job by DSL jenkins. Stub job for migration, not doing any check'
}

// add ci-pr_any to the list for CIWorkflow
ci_pr_any_list[gz_sw] << gz_win_ci_any_job_name

// 2. main, release branches
all_branches("${gz_sw}").each { branch ->
if (is_a_colcon_package(gz_sw)) {
// colcon uses long paths and windows has a hard limit of 260 chars. Keep
// names minimal
if (branch == 'main')
branch_name = "ci"
else
branch_name = branch - gz_sw
// Deal with the special case of changing gazebo name by sim
branch_name = branch_name.replace('gz-sim','gz-')
gz_win_ci_job_name = "ign_${gz_sw}-${branch_name}-win"
} else {
gz_win_ci_job_name = "ignition_${gz_sw}-ci-${branch}-windows7-amd64"
}

def gz_win_ci_job = job(gz_win_ci_job_name)
OSRFWinCompilation.create(gz_win_ci_job,
enable_testing(gz_sw),
enable_cmake_warnings(gz_sw))
OSRFGitHub.create(gz_win_ci_job,
"gazebosim/gz-${gz_sw}",
"${branch}")

gz_win_ci_job.with
{
// ign-gazebo only works on Windows from ign-gazebo5
if (branch == 'ign-gazebo3')
disabled()

// ign-launch was not ported to windows until 5
if (branch == 'ign-launch2')
disabled()

triggers {
scm('@daily')
}

steps {
batchFile("""\
call "./scripts/jenkins-scripts/ign_${gz_sw}-default-devel-windows-amd64.bat"
""".stripIndent())
}
}
}
}

// Main CI workflow
Expand Down
3 changes: 2 additions & 1 deletion jenkins-scripts/dsl/ignition_collection.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@ gz_collections_yaml.collections.each { collection ->
// to yaml efforts. Remove from here when -install- and -win- jobs are implemented
// in gazebo_libs
if (ci_config.exclude.all?.contains(gz_collection_name) ||
ci_config.name == "brew" )
ci_config.system.so == 'darwin' ||
ci_config.system.so == 'windows')
return

// INSTALL JOBS:
Expand Down
46 changes: 0 additions & 46 deletions jenkins-scripts/dsl/sdformat.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -198,49 +198,3 @@ sdformat_supported_versions.each { version ->
}
}
}

// --------------------------------------------------------------
// WINDOWS: CI job

// 1. any
String ci_build_any_job_name_win7 = "sdformat-pr-win"
def sdformat_win_ci_any_job = job(ci_build_any_job_name_win7)
OSRFWinCompilationAnyGitHub.create(sdformat_win_ci_any_job,
"gazebosim/sdformat")
sdformat_win_ci_any_job.with
{
steps {
batchFile("""\
call "./scripts/jenkins-scripts/sdformat-default-devel-windows-amd64.bat"
""".stripIndent())
}
}

// 2. main / @ SCM/Daily
all_versions = sdformat_supported_versions + 'main'
all_versions.each { version ->
// Use replace to get branch names to sync with ignition packages and the
// format of $branch-$version
def sdformat_win_ci_job = job("sdformat-sdf-" + version.replace('sdformat','') + "-win")
OSRFWinCompilation.create(sdformat_win_ci_job)
OSRFGitHub.create(sdformat_win_ci_job, "gazebosim/sdformat",
get_sdformat_branch_name(version))
sdformat_win_ci_job.with
{
triggers {
scm('@daily')
}

steps {
batchFile("""\
set USE_GZ_ZIP=FALSE
call "./scripts/jenkins-scripts/sdformat-default-devel-windows-amd64.bat"
""".stripIndent())
}
}
}

// Create the manual all-platforms jobs
def sdformat_ci_main = pipelineJob("sdformat-ci-manual_any")
OSRFCIWorkFlowMultiAnyGitHub.create(sdformat_ci_main,
[ci_build_any_job_name_win7])
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set SCRIPT_DIR=%~dp0

set VCS_DIRECTORY=gz-cmake
if not defined VCS_DIRECTORY set VCS_DIRECTORY=gz-cmake
set PLATFORM_TO_BUILD=x86_amd64
set IGN_CLEAN_WORKSPACE=true

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set SCRIPT_DIR=%~dp0

set VCS_DIRECTORY=gz-common
if not defined VCS_DIRECTORY set VCS_DIRECTORY=gz-common
set PLATFORM_TO_BUILD=x86_amd64
set IGN_CLEAN_WORKSPACE=true

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set SCRIPT_DIR=%~dp0

set VCS_DIRECTORY=gz-fuel-tools
if not defined VCS_DIRECTORY set VCS_DIRECTORY=gz-fuel-tools
set PLATFORM_TO_BUILD=x86_amd64
set IGN_CLEAN_WORKSPACE=true
set COLCON_PACKAGE=gz-fuel_tools
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo on
set SCRIPT_DIR=%~dp0

set VCS_DIRECTORY=gz-gui
if not defined VCS_DIRECTORY set VCS_DIRECTORY=gz-gui
set PLATFORM_TO_BUILD=x86_amd64
set IGN_CLEAN_WORKSPACE=true
set COLCON_PACKAGE=gz-gui
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set SCRIPT_DIR=%~dp0

set VCS_DIRECTORY=gz-launch
if not defined VCS_DIRECTORY set VCS_DIRECTORY=gz-launch
set PLATFORM_TO_BUILD=x86_amd64
set IGN_CLEAN_WORKSPACE=true
set COLCON_PACKAGE=gz-launch
Expand Down
Loading