Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 6 additions & 8 deletions ceph-pr-api/build/build
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
#!/bin/bash -e

docs_pr_only
container_pr_only
if [[ "$DOCS_ONLY" = true || "$CONTAINER_ONLY" = true ]]; then
echo "Only the doc/ or container/ dir changed. No need to run make check or API tests."
mkdir -p $WORKSPACE/build/out
echo "File created to avoid Jenkins' Artifact Archiving plugin from hanging" > $WORKSPACE/build/out/mgr.foo.log
exit 0
fi
echo "This job was triggered by $TRIGGER_METHOD via $TRIGGERED_BY"

report_github_check_status pending "ceph API tests" "ceph API tests running" $GH_PULL_REQUEST_SHA $BUILD_URL

n_build_jobs=$(get_nr_build_jobs)
n_test_jobs=$(($(nproc) / 4))
Expand All @@ -16,5 +11,8 @@ export BUILD_MAKEOPTS="-j${n_build_jobs}"
export FOR_MAKE_CHECK=1
timeout 2h ./src/script/run-make.sh \
--cmake-args '-DWITH_TESTS=OFF -DENABLE_GIT_VERSION=OFF'

report_github_check_status success "ceph API tests" "ceph API tests passed" $GH_PULL_REQUEST_SHA $BUILD_URL

sleep 5
ps -ef | grep ceph || true
51 changes: 24 additions & 27 deletions ceph-pr-api/config/definitions/ceph-pr-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,24 @@

parameters:
- string:
name: sha1
description: "commit id or a refname, like 'origin/pr/72/head'"

triggers:
- github-pull-request:
cancel-builds-on-update: true
allow-whitelist-orgs-as-admins: true
org-list:
- ceph
white-list-target-branches:
- main
- tentacle
- squid
- reef
- "feature-.*"
trigger-phrase: 'jenkins test api'
skip-build-phrase: '^jenkins do not test.*'
only-trigger-phrase: false
github-hooks: true
permit-all: true
auto-close-on-fail: false
status-context: "ceph API tests"
started-status: "running API tests"
success-status: "ceph API tests succeeded"
failure-status: "ceph API tests failed"
name: GH_PULL_REQUEST_ID
description: "The GitHub PR number, like '72' in 'ceph/pull/72'"
- string:
name: GH_PULL_REQUEST_SHA
description: "The GitHub PR SHA1, like 'c816207c3130c67e5bcc56766a530e881e2c0181'"
- string:
name: TRIGGERED_BY
description: "The GitHub Action Workflow that called this job"
- string:
name: TRIGGER_METHOD
description: "The method by which this job was triggered (e.g., comment or push)"

scm:
- git:
url: https://github.com/ceph/ceph.git
branches:
- origin/pr/${{ghprbPullId}}/merge
refspec: +refs/pull/${{ghprbPullId}}/*:refs/remotes/origin/pr/${{ghprbPullId}}/*
- origin/pr/${{GH_PULL_REQUEST_ID}}/merge
refspec: +refs/pull/${{GH_PULL_REQUEST_ID}}/*:refs/remotes/origin/pr/${{GH_PULL_REQUEST_ID}}/*
browser: auto
timeout: 20
skip-tag: true
Expand All @@ -77,6 +63,14 @@
publishers:
- postbuildscript:
builders:
- role: SLAVE
build-on:
- FAILURE
- ABORTED
build-steps:
- shell: |
. ../../../scripts/report_github_check_status.sh
report_github_check_status failure "ceph API tests" "ceph API tests failed" ${{GH_PULL_REQUEST_SHA}} ${{BUILD_URL}}
- role: SLAVE
build-on:
- ABORTED
Expand All @@ -95,3 +89,6 @@
credential-id: github-readonly-token
username: GITHUB_USER
password: GITHUB_PASS
- text:
credential-id: github-ceph-jenkins-pr-checks
variable: GITHUB_TOKEN
12 changes: 6 additions & 6 deletions ceph-pull-requests-arm64/build/build
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#!/bin/bash -ex

docs_pr_only
container_pr_only
if [[ "$DOCS_ONLY" = true || "$CONTAINER_ONLY" = true ]]; then
echo "Only the doc/ or container/ dir changed. No need to run make check."
exit 0
fi
echo "This job was triggered by $TRIGGER_METHOD via $TRIGGERED_BY"

report_github_check_status pending "make check (arm64)" "make check (arm64) running" $GH_PULL_REQUEST_SHA $BUILD_URL

n_build_jobs=$(get_nr_build_jobs)
n_test_jobs=${n_build_jobs}
Expand All @@ -14,5 +11,8 @@ export BUILD_MAKEOPTS="-j${n_build_jobs}"
export WITH_CRIMSON=true
export WITH_RBD_RWL=true
timeout 4h ./run-make-check.sh

report_github_check_status success "make check (arm64)" "make check (arm64) passed" $GH_PULL_REQUEST_SHA $BUILD_URL

sleep 5
ps -ef | grep -v jnlp | grep ceph || true
2 changes: 2 additions & 0 deletions ceph-pull-requests-arm64/build/kill-tests
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash -ex

report_github_check_status failure "make check (arm64)" "make check (arm64) failed" $GH_PULL_REQUEST_SHA $BUILD_URL

# kill all descendant processes of ctest

# ceph-pull-requests-arm64/build/build is killed by jenkins when the ceph-pull-requests-arm64 job is aborted or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,27 @@
- shell:
!include-raw-verbatim:
- ../../../scripts/build_utils.sh
- ../../../scripts/report_github_check_status.sh
- ../../build/build
concurrent: true
disabled: false
name: ceph-pull-requests-arm64
node: 'arm64 && !centos7 && !centos8 && !centos9'

parameters:
- string:
name: ghprbPullId
description: "the GitHub pull id, like '72' in 'ceph/pull/72'"
default: origin/main
- string:
name: GH_PULL_REQUEST_ID
description: "The GitHub PR number, like '72' in 'ceph/pull/72'"
- string:
name: GH_PULL_REQUEST_SHA
description: "The GitHub PR SHA1, like 'c816207c3130c67e5bcc56766a530e881e2c0181'"
- string:
name: TRIGGERED_BY
description: "The GitHub Action Workflow that called this job"
- string:
name: TRIGGER_METHOD
description: "The method by which this job was triggered (e.g., comment or push)"

project-type: freestyle
properties:
- build-discarder:
Expand Down Expand Up @@ -42,31 +53,13 @@
url: https://github.com/ceph/ceph.git
name: origin
branches:
- origin/pr/${{ghprbPullId}}/merge
refspec: +refs/pull/${{ghprbPullId}}/*:refs/remotes/origin/pr/${{ghprbPullId}}/*
- origin/pr/${{GH_PULL_REQUEST_ID}}/merge
refspec: +refs/pull/${{GH_PULL_REQUEST_ID}}/*:refs/remotes/origin/pr/${{GH_PULL_REQUEST_ID}}/*
skip-tag: true
shallow-clone: true
honor-refspec: true
timeout: 20
wipe-workspace: true
triggers:
- github-pull-request:
cancel-builds-on-update: true
allow-whitelist-orgs-as-admins: true
org-list:
- ceph
trigger-phrase: 'jenkins test make check arm64'
skip-build-phrase: '^jenkins do not test.*'
only-trigger-phrase: false
github-hooks: true
permit-all: true
auto-close-on-fail: false
status-context: "make check (arm64)"
started-status: "running make check"
success-status: "make check succeeded"
failure-status: "make check failed"
white-list-target-branches:
- main
publishers:
- cobertura:
report-file: "src/pybind/mgr/dashboard/frontend/coverage/cobertura-coverage.xml"
Expand Down Expand Up @@ -110,3 +103,6 @@
credential-id: github-readonly-token
username: GITHUB_USER
password: GITHUB_PASS
- text:
credential-id: github-ceph-jenkins-pr-checks
variable: GITHUB_TOKEN
12 changes: 6 additions & 6 deletions ceph-pull-requests/build/build
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash -ex

docs_pr_only
container_pr_only
if [[ "$DOCS_ONLY" = true || "$CONTAINER_ONLY" = true ]]; then
echo "Only the doc/ or container/ dir changed. No need to run make check."
exit 0
fi
echo "This job was triggered by $TRIGGER_METHOD via $TRIGGERED_BY"

report_github_check_status pending "make check" "make check running" $GH_PULL_REQUEST_SHA $BUILD_URL

export NPROC=$(nproc)
export WITH_CRIMSON=true
export WITH_RBD_RWL=true
timeout 3h ./run-make-check.sh

report_github_check_status success "make check" "make check passed" $GH_PULL_REQUEST_SHA $BUILD_URL

sleep 5
ps -ef | grep -v jnlp | grep ceph || true
2 changes: 2 additions & 0 deletions ceph-pull-requests/build/kill-tests
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash -ex

report_github_check_status failure "make check" "make check failed" $GH_PULL_REQUEST_SHA $BUILD_URL

# kill all descendant processes of ctest

# ceph-pull-requests/build/build is killed by jenkins when the ceph-pull-requests job is aborted or
Expand Down
38 changes: 17 additions & 21 deletions ceph-pull-requests/config/definitions/ceph-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,24 @@

parameters:
- string:
name: ghprbPullId
description: "the GitHub pull id, like '72' in 'ceph/pull/72'"

triggers:
- github-pull-request:
cancel-builds-on-update: true
allow-whitelist-orgs-as-admins: true
org-list:
- ceph
trigger-phrase: 'jenkins test make check'
skip-build-phrase: '^jenkins do not test.*'
only-trigger-phrase: false
github-hooks: true
permit-all: true
auto-close-on-fail: false
status-context: "make check"
started-status: "running make check"
success-status: "make check succeeded"
failure-status: "make check failed"
name: GH_PULL_REQUEST_ID
description: "The GitHub PR number, like '72' in 'ceph/pull/72'"
- string:
name: GH_PULL_REQUEST_SHA
description: "The GitHub PR SHA1, like 'c816207c3130c67e5bcc56766a530e881e2c0181'"
- string:
name: TRIGGERED_BY
description: "The GitHub Action Workflow that called this job"
- string:
name: TRIGGER_METHOD
description: "The method by which this job was triggered (e.g., comment or push)"

scm:
- git:
url: https://github.com/ceph/ceph.git
branches:
- origin/pr/${{ghprbPullId}}/merge
refspec: +refs/pull/${{ghprbPullId}}/*:refs/remotes/origin/pr/${{ghprbPullId}}/*
- origin/pr/${{GH_PULL_REQUEST_ID}}/merge
refspec: +refs/pull/${{GH_PULL_REQUEST_ID}}/*:refs/remotes/origin/pr/${{GH_PULL_REQUEST_ID}}/*
browser: auto
timeout: 20
skip-tag: true
Expand All @@ -63,6 +55,7 @@
- shell:
!include-raw-verbatim:
- ../../../scripts/build_utils.sh
- ../../../scripts/report_github_check_status.sh
- ../../build/build

publishers:
Expand Down Expand Up @@ -109,3 +102,6 @@
credential-id: github-readonly-token
username: GITHUB_USER
password: GITHUB_PASS
- text:
credential-id: github-ceph-jenkins-pr-checks
variable: GITHUB_TOKEN
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,24 @@

parameters:
- string:
name: ghprbPullId
description: "The GitHub pull request id, like '72' in 'ceph/pull/72'"

triggers:
- github-pull-request:
cancel-builds-on-update: true
allow-whitelist-orgs-as-admins: true
org-list:
- ceph
white-list-target-branches:
- main
- tentacle
- squid
- reef
trigger-phrase: 'jenkins test windows'
skip-build-phrase: '^jenkins do not test.*'
only-trigger-phrase: false
github-hooks: true
permit-all: true
auto-close-on-fail: false
status-context: "ceph windows tests"
started-status: "running ceph windows tests"
success-status: "ceph windows tests succeeded"
failure-status: "ceph windows tests failed"
name: GH_PULL_REQUEST_ID
description: "The GitHub PR number, like '72' in 'ceph/pull/72'"
- string:
name: GH_PULL_REQUEST_SHA
description: "The GitHub PR SHA1, like 'c816207c3130c67e5bcc56766a530e881e2c0181'"
- string:
name: TRIGGERED_BY
description: "The GitHub Action Workflow that called this job"
- string:
name: TRIGGER_METHOD
description: "The method by which this job was triggered (e.g., comment or push)"

scm:
- git:
url: https://github.com/ceph/ceph.git
branches:
- origin/pr/${{ghprbPullId}}/merge
refspec: +refs/pull/${{ghprbPullId}}/*:refs/remotes/origin/pr/${{ghprbPullId}}/*
- origin/pr/${{GH_PULL_REQUEST_ID}}/merge
refspec: +refs/pull/${{GH_PULL_REQUEST_ID}}/*:refs/remotes/origin/pr/${{GH_PULL_REQUEST_ID}}/*
browser: auto
timeout: 20
do-not-fetch-tags: true
Expand All @@ -65,10 +52,13 @@
basedir: ceph

builders:
- shell: |
. ../../../scripts/report_github_check_status.sh
report_github_check_status pending "ceph windows tests" "ceph windows tests failed" ${{GH_PULL_REQUEST_SHA}} ${{BUILD_URL}}

- shell:
!include-raw-verbatim:
- ../../../scripts/build_utils.sh
- ../../build/check_docs_pr_only
- ../../../scripts/ceph-windows/setup_libvirt
- ../../../scripts/ceph-windows/setup_libvirt_ubuntu_vm
- ../../../scripts/ceph-windows/win32_build
Expand All @@ -78,6 +68,10 @@
- ../../../scripts/ceph-windows/setup_ceph_vstart
- ../../../scripts/ceph-windows/run_tests

- shell: |
. ../../../scripts/report_github_check_status.sh
report_github_check_status success "ceph windows tests" "ceph windows tests passed" ${{GH_PULL_REQUEST_SHA}} ${{BUILD_URL}}

publishers:
- archive:
artifacts: 'artifacts/**'
Expand All @@ -97,6 +91,14 @@
!include-raw-verbatim:
- ../../../scripts/build_utils.sh
- ../../../scripts/ceph-windows/cleanup
- role: SLAVE
build-on:
- FAILURE
- ABORTED
build-steps:
- shell: |
. ../../../scripts/report_github_check_status.sh
report_github_check_status failure "ceph windows tests" "ceph windows tests failed" ${{GH_PULL_REQUEST_SHA}} ${{BUILD_URL}}

wrappers:
- ansicolor
Expand All @@ -108,3 +110,6 @@
credential-id: github-readonly-token
username: GITHUB_USER
password: GITHUB_PASS
- text:
credential-id: github-ceph-jenkins-pr-checks
variable: GITHUB_TOKEN
Loading