mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-29 16:37:07 +00:00
ci(pool-test): fix scheduled runs and env source (#6702)
ci(pool-test): fix scheduled runs and read env from secrets or vars workflow_dispatch inputs are empty for schedule events, so the scheduled pool test built a broken package URL (--version "") and failed preflight. Fall back to the latest nightly deb (R2) when no version/package_url input is given, default the thresholds/duration/pools, and default cleanup to enabled. Also read RUSTFS_API_ENDPOINT / RUSTFS_NODES / RUSTFS_SSH_USER from secrets first (variables as fallback) so either configuration works.
This commit is contained in:
@@ -58,9 +58,12 @@ defaults:
|
|||||||
env:
|
env:
|
||||||
RUSTFS_ACCESS_KEY: ${{ secrets.RUSTFS_ACCESS_KEY }}
|
RUSTFS_ACCESS_KEY: ${{ secrets.RUSTFS_ACCESS_KEY }}
|
||||||
RUSTFS_SECRET_KEY: ${{ secrets.RUSTFS_SECRET_KEY }}
|
RUSTFS_SECRET_KEY: ${{ secrets.RUSTFS_SECRET_KEY }}
|
||||||
RUSTFS_API_ENDPOINT: ${{ vars.RUSTFS_API_ENDPOINT || vars.RUSTFS_RC_ENDPOINT }}
|
RUSTFS_API_ENDPOINT: ${{ secrets.RUSTFS_API_ENDPOINT || vars.RUSTFS_API_ENDPOINT || vars.RUSTFS_RC_ENDPOINT }}
|
||||||
RUSTFS_NODES: ${{ vars.RUSTFS_NODES }}
|
RUSTFS_NODES: ${{ secrets.RUSTFS_NODES || vars.RUSTFS_NODES }}
|
||||||
RUSTFS_SSH_USER: ${{ vars.RUSTFS_SSH_USER }}
|
RUSTFS_SSH_USER: ${{ secrets.RUSTFS_SSH_USER || vars.RUSTFS_SSH_USER }}
|
||||||
|
# Package used by the scheduled run (workflow_dispatch inputs are empty for
|
||||||
|
# schedule events), i.e. the latest nightly deb published by nightly-gnu.yml.
|
||||||
|
RUSTFS_NIGHTLY_PACKAGE_URL: ${{ vars.RUSTFS_NIGHTLY_PACKAGE_URL || 'https://dl.rustfs.com/artifacts/rustfs/packages/nightly/rustfs-nightly-latest.deb' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pool-expansion-test:
|
pool-expansion-test:
|
||||||
@@ -81,7 +84,7 @@ jobs:
|
|||||||
df -h /data | tail -1
|
df -h /data | tail -1
|
||||||
|
|
||||||
- name: Reset test environment (before)
|
- name: Reset test environment (before)
|
||||||
if: ${{ inputs.cleanup_before }}
|
if: ${{ inputs.cleanup_before != 'false' }}
|
||||||
run: |
|
run: |
|
||||||
chmod +x scripts/test/rustfs_pool_expand.sh
|
chmod +x scripts/test/rustfs_pool_expand.sh
|
||||||
./scripts/test/rustfs_pool_expand.sh --reset -y
|
./scripts/test/rustfs_pool_expand.sh --reset -y
|
||||||
@@ -91,8 +94,10 @@ jobs:
|
|||||||
ARGS=(--preflight --endpoint "${{ env.RUSTFS_API_ENDPOINT }}")
|
ARGS=(--preflight --endpoint "${{ env.RUSTFS_API_ENDPOINT }}")
|
||||||
if [ -n "${{ inputs.package_url }}" ]; then
|
if [ -n "${{ inputs.package_url }}" ]; then
|
||||||
ARGS+=(--package-url "${{ inputs.package_url }}")
|
ARGS+=(--package-url "${{ inputs.package_url }}")
|
||||||
else
|
elif [ -n "${{ inputs.rustfs_version }}" ]; then
|
||||||
ARGS+=(--version "${{ inputs.rustfs_version }}")
|
ARGS+=(--version "${{ inputs.rustfs_version }}")
|
||||||
|
else
|
||||||
|
ARGS+=(--package-url "${{ env.RUSTFS_NIGHTLY_PACKAGE_URL }}")
|
||||||
fi
|
fi
|
||||||
./scripts/test/rustfs_pool_expand.sh "${ARGS[@]}"
|
./scripts/test/rustfs_pool_expand.sh "${ARGS[@]}"
|
||||||
|
|
||||||
@@ -101,21 +106,23 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
STEPS="1,2,3,4,5,6"
|
STEPS="1,2,3,4,5,6"
|
||||||
if [ "${{ inputs.pools }}" = "3" ]; then
|
if [ "${{ inputs.pools || '3' }}" = "3" ]; then
|
||||||
STEPS="$STEPS,7,8"
|
STEPS="$STEPS,7,8"
|
||||||
if [ "${{ inputs.run_decommission }}" = "true" ]; then
|
if [ "${{ inputs.run_decommission != 'false' }}" = "true" ]; then
|
||||||
STEPS="$STEPS,9"
|
STEPS="$STEPS,9"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
ARGS=(--steps "$STEPS" --with-warp -y \
|
ARGS=(--steps "$STEPS" --with-warp -y \
|
||||||
--endpoint "${{ env.RUSTFS_API_ENDPOINT }}" \
|
--endpoint "${{ env.RUSTFS_API_ENDPOINT }}" \
|
||||||
--storage-threshold "${{ inputs.storage_threshold }}" \
|
--storage-threshold "${{ inputs.storage_threshold || '50' }}" \
|
||||||
--warp-duration "${{ inputs.warp_duration }}" \
|
--warp-duration "${{ inputs.warp_duration || '10m' }}" \
|
||||||
--log-file /tmp/rustfs-pool-test.log)
|
--log-file /tmp/rustfs-pool-test.log)
|
||||||
if [ -n "${{ inputs.package_url }}" ]; then
|
if [ -n "${{ inputs.package_url }}" ]; then
|
||||||
ARGS+=(--package-url "${{ inputs.package_url }}")
|
ARGS+=(--package-url "${{ inputs.package_url }}")
|
||||||
else
|
elif [ -n "${{ inputs.rustfs_version }}" ]; then
|
||||||
ARGS+=(--version "${{ inputs.rustfs_version }}")
|
ARGS+=(--version "${{ inputs.rustfs_version }}")
|
||||||
|
else
|
||||||
|
ARGS+=(--package-url "${{ env.RUSTFS_NIGHTLY_PACKAGE_URL }}")
|
||||||
fi
|
fi
|
||||||
./scripts/test/rustfs_pool_expand.sh "${ARGS[@]}"
|
./scripts/test/rustfs_pool_expand.sh "${ARGS[@]}"
|
||||||
|
|
||||||
@@ -130,7 +137,7 @@ jobs:
|
|||||||
if-no-files-found: warn
|
if-no-files-found: warn
|
||||||
|
|
||||||
- name: Reset test environment (after)
|
- name: Reset test environment (after)
|
||||||
if: ${{ always() && inputs.cleanup_after }}
|
if: ${{ always() && inputs.cleanup_after != 'false' }}
|
||||||
run: |
|
run: |
|
||||||
./scripts/test/rustfs_pool_expand.sh --reset -y
|
./scripts/test/rustfs_pool_expand.sh --reset -y
|
||||||
|
|
||||||
@@ -138,5 +145,5 @@ jobs:
|
|||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
echo "RustFS pool expansion test failed"
|
echo "RustFS pool expansion test failed"
|
||||||
echo "Package source: ${{ inputs.package_url || format('release {0}', inputs.rustfs_version) }}"
|
echo "Package source: ${{ inputs.package_url || inputs.rustfs_version || 'nightly (R2 latest)' }}"
|
||||||
echo "See the uploaded log artifact for details."
|
echo "See the uploaded log artifact for details."
|
||||||
|
|||||||
Reference in New Issue
Block a user