Add config changes section to PR #31
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: CLK Rebase | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - clk-rebase-ga | |
| jobs: | |
| clk-rebase: | |
| runs-on: kernel-build | |
| container: | |
| image: rockylinux:9.2 | |
| options: --cpus 8 --privileged | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Perform CLK Rebase | |
| run: | | |
| CLK_BRANCH=ciq-6.12.y | |
| CLK_NEXT_BRANCH=ciq-6.12.y-next | |
| TMP_CLK_NEXT_BRANCH={automation_tmp}_ciq-6.12.y-next | |
| STABLE_TRACKING_BRANCH=stable_6.12.y | |
| dnf install epel-release -y | |
| dnf install grubby grub2-tools qemu-kvm sudo virtme-ng -y | |
| # so root can call sudo without complaint | |
| echo "root ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers | |
| dnf groupinstall 'Development Tools' -y | |
| dnf install --enablerepo=crb bc dwarves iproute kernel-devel openssl-devel elfutils-libelf-devel -y | |
| # Install GitHub CLI | |
| dnf install 'dnf-command(config-manager)' -y | |
| dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo | |
| dnf install gh -y | |
| WORKDIR=clk-rebase-$(date '+%Y_%m_%d__%H_%M_%S') | |
| mkdir $WORKDIR | |
| pushd $WORKDIR | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "Brett Mastbergen" | |
| git clone https://oauth2:[email protected]/ctrliq/kernel-src-tree-tools | |
| # HACK HACK HACK | |
| git -C kernel-src-tree-tools checkout normalize-rustc-during-lt_rebase | |
| git clone https://oauth2:[email protected]/ctrliq/kernel-src-tree | |
| pushd kernel-src-tree | |
| git checkout $STABLE_TRACKING_BRANCH | |
| git checkout $CLK_BRANCH | |
| ../kernel-src-tree-tools/lt_rebase.sh | |
| #vng -b --config ciq/configs/kernel-x86_64.config --verbose | tee ../build.log | |
| # need some config tweaks for vng | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VSOCKETS | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VIRTIO_VSOCKETS | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VIRTIO_VSOCKETS_COMMON | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VSOCKETS | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_NET_9P | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_NET_9P_FD | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_NET_9P_VIRTIO | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_FAILOVER | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_BLK_SD_DEV | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_SCSI_VIRTIO | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VIRTIO_NET | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_NET_FAILOVER | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VIRTIO_CONSOLE | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_I6300ESB_WDT | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VIRTIO_BALLOON | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VIRTIO_MMIO | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_FUSE_FS | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VIRTIO_FS | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_OVERLAY_FS | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_NETFS_SUPPORT | |
| ./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_9P_FS | |
| ../kernel-src-tree-tools/kernel_build.sh --skip-kabi --no-reboot | tee ../build.log | |
| # HACK HACK HACK | |
| #sed -i 's/sudo//g' ../kernel-src-tree-tools/kernel_kselftest.sh | |
| dnf install curl --allowerasing -y | |
| # should be installed in kernel_kselftest.sh | |
| dnf install conntrack-tools e2fsprogs ethtool iptables iputils ipvsadm kernel-tools nftables teamd traceroute -y | |
| #vng --qemu /usr/libexec/qemu-kvm --force-initramfs --disable-microvm --rw --network user --verbose --memory 16G -- ../kernel-src-tree-tools/kernel_kselftest.sh | |
| # HACK HACK HACK | |
| vng --qemu /usr/libexec/qemu-kvm --force-initramfs --disable-microvm --rw --network user --verbose --memory 16G -- sh -c 'mkdir ../kselftest-logs ; echo ok foo:bar > ../kselftest-logs/selftest-$(uname -r).log' | |
| #mkdir ../kselftest-logs | |
| #echo ok foo:bar > ../kselftest-logs/selftest-6.12.XX.log | |
| echo "Selftests passed:" | |
| OK_TESTS=$(grep -a ^ok ../kselftest-logs/selftest* | wc -l) | |
| echo $OK_TESTS | |
| # Extract the stable version we rebased onto | |
| STABLE_VERSION=$(git log -1 --format=%s $STABLE_TRACKING_BRANCH | grep -oP 'Linux \K[0-9]+\.[0-9]+\.[0-9]+' || echo "unknown") | |
| echo "Rebased to stable version: $STABLE_VERSION" | |
| # Push the branches | |
| git push origin $CLK_NEXT_BRANCH | |
| git push origin $TMP_CLK_NEXT_BRANCH | |
| # Check for config changes | |
| # Look for a commit at HEAD with message like "[CIQ] v6.12.29 - rebased configs" | |
| # that matches the stable version we're rebasing onto | |
| HEAD_COMMIT_MSG=$(git log -1 --format=%s HEAD) | |
| if echo "$HEAD_COMMIT_MSG" | grep -qF "[CIQ] v${STABLE_VERSION} - rebased configs"; then | |
| echo "Config change commit detected for v${STABLE_VERSION}" | |
| # Extract the config changes from the commit | |
| git show HEAD --stat > ../config_changes.txt | |
| else | |
| echo "No config change commit detected for v${STABLE_VERSION}" | |
| echo "None" > ../config_changes.txt | |
| fi | |
| # Save data for PR creation | |
| echo "$STABLE_VERSION" > ../stable_version.txt | |
| echo "$OK_TESTS" > ../ok_tests.txt | |
| popd | |
| popd | |
| - name: Upload selftest logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kselftest-logs | |
| path: clk-rebase-*/kselftest-logs/selftest* | |
| if-no-files-found: warn | |
| - name: Upload build log | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-log | |
| path: clk-rebase-*/build.log | |
| if-no-files-found: warn | |
| - name: Create Pull Request | |
| if: success() | |
| run: | | |
| WORKDIR=$(ls -d clk-rebase-* | head -1) | |
| cd $WORKDIR/kernel-src-tree | |
| STABLE_VERSION=$(cat ../stable_version.txt) | |
| OK_TESTS=$(cat ../ok_tests.txt) | |
| CONFIG_CHANGES=$(cat ../config_changes.txt) | |
| # Extract abbreviated build log (first 20 and last 20 lines) | |
| #BUILD_LOG_SUMMARY=$(head -20 ../build.log && echo "" && echo "[snip]" && echo "" && tail -20 ../build.log) | |
| BUILD_LOG_SUMMARY=$(egrep -B 5 -A 5 "\[TIMER\]|^Starting Build" ../build.log) | |
| # Get artifact URLs (will be available after workflow completes) | |
| RUN_ID="${{ github.run_id }}" | |
| REPO="${{ github.repository }}" | |
| SELFTEST_ARTIFACT_URL="https://github.com/${REPO}/actions/runs/${RUN_ID}" | |
| BUILD_LOG_ARTIFACT_URL="https://github.com/${REPO}/actions/runs/${RUN_ID}" | |
| # Create PR body | |
| cat > /tmp/pr_body.md <<EOF | |
| ## Automated Rebase to v${STABLE_VERSION} | |
| ### Config Changes | |
| \`\`\` | |
| ${CONFIG_CHANGES} | |
| \`\`\` | |
| ### Build Log | |
| \`\`\` | |
| ${BUILD_LOG_SUMMARY} | |
| \`\`\` | |
| ### Testing | |
| Selftests passed: **${OK_TESTS}** tests | |
| ### Artifacts | |
| - [Build Log](${BUILD_LOG_ARTIFACT_URL}) | |
| - [Selftest Logs](${SELFTEST_ARTIFACT_URL}) | |
| EOF | |
| # Create the PR | |
| gh pr create \ | |
| --title "TESTING TESTING TESTING [CIQ 6.12] Rebase to v${STABLE_VERSION}" \ | |
| --body-file /tmp/pr_body.md \ | |
| --base ciq-6.12.y-next \ | |
| --head {automation_tmp}_ciq-6.12.y-next | |