Make the Jenkins `ceph-windows-test` similar to `ceph-windows-pull-requests` job.
However, `ceph-windows-test` is meant to be triggered on-demand, and it
exposes more parameters for `win32_build.sh` script, and artifacts collected
at the end of the job run.
The new `ceph-windows-test` Jenkins job will have the following new parameters:
* `CEPH_GIT_REPO` - The Ceph git repo used to clone.
* `CEPH_GIT_BRANCH` - The Ceph git branch name used to clone.
* `CEPH_WIN32_BUILD_FLAGS` - Build flags passed to `win32_build.sh`
besides the defaults.
* `INCLUDE_USERSPACE_CRASH_DUMPS` - Collect Windows userspace crash dumps
with the job artifacts.
* `INCLUDE_CEPH_ZIP` - Collect the `ceph.zip` Windows build with the
job artifacts. This is useful for debugging failures locally.
Also, create `scripts/ceph-windows/win32_build` common script. This is
used in both Jenkins jobs to cross-build Ceph Windows.
Besides this, we collect artifacts with `trap EXIT` instance.
Previously, if the tests failed, the artifacts wouldn't be collected.
Due to the fact that artifacts collected might occupy more space,
we limit `artifact-num-to-keep` to `15`.
Signed-off-by: Ionut Balutoiu <ibalutoiu@cloudbasesolutions.com>
+++ /dev/null
-#!/usr/bin/env bash
-set -o errexit
-set -o pipefail
-
-docs_pr_only
-if [ "$DOCS_ONLY" = true ]; then
- echo "Only the doc/ dir changed. No need to run Ceph Windows tests."
- exit 0
-fi
-
-#
-# Build Ceph Windows
-#
-cd $WORKSPACE/ceph
-git submodule update --init --recursive
-ZIP_DEST=$WORKSPACE/ceph.zip timeout 3h ./win32_build.sh
--- /dev/null
+#!/usr/bin/env bash
+set -o errexit
+set -o pipefail
+
+docs_pr_only
+if [ "$DOCS_ONLY" = true ]; then
+ echo "Only the doc/ dir changed. No need to run Ceph Windows tests."
+ exit 0
+fi
- shell:
!include-raw:
- ../../../scripts/build_utils.sh
- - ../../build/build
+ - ../../build/check_docs_pr_only
+ - ../../../scripts/ceph-windows/win32_build
- ../../../scripts/ceph-windows/setup_libvirt_vm
- ../../../scripts/ceph-windows/run_tests
publishers:
- archive:
- artifacts: 'logs/**'
+ artifacts: 'artifacts/**'
allow-empty: true
latest-only: false
+++ /dev/null
-#!/usr/bin/env bash
-set -o errexit
-set -o pipefail
-
-CEPH_WINDOWS_VERSION=${CEPH_WINDOWS_VERSION:-"1809"}
-CEPH_WINDOWS_BRANCH=${CEPH_WINDOWS_BRANCH:-"main"}
-CEPH_WINDOWS_SHA1=${CEPH_WINDOWS_SHA1:-"latest"}
-
-GET_BIN_SCRIPT_URL="https://raw.githubusercontent.com/ceph/ceph-win32-tests/main/get-bin.py"
-
-#
-# Download the Chacra Ceph Windows build
-#
-cd $WORKSPACE
-timeout 1m curl -L -o ./get-chacra-bin.py $GET_BIN_SCRIPT_URL
-chmod +x ./get-chacra-bin.py
-timeout 10m ./get-chacra-bin.py \
- --distrover $CEPH_WINDOWS_VERSION \
- --branchname $CEPH_WINDOWS_BRANCH \
- --sha1 $CEPH_WINDOWS_SHA1
days-to-keep: 30
num-to-keep: 30
artifact-days-to-keep: 30
- artifact-num-to-keep: 30
+ artifact-num-to-keep: 15
parameters:
- string:
- name: CEPH_WINDOWS_VERSION
- description: "The Windows version for the Ceph build."
- default: 1809
+ name: CEPH_GIT_REPO
+ description: "The Ceph git repo."
+ default: https://github.com/ceph/ceph.git
+
- string:
- name: CEPH_WINDOWS_BRANCH
- description: "The branch name for the Ceph build."
+ name: CEPH_GIT_BRANCH
+ description: "The Ceph git branch name."
default: main
+
- string:
- name: CEPH_WINDOWS_SHA1
- description: "The SHA1 for the Ceph build."
- default: latest
+ name: CEPH_WIN32_BUILD_FLAGS
+ description: |
+ Space-separated list of key=value items passed as environment variables to Ceph './win32_build.sh' script.
+ For example: "ENABLE_SHARED=True NUM_WORKERS=4". If this is not set, the default build flags are used.
+
+ - bool:
+ name: INCLUDE_USERSPACE_CRASH_DUMPS
+ description: "Include Windows user-space crash dumps in the artifacts collected."
+
+ - bool:
+ name: INCLUDE_CEPH_ZIP
+ description: "Include Ceph Windows zip (useful for debugging with symbol files) in the artifacts collected."
+
+ scm:
+ - git:
+ url: $CEPH_GIT_REPO
+ branches:
+ - $CEPH_GIT_BRANCH
+ browser: auto
+ timeout: 20
+ do-not-fetch-tags: true
+ shallow-clone: true
+ honor-refspec: true
+ wipe-workspace: true
+ basedir: ceph
builders:
- shell:
!include-raw:
- - ../../build/get_chacra_build
- ../../../scripts/build_utils.sh
+ - ../../../scripts/ceph-windows/win32_build
- ../../../scripts/ceph-windows/setup_libvirt_vm
- ../../../scripts/ceph-windows/run_tests
publishers:
- archive:
- artifacts: 'logs/**'
+ artifacts: 'artifacts/**'
allow-empty: true
latest-only: false
fi
CEPHADM_RELEASE=${CEPHADM_RELEASE:-"quincy"}
+WIN_USERSPACE_CRASH_DUMPS=${WIN_USERSPACE_CRASH_DUMPS:-"C:\\userspace_crash_dumps"}
#
# Install requirements (if needed)
sudo ceph osd pool create rbd
+#
+# Clone ceph-win32-tests repo
+#
+SSH_TIMEOUT=5m ssh_exec git.exe clone https://github.com/ceph/ceph-win32-tests.git /workspace/repos/ceph-win32-tests
+
+#
+# Set Windows user-space crash dumps directory
+#
+ssh_exec powershell.exe /workspace/repos/ceph-win32-tests/test_host/set_userspace_crashdump_location.ps1 -dumpDir $WIN_USERSPACE_CRASH_DUMPS
+
#
# Copy the ceph.conf and keyring to the Windows VM
#
ssh_exec powershell.exe Start-Service -Name ceph-rbd
#
-# Run the Windows tests
+# Collect artifacts on script exit
#
-SSH_TIMEOUT=5m ssh_exec git.exe clone https://github.com/ceph/ceph-win32-tests.git /workspace/repos/ceph-win32-tests
-SSH_TIMEOUT=1h ssh_exec powershell.exe /workspace/repos/ceph-win32-tests/test_host/run_tests.ps1 -workerCount 4
+function collect_artifacts() {
+ rm -rf $WORKSPACE/artifacts
+ mkdir -p $WORKSPACE/artifacts
+
+ scp_download /workspace/test_results $WORKSPACE/artifacts/test_results
+ if [[ "$INCLUDE_USERSPACE_CRASH_DUMPS" = true ]]; then
+ scp_download /userspace_crash_dumps $WORKSPACE/artifacts/userspace_crash_dumps
+ fi
+ if [[ "$INCLUDE_CEPH_ZIP" = true ]]; then
+ cp $WORKSPACE/ceph.zip $WORKSPACE/artifacts/ceph.zip
+ fi
+}
+trap collect_artifacts EXIT
#
-# Collect logs
+# Run the Windows tests
#
-rm -rf $WORKSPACE/logs
-mkdir -p $WORKSPACE/logs
-scp_download /workspace/test_results $WORKSPACE/logs/test_results
+SSH_TIMEOUT=1h ssh_exec powershell.exe /workspace/repos/ceph-win32-tests/test_host/run_tests.ps1 -workerCount 4
--- /dev/null
+#!/usr/bin/env bash
+set -o errexit
+set -o pipefail
+
+#
+# Build Ceph Windows
+#
+cd $WORKSPACE/ceph
+git submodule update --init --recursive
+ZIP_DEST=$WORKSPACE/ceph.zip $CEPH_WIN32_BUILD_FLAGS timeout 3h ./win32_build.sh