aliyun-ecs-phase4-cache #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: aliyun-ecs-phase4-cache | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - codex/aliyun-ecs-phase4-cache-20260624 | |
| workflow_dispatch: | |
| inputs: | |
| cache-save: | |
| description: "Save GitHub Actions cache after the run" | |
| type: boolean | |
| default: false | |
| concurrency: | |
| group: aliyun-ecs-phase4-cache-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: unit_test | |
| test_target: "//kv_cache_manager/..." | |
| test_args: "" | |
| - name: integration_test | |
| test_target: "//integration_test/..." | |
| test_args: "" | |
| - name: client_test | |
| test_target: "//kv_cache_manager/client/..." | |
| test_args: "--config=client" | |
| name: ${{ matrix.name }} | |
| runs-on: aliyun-ecs-phase4-cache | |
| timeout-minutes: 240 | |
| container: | |
| image: ghcr.io/alibaba/tair-kvcache-kvcm-dev:2026_02_13_12_03_24230b1 | |
| options: --privileged | |
| steps: | |
| - name: inspect environment | |
| run: | | |
| set -euxo pipefail | |
| id | |
| uname -a | |
| cat /etc/os-release || true | |
| nproc | |
| free -h | |
| df -h | |
| command -v bazelisk | |
| bazelisk version | |
| - uses: actions/checkout@v4 | |
| - uses: bazel-contrib/setup-bazel@0.18.0 | |
| with: | |
| bazelisk-cache: true | |
| disk-cache: Linux-test-opensrc-${{ matrix.name }} | |
| repository-cache: true | |
| cache-save: ${{ inputs.cache-save || false }} | |
| - name: setup coredump | |
| run: | | |
| set -euxo pipefail | |
| mkdir -p /tmp/corefile | |
| chmod 777 /tmp/corefile | |
| echo "/tmp/corefile/core.%e.%p.%s.%t" > /proc/sys/kernel/core_pattern | |
| cat /proc/sys/kernel/core_pattern | |
| - name: bazel test | |
| run: | | |
| set -euxo pipefail | |
| ulimit -c unlimited | |
| bazelisk test ${{ matrix.test_target }} ${{ matrix.test_args }} \ | |
| --cache_test_results=no \ | |
| --test_output=errors | |
| - name: disk report | |
| if: always() | |
| run: | | |
| set -euxo pipefail | |
| df -h | |
| du -sh . ~/.cache /tmp/corefile 2>/dev/null || true | |
| - name: detect crashes | |
| if: failure() | |
| run: | | |
| set +e | |
| set -x | |
| echo "=== dmesg crash signals ===" | |
| dmesg -T 2>/dev/null | grep -iE 'segfault|killed process|oom-killer|traps:' || echo "No crash signals found in dmesg" | |
| echo "" | |
| echo "=== Core dump files ===" | |
| core_count=$(find /tmp/corefile/ -type f 2>/dev/null | wc -l) | |
| echo "Found $core_count core dump file(s)" | |
| ls -lah /tmp/corefile/ 2>/dev/null || true | |
| if [ "$core_count" -gt 0 ]; then | |
| if ! command -v gdb >/dev/null 2>&1 || ! command -v file >/dev/null 2>&1; then | |
| echo "Installing gdb and file..." | |
| if command -v yum >/dev/null 2>&1; then | |
| yum install -y -q gdb file || true | |
| elif command -v apt-get >/dev/null 2>&1; then | |
| apt-get update -qq && apt-get install -y -qq gdb file || true | |
| fi | |
| fi | |
| fi | |
| for core in /tmp/corefile/core.*; do | |
| if [ -f "$core" ]; then | |
| echo "" | |
| echo "=== Core dump: $core ===" | |
| file_output=$(file "$core" || true) | |
| echo "$file_output" | |
| signal=$(basename "$core" | cut -d. -f4) | |
| exe_path=$(echo "$file_output" | sed -n "s/.*execfn: '\([^']*\)'.*/\1/p") | |
| if [ -n "$exe_path" ] && [ -f "$exe_path" ]; then | |
| echo "Executable: $exe_path, Signal: $signal" | |
| echo "--- Backtrace ---" | |
| gdb -batch -ex "thread apply all bt" "$exe_path" "$core" 2>/dev/null || true | |
| else | |
| echo "Signal: $signal, executable not found at: $exe_path" | |
| echo "--- Backtrace (core only) ---" | |
| gdb -batch -ex "thread apply all bt" -c "$core" 2>/dev/null || true | |
| fi | |
| fi | |
| done | |
| - name: create archive | |
| if: failure() | |
| run: | | |
| set +e | |
| set -x | |
| rm -f bazel-out.tar | |
| find bazel-out/*-opt/bin/ '(' -name 'kv_cache_manager.log' -o -name 'access.log' -o -name 'metrics.log' -o -name 'stdout' -o -name 'stderr' ')' -a -exec 'tar' '-r' '-f' 'bazel-out.tar' '{}' ';' 2>/dev/null | |
| for core in /tmp/corefile/core.*; do | |
| if [ -f "$core" ]; then | |
| tar -r -f bazel-out.tar "$core" 2>/dev/null | |
| exe_path=$(file "$core" 2>/dev/null | sed -n "s/.*execfn: '\([^']*\)'.*/\1/p") | |
| if [ -n "$exe_path" ] && [ -f "$exe_path" ]; then | |
| tar -r -h -f bazel-out.tar "$exe_path" 2>/dev/null | |
| fi | |
| fi | |
| done | |
| tar -r -f bazel-out.tar bazel-out/*-opt/testlogs/ 2>/dev/null | |
| if [ -f bazel-out.tar ]; then | |
| gzip -f bazel-out.tar | |
| fi | |
| - uses: actions/upload-artifact@v6 | |
| if: failure() | |
| with: | |
| name: ${{ matrix.name }}-bazel-out.tar.gz | |
| path: ./bazel-out.tar.gz | |
| overwrite: true |