Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
19 changes: 10 additions & 9 deletions .github/ci-scripts/dco.jq
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,24 @@
# commit that fails the check (nothing if all commits pass).
#
# Merge commits and commits of bots are skipped. Every other commit needs a
# 'Signed-off-by: Name <email>' line naming its author or committer, and a
# valid author (or committer) email address.
# 'Signed-off-by: Name <email>' line naming its author or its committer (name
# and email of the same one), and a valid author email address (the committer's
# if the author has none).

.[]
| select((.parents | length) < 2 and .author.type != "Bot")
| ([.commit.author.name, .commit.committer.name] | map(ascii_downcase)) as $names
| ([.commit.author.email, .commit.committer.email] | map(ascii_downcase)) as $emails
| ([.commit.author, .commit.committer]
| map(select(.email != null) | [.name // "", .email] | map(ascii_downcase)))
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
as $identities
| [.commit.message | split("\n")[]
| capture("^Signed-off-by: (?<name>.*) <(?<email>.*)>$"; "i")] as $signoffs
| capture("^Signed-off-by: (?<name>.*) <(?<email>.*)>$"; "i")
| [.name, .email] | map(ascii_downcase)] as $signoffs
| (.commit.author.email // .commit.committer.email) as $email
| if ($signoffs | length) == 0 then
"\(.sha[0:10]) the sign-off is missing"
elif ($email | test("^[^@ ]+@[^@ ]+[.][^@ ]+$") | not) then
elif (($email // "") | test("^[^@ ]+@[^@ ]+[.][^@ ]+$") | not) then
"\(.sha[0:10]) \($email) is not a valid email address"
elif any($signoffs[];
((.name | ascii_downcase) as $n | $names | index($n)) and
((.email | ascii_downcase) as $e | $emails | index($e))) then
elif any($signoffs[]; IN($identities[])) then
empty
else
"\(.sha[0:10]) no sign-off matches \(.commit.author.name) <\(.commit.author.email)>"
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/sanity-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,18 @@ jobs:
REPO: ${{ github.repository }}
PR: ${{ github.event.pull_request.number }}
run: |
failed=$(gh api --paginate "repos/${REPO}/pulls/${PR}/commits" |
jq -s 'add' | jq -r -f .github/ci-scripts/dco.jq)
# GitHub lists at most 250 commits of a pull request, more can't be
# checked (the count is read first, a push may add commits meanwhile)
expected=$(gh api "repos/${REPO}/pulls/${PR}" --jq '.commits')
commits=$(gh api --paginate "repos/${REPO}/pulls/${PR}/commits" |
jq -s 'add')
received=$(jq 'length' <<< "${commits}")
if [ "${received}" -lt "${expected}" ]; then
echo "::error::The DCO check got ${received} of the ${expected}" \
"commits of the pull request"
exit 1
fi
failed=$(jq -r -f .github/ci-scripts/dco.jq <<< "${commits}")
if [ -n "${failed}" ]; then
echo "::error::The DCO check failed"
echo "${failed}"
Expand Down
14 changes: 11 additions & 3 deletions .jenkins/lsu-perftests/backfill_history.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
# PERFTEST_BACKFILL_DIR the work directory of backfill.sh (default next to
# the workspace, kept between builds)
# PERFTEST_BACKFILL_MAX at most this many commits per build (default 6)
# PERFTEST_BACKFILL_QUEUE_TIMEOUT how long to wait for the history node,
# as HPX_SLURM_QUEUE_TIMEOUT (default 24h)
# PERFTEST_HISTORY_REPO the data repository (default hpx-performance)
# PERFTEST_HPX_REPO where master is fetched from (default TheHPXProject/hpx)
# PERFTEST_BACKFILL_DRY_RUN if set, only list the missing commits
Expand All @@ -42,13 +44,16 @@
set -u

source "$(dirname "$0")/report_common.sh"
source "$(dirname "$0")/../common/slurm.sh"

workspace="${WORKSPACE:?the Jenkins workspace}"
commit="${GIT_COMMIT:?the built commit}"
partition="${configuration_slurm_partition:?the Slurm partition}"
node="${configuration_slurm_nodelist:?the history node}"
history_repo="${PERFTEST_HISTORY_REPO:-https://github.com/TheHPXProject/hpx-performance.git}"
max_commits="${PERFTEST_BACKFILL_MAX:-6}"
queue_seconds=$(hpx_slurm_seconds "${PERFTEST_BACKFILL_QUEUE_TIMEOUT:-24h}") ||
exit 1
hpx_repo="${PERFTEST_HPX_REPO:-https://github.com/TheHPXProject/hpx.git}"
job_name="jenkins-hpx-master-perftests"
backfill_job_name="${job_name}-backfill"
Expand Down Expand Up @@ -177,12 +182,15 @@ git -C "${src}" fetch --quiet "${workspace}" "${commit}" || {

# The allocation of the history node, for the most commits a build adds:
# half an hour per commit and half an hour more (backfill.sh stops when less
# than 30 minutes are left). It waits for the node as the build did.
# than 30 minutes are left). It waits for the node as the build did, for at
# most the queue timeout (--time doesn't limit the wait, --immediate cancels
# the request once it is over).
minutes=$((30 * max_commits + 30))
perftest_log "Asking for ${node} for ${minutes} minutes"
perftest_log "Asking for ${node} for ${minutes} minutes, waiting up to" \
"$((queue_seconds / 60)) minutes for it"
alloc_log="${base}/salloc.log"
salloc --no-shell --exclusive --nodes=1 --partition="${partition}" \
--nodelist="${node}" --time="${minutes}" \
--nodelist="${node}" --time="${minutes}" --immediate="${queue_seconds}" \
--job-name="${backfill_job_name}" > "${alloc_log}" 2>&1
alloc_status=$?
job=$(grep -o 'Granted job allocation [0-9]*' "${alloc_log}" | grep -o '[0-9]*$')
Expand Down
3 changes: 2 additions & 1 deletion libs/core/contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ cmake -DHPX_WITH_CONTRACTS=ON -DHPX_WITH_CXX_STANDARD=26
cmake -DHPX_WITH_CONTRACTS=ON -DHPX_WITH_ASSERTS_AS_CONTRACT_ASSERTS=ON

# Select the evaluation mode used without native contracts
cmake -DHPX_WITH_CONTRACTS=ON -DHPX_WITH_CONTRACTS_MODE=ENFORCE|QUICK_ENFORCE|OBSERVE|IGNORE
# (ENFORCE, QUICK_ENFORCE, OBSERVE or IGNORE)
cmake -DHPX_WITH_CONTRACTS=ON -DHPX_WITH_CONTRACTS_MODE=OBSERVE

# Contracts disabled (HPX_CONTRACT_ASSERT works as HPX_ASSERT)
cmake -DHPX_WITH_CONTRACTS=OFF # default
Expand Down
5 changes: 3 additions & 2 deletions libs/core/contracts/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ Enable contract-enhanced assertions (optional, native contracts only)::

cmake -DHPX_WITH_CONTRACTS=ON -DHPX_CONTRACTS_WITH_ASSERTS_AS_CONTRACT_ASSERTS=ON

Select the evaluation mode used when native contracts are not available::
Select the evaluation mode used when native contracts are not available
(``ENFORCE``, ``QUICK_ENFORCE``, ``OBSERVE`` or ``IGNORE``)::

cmake -DHPX_WITH_CONTRACTS=ON -DHPX_WITH_CONTRACTS_MODE=ENFORCE|QUICK_ENFORCE|OBSERVE|IGNORE
cmake -DHPX_WITH_CONTRACTS=ON -DHPX_WITH_CONTRACTS_MODE=OBSERVE

Contract assertions work even when contracts are disabled::

Expand Down
5 changes: 2 additions & 3 deletions libs/core/contracts/include/hpx/contracts/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
/// Contracts are disabled by default (HPX_WITH_CONTRACTS=OFF).
/// Enable native contracts with:
/// `cmake -DHPX_WITH_CONTRACTS=ON -DHPX_WITH_CXX_STANDARD=26`
/// Set fallback mode with:
/// `cmake -DHPX_WITH_CONTRACTS=ON
/// -DHPX_WITH_CONTRACTS_MODE=ENFORCE|QUICK_ENFORCE|OBSERVE|IGNORE`
/// Set the fallback mode (ENFORCE, QUICK_ENFORCE, OBSERVE or IGNORE) with:
/// `cmake -DHPX_WITH_CONTRACTS=ON -DHPX_WITH_CONTRACTS_MODE=OBSERVE`

// Don't report missing #include for HPX_ASSERT macro
// hpxinspect:noinclude:HPX_ASSERT
Expand Down
9 changes: 6 additions & 3 deletions tools/perftests_ci/perftests_timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,14 @@ def plot(benchmark, series, commits, position, args, path):
left = ax.get_tightbbox(renderer).x0
center = ((left + graph.x1) / 2 - graph.x0) / graph.width
for ncol in (1,) if len(series) < 6 else (2, 1):
# the lines are passed, since a label that starts with '_' (after the
# prefix is cut) would otherwise be left out of the legend
legend = ax.legend(lines, [line.get_label() for line in lines],
# Matplotlib leaves a label that starts with '_' out of the legend
# (before 3.10 even if it is passed explicitly), so the legend is made
# with labels that don't, and their texts are set afterwards
legend = ax.legend(lines, [f" {line.get_label()}" for line in lines],
fontsize=7, loc='upper center', bbox_to_anchor=(center, -0.28),
ncol=ncol, frameon=False, title=title, title_fontsize=7)
for text, line in zip(legend.get_texts(), lines):
text.set_text(line.get_label())
if legend.get_window_extent(renderer).width <= graph.x1 - left:
break
fig.savefig(path, format='svg', bbox_inches='tight',
Expand Down
Loading