Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
52 changes: 52 additions & 0 deletions .github/actions/log-cpu/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Log CPU information
description: Log the current host's CPU and effective cgroup allocation

inputs:
label:
description: Heading and context for the CPU report
required: false
default: CPU information

outputs:
summary:
description: CPU model, effective vCPU count, and total RAM
value: ${{ steps.report.outputs.summary }}

runs:
using: composite
steps:
- id: report
shell: bash
env:
CPU_LABEL: ${{ inputs.label }}
run: |
set -euo pipefail
export LC_ALL=C

cpu_info=$(lscpu)
cpu_model=$(printf '%s\n' "$cpu_info" | awk -F ': *' '/^Model name:/ { print $2; exit }')
vcpus=$(nproc)
ram_kib=$(awk '/^MemTotal:/ { print $2; exit }' /proc/meminfo)
ram=$(awk -v kib="$ram_kib" 'BEGIN { printf "%.1f GiB", kib / 1048576 }')

echo "::group::$CPU_LABEL"
echo "Context: $CPU_LABEL"
echo "Runner: ${RUNNER_NAME:-unknown} (${RUNNER_OS:-unknown}/${RUNNER_ARCH:-unknown})"
echo "Kernel: $(uname -srvm)"
echo "nproc: $vcpus"
echo "RAM: $ram"
if [ -r /sys/fs/cgroup/cpu.max ]; then
echo "cgroup cpu.max: $(< /sys/fs/cgroup/cpu.max)"
fi
if [ -r /sys/fs/cgroup/cpuset.cpus.effective ]; then
echo "cgroup cpuset.cpus.effective: $(< /sys/fs/cgroup/cpuset.cpus.effective)"
fi
grep -m1 '^Cpus_allowed_list:' /proc/self/status || true
printf '%s\n' "$cpu_info"
flags=$({ grep -m1 -oE 'avx2|avx512[a-z0-9_]*' /proc/cpuinfo || true; } \
| sort -u | tr '\n' ' ')
echo "AVX flags: ${flags:-absent}"
echo "::endgroup::"

printf 'summary=CPU: `%s` · vCPUs: `%s` · RAM: `%s`\n' \
"${cpu_model:-unknown}" "$vcpus" "$ram" >> "$GITHUB_OUTPUT"
1 change: 1 addition & 0 deletions .github/merge-tests-fail-unit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
intentional failure
1 change: 1 addition & 0 deletions .github/workflows/lean_action_ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Test
name: Lean Action CI

on:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/namespace-cpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Namespace CPU information

on:
pull_request:

permissions:
contents: read

jobs:
log-cpu:
name: CPU ${{ matrix.shape }}
strategy:
fail-fast: false
matrix:
include:
- shape: 8x16
runner: nscloud-ubuntu-26.04-amd64-8x16
- shape: 16x32
runner: nscloud-ubuntu-26.04-amd64-16x32
- shape: 32x64
runner: nscloud-ubuntu-26.04-amd64-32x64
runs-on: ${{ matrix.runner }}
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/log-cpu
with:
label: Namespace Ubuntu 26.04 ${{ matrix.shape }}