Skip to content

Commit f21840b

Browse files
CI: trigger image builds on push to main, derive version from repo DEBs
- add a push trigger scoped to the three service directories and this workflow file, so Dockerfile/entrypoint changes rebuild images without a manual dispatch - when no override is given, pick the newest version that actually has DEBs committed in slurm-debs/ instead of querying SchedMD tags: the repo can only build what it has DEBs for, and a brand-new upstream tag without DEBs no longer silently skips the build Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 424108a commit f21840b

1 file changed

Lines changed: 22 additions & 11 deletions

File tree

.github/workflows/build-push-workflow.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ on:
77
description: 'Optional: Specific Slurm version to build (e.g., 24-11-5-1). Leave empty to use latest.'
88
required: false
99
default: ''
10+
# Rebuild automatically when image sources change on main
11+
push:
12+
branches:
13+
- main
14+
paths:
15+
- 'slurmctld/**'
16+
- 'slurmdbd/**'
17+
- 'slurmrestd/**'
18+
- '.github/workflows/build-push-workflow.yml'
1019
pull_request:
1120
branches:
1221
- main
@@ -37,24 +46,26 @@ jobs:
3746
echo "✅ Using manual dispatch version override: ${{ github.event.inputs.SLURM_VERSION_OVERRIDE }}"
3847
VERSION="${{ github.event.inputs.SLURM_VERSION_OVERRIDE }}"
3948
else
40-
echo "🔍 No version override set. Detecting latest stable version..."
41-
42-
# Fetch all tags from the SchedMD/slurm repo
43-
TAGS=$(curl -s https://api.github.com/repos/SchedMD/slurm/tags | jq -r '.[].name')
49+
echo "🔍 No version override set. Using newest version present in slurm-debs/..."
4450
45-
# Filter for stable release tags (e.g., slurm-23-11-7-1) and get the latest
46-
LATEST_TAG=$(echo "$TAGS" \
47-
| grep -E '^slurm-[0-9]+-[0-9]+-[0-9]+-[0-9]+$' \
51+
# Derive the version from the DEBs committed in this repo rather
52+
# than querying SchedMD tags: the repo can only ever build what it
53+
# has DEBs for, and this keeps push-triggered rebuilds
54+
# deterministic (a brand-new upstream tag without DEBs would
55+
# otherwise skip the build).
56+
LATEST_DEB=$(find slurm-debs -maxdepth 1 -name 'slurm-smd_*_amd64.deb' \
57+
| sed -E 's/.*slurm-smd_([0-9]+\.[0-9]+\.[0-9]+-[0-9]+)_amd64\.deb/\1/' \
4858
| sort -V \
4959
| tail -n1)
5060
51-
if [ -z "$LATEST_TAG" ]; then
52-
echo "❌ Could not determine the latest Slurm tag."
61+
if [ -z "$LATEST_DEB" ]; then
62+
echo "❌ Could not find any slurm-smd DEBs in slurm-debs/."
5363
exit 1
5464
fi
5565
56-
VERSION="${LATEST_TAG#slurm-}"
57-
echo "🔬 Detected latest version: $VERSION"
66+
# Convert deb version format to tag format (26.05.3-1 -> 26-05-3-1)
67+
VERSION=$(echo "$LATEST_DEB" | tr '.-' '--')
68+
echo "🔬 Newest DEB version present: $LATEST_DEB (tag format: $VERSION)"
5869
fi
5970
6071
# Convert version format for deb file matching (e.g., 24-11-5-1 -> 24.11.5-1)

0 commit comments

Comments
 (0)