Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 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
21 changes: 21 additions & 0 deletions .github/actions/package-delivery-pulp/deliver-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ PULP_LABELS=$(jq -cn \
# sending the next upload would pay the task-queue latency once per package
# instead of once per delivery.
TASK_HREFS=()
# TEMP(test-pulp-unstable): profile the first upload task (server must run
# image 3.114.0-3 with TASK_DIAGNOSTICS enabled)
DIAG_ARGS=(-H "X-TASK-DIAGNOSTICS: memory,pyinstrument")
for FILE in "${FILES[@]}"; do
# refresh from the parent shell: pulp_upload runs in a command substitution
# (subshell), so its internal refresh cannot update this shell's token — the
Expand All @@ -108,6 +111,7 @@ for FILE in "${FILES[@]}"; do
# the relative path of deb packages so the api is used directly
TASK_HREFS+=("$(
pulp_upload \
"${DIAG_ARGS[@]+"${DIAG_ARGS[@]}"}" \
-F "file=@\"$FILE\"" \
-F "relative_path=$POOL_PATH/$FILE" \
-F "distribution=$SUITE" \
Expand All @@ -116,6 +120,7 @@ for FILE in "${FILES[@]}"; do
-F "pulp_labels=$PULP_LABELS" \
"$PULP_URL/api/v3/content/deb/packages/"
)")
DIAG_ARGS=()

# record the uploaded package in the manifest for the verification step
name=$(dpkg-deb -f "$FILE" Package)
Expand All @@ -132,6 +137,22 @@ done
echo "[INFO] Waiting for ${#TASK_HREFS[@]} upload task(s) to complete"
wait_tasks "${TASK_HREFS[@]}"

# TEMP(test-pulp-unstable): stash the profile artifacts of the first task
# for the workflow artifact upload
PROFILED_TASK="${TASK_HREFS[0]}"
PROFILE_TAG="${DISTRIB:-unknown}-deb"
PROFILE_DIR="${GITHUB_WORKSPACE:-$PWD}/pulp-task-profile"
mkdir -p "$PROFILE_DIR"
echo "[INFO] Profiled task: $PROFILED_TASK"
refresh_pulp_token
pulp task profile-artifact-urls --href "$PROFILED_TASK" > "$PROFILE_DIR/urls-$PROFILE_TAG.json" 2>/dev/null || echo "[WARN] no profile artifacts (server not rolled out yet?)"
cat "$PROFILE_DIR/urls-$PROFILE_TAG.json" 2>/dev/null || true
i=0
for url in $(jq -r '.. | strings | select(startswith("http"))' "$PROFILE_DIR/urls-$PROFILE_TAG.json" 2>/dev/null); do
curl -fsSL "$url" -o "$PROFILE_DIR/profile-$PROFILE_TAG-$i.out" || true
i=$((i + 1))
done

echo "[INFO] Publishing repository $REPOSITORY_NAME"
pulp deb publication create --repository "$REPOSITORY_NAME" --structured >/dev/null

Expand Down
21 changes: 21 additions & 0 deletions .github/actions/package-delivery-pulp/deliver-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ for ARCH in noarch x86_64; do
# the next upload would pay the task-queue latency once per package instead
# of once per delivery.
TASK_HREFS=()
# TEMP(test-pulp-unstable): profile the first upload task (server must run
# image 3.114.0-3 with TASK_DIAGNOSTICS enabled)
DIAG_ARGS=(-H "X-TASK-DIAGNOSTICS: memory,pyinstrument")
for FILE in "${ARCH_FILES[@]}"; do
# refresh from the parent shell: pulp_upload runs in a command substitution
# (subshell), so its internal refresh cannot update this shell's token —
Expand All @@ -115,11 +118,13 @@ for ARCH in noarch x86_64; do
echo "[INFO] Uploading $(basename "$FILE") to $REPOSITORY_NAME (module $MODULE_NAME)"
TASK_HREFS+=("$(
pulp_upload \
"${DIAG_ARGS[@]+"${DIAG_ARGS[@]}"}" \
-F "file=@\"$FILE\"" \
-F "repository=$REPOSITORY_HREF" \
-F "pulp_labels=$PULP_LABELS" \
"$PULP_URL/api/v3/content/rpm/packages/"
)")
DIAG_ARGS=()

# record the uploaded package in the manifest (name-version-release parsed
# the same way as assert_not_in_stable) for the verification step
Expand All @@ -141,6 +146,22 @@ for ARCH in noarch x86_64; do
echo "[INFO] Waiting for ${#TASK_HREFS[@]} upload task(s) to complete"
wait_tasks "${TASK_HREFS[@]}"

# TEMP(test-pulp-unstable): stash the profile artifacts of the first task
# for the workflow artifact upload
PROFILED_TASK="${TASK_HREFS[0]}"
PROFILE_TAG="${DISTRIB:-unknown}-$ARCH"
PROFILE_DIR="${GITHUB_WORKSPACE:-$PWD}/pulp-task-profile"
mkdir -p "$PROFILE_DIR"
echo "[INFO] Profiled task: $PROFILED_TASK"
refresh_pulp_token
pulp task profile-artifact-urls --href "$PROFILED_TASK" > "$PROFILE_DIR/urls-$PROFILE_TAG.json" 2>/dev/null || echo "[WARN] no profile artifacts (server not rolled out yet?)"
cat "$PROFILE_DIR/urls-$PROFILE_TAG.json" 2>/dev/null || true
i=0
for url in $(jq -r '.. | strings | select(startswith("http"))' "$PROFILE_DIR/urls-$PROFILE_TAG.json" 2>/dev/null); do
curl -fsSL "$url" -o "$PROFILE_DIR/profile-$PROFILE_TAG-$i.out" || true
i=$((i + 1))
done

echo "[INFO] Publishing repository $REPOSITORY_NAME"
pulp rpm publication create --repository "$REPOSITORY_NAME" >/dev/null

Expand Down
1 change: 1 addition & 0 deletions .github/packaging/centreon-plugin.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@ rpm:
signature:
key_file: ${RPM_SIGNING_KEY_FILE}
key_id: ${RPM_SIGNING_KEY_ID}
# TEMP(test-pulp-unstable): touch the common template so every plugin is packaged for the Pulp delivery load test; revert before merge
4 changes: 3 additions & 1 deletion .github/scripts/list-plugins-to-build-and-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ def get_pack_from_path(path):
if common:
cmd = ["find", "packaging", "-type", "f", "-name", "pkg.json"]
res = subprocess.run(cmd, capture_output=True, text=True, check=False)
for filepath in res.stdout.strip().split('\n'):
# TEMP(test-pulp-unstable): cap the delivery to 50 plugins for the
# task-diagnostics test run
for filepath in sorted(res.stdout.strip().split('\n'))[:50]:
add_package_info(filepath)
else:
with open('packages_directories.json') as packages_directories_file:
Expand Down
82 changes: 26 additions & 56 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,8 @@ jobs:

unit-tests:
needs: [get-environment, get-plugins]
if: |
needs.get-environment.outputs.skip_workflow == 'false' &&
needs.get-environment.outputs.stability != 'stable' &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
# TEMP(test-pulp-unstable): skip the test jobs, this PR only validates the Pulp delivery
if: false
strategy:
fail-fast: false
max-parallel: 3
Expand Down Expand Up @@ -294,30 +290,14 @@ jobs:
max-parallel: 5
matrix:
include:
- package_extension: rpm
image: packaging:alma8
distrib: el8
- package_extension: rpm
image: packaging:alma9
distrib: el9
# TEMP(test-pulp-unstable): restrict the load test to one rpm and one
# deb distrib (el10 + trixie)
- package_extension: rpm
image: packaging:alma10
distrib: el10
- package_extension: deb
image: packaging:bullseye
distrib: bullseye
- package_extension: deb
image: packaging:bookworm
distrib: bookworm
- package_extension: deb
image: packaging:trixie
distrib: trixie
- package_extension: deb
image: packaging:jammy
distrib: jammy
- package_extension: deb
image: packaging:noble
distrib: noble

container:
image: ghcr.io/${{ github.repository }}/${{ matrix.image }}
Expand Down Expand Up @@ -363,15 +343,8 @@ jobs:

test-plugins:
needs: [get-environment, get-plugins, package]
if: |
always() &&
needs.get-environment.outputs.skip_workflow == 'false' &&
needs.get-plugins.outputs.test_plugins == 'True' &&
needs.get-environment.outputs.stability != 'stable' &&
(needs.package.result == 'success' || needs.package.result == 'skipped') &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
# TEMP(test-pulp-unstable): skip the test jobs, this PR only validates the Pulp delivery
if: false
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -434,13 +407,8 @@ jobs:

deliver-packages:
needs: [get-environment, get-plugins, test-plugins]
if: |
needs.get-environment.outputs.skip_workflow == 'false' &&
needs.get-plugins.outputs.package_plugins == 'True' &&
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || (needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
# TEMP(test-pulp-unstable): Pulp-only test, Artifactory delivery disabled
if: false
runs-on: ubuntu-24.04
strategy:
fail-fast: false
Expand Down Expand Up @@ -479,11 +447,12 @@ jobs:
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}

deliver-packages-pulp:
needs: [get-environment, get-plugins, test-plugins]
# TEMP(test-pulp-unstable): decouple from test-plugins so the Pulp delivery
# runs regardless of the PR stability (canary)
needs: [get-environment, get-plugins, package]
if: |
needs.get-environment.outputs.skip_workflow == 'false' &&
needs.get-plugins.outputs.package_plugins == 'True' &&
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || (needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
Expand All @@ -497,22 +466,12 @@ jobs:
fail-fast: false
matrix:
include:
- distrib: el8
package_extension: rpm
- distrib: el9
package_extension: rpm
# TEMP(test-pulp-unstable): restrict the load test to one rpm and
# one deb distrib (el10 + trixie)
- distrib: el10
package_extension: rpm
- distrib: bullseye
package_extension: deb
- distrib: bookworm
package_extension: deb
- distrib: trixie
package_extension: deb
- distrib: jammy
package_extension: deb
- distrib: noble
package_extension: deb

name: deliver ${{ matrix.distrib }} on pulp
steps:
Expand Down Expand Up @@ -566,7 +525,7 @@ jobs:
core.setOutput('release_type', releaseType);

- name: Deliver packages on Pulp
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
# TEMP(test-pulp-unstable): run on the PR (canary) stability too
id: deliver_pulp
continue-on-error: true
uses: ./.github/actions/package-delivery-pulp
Expand All @@ -576,7 +535,7 @@ jobs:
distrib: ${{ matrix.distrib }}
version: ""
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
stability: unstable # TEMP(test-pulp-unstable): force unstable Pulp delivery
release_type: ${{ needs.get-environment.outputs.release_type }}
is_cloud: "false"
pulp_url: ${{ vars.PULP_API_URL }}
Expand Down Expand Up @@ -606,6 +565,17 @@ jobs:
run: |
echo "::warning::Pulp delivery/promotion failed (non-blocking during the Artifactory-to-Pulp migration; Artifactory delivery remains authoritative). See the 'Deliver packages on Pulp' / 'Promote packages on Pulp' step."

# TEMP(test-pulp-unstable): collect the pyinstrument/memory profile of
# the first upload task (X-TASK-DIAGNOSTICS)
- name: Upload the task profile
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: pulp-task-profile-${{ matrix.distrib }}
path: pulp-task-profile/
if-no-files-found: ignore
retention-days: 1

deliver-sources:
needs: [get-environment, fatpacker]
if: |
Expand Down
Loading