Skip to content

Commit 65db4a4

Browse files
mayastor-borspchandra19
andcommitted
Merge #1867
1867: cherry-pick - chore(ci): inject github token post nix installation r=pchandra19 a=pchandra19 Co-authored-by: Prateek Chandra <[email protected]>
2 parents fd2e6ae + 19040e0 commit 65db4a4

File tree

3 files changed

+73
-9
lines changed

3 files changed

+73
-9
lines changed

.github/workflows/bdd.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,66 @@ env:
1010
jobs:
1111
bdd-tests:
1212
runs-on: ubuntu-latest-16-cores
13+
permissions:
14+
contents: read
15+
id-token: write
16+
1317
steps:
1418
- uses: actions/checkout@v4
1519
with:
1620
fetch-depth: 0
1721
submodules: 'recursive'
22+
1823
- uses: cachix/[email protected]
24+
with:
25+
github_access_token: ''
26+
27+
- name: Inject github token to nix config
28+
run: |
29+
cat <<EOF | sudo tee -a /etc/nix/nix.conf
30+
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
31+
trusted-users = root runner
32+
EOF
33+
34+
- name: Restart Nix daemon
35+
run: sudo systemctl restart nix-daemon
36+
37+
- uses: cachix/[email protected]
38+
1939
- name: Pre-populate nix-shell
2040
run: |
2141
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
2242
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
2343
nix-shell --run "echo" shell.nix
44+
2445
- name: Handle Rust dependencies caching
2546
uses: Swatinem/rust-cache@v2
47+
2648
- name: Build binaries
2749
run: nix-shell --run "cargo build --bins --features=io-engine-testing"
50+
2851
- name: Setup Test Pre-Requisites
2952
run: |
3053
sudo sysctl -w vm.nr_hugepages=2560
54+
sudo debconf-communicate <<< "set man-db/auto-update false" || true
55+
sudo dpkg-reconfigure man-db || true
56+
ulimit -c unlimited
3157
sudo apt-get update
3258
sudo apt-get install linux-modules-extra-$(uname -r)
3359
for module in nvme_tcp nbd nvme_rdma; do
3460
sudo modprobe $module
3561
done
3662
# for the coredump check
3763
sudo apt-get install gdb
64+
3865
- name: Setup VENV
3966
run: nix-shell --run "./test/python/setup.sh"
67+
4068
- name: Run BDD Tests
4169
run: |
4270
echo "TEST_START_DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV
4371
nix-shell --run "./scripts/pytest-tests.sh"
72+
4473
- name: Pytest BDD Report
4574
if: always()
4675
uses: pmeier/pytest-results-action@main
@@ -57,16 +86,19 @@ jobs:
5786
fi
5887
nix-shell --run "./scripts/ci-report.sh"
5988
if: failure()
89+
6090
- uses: actions/upload-artifact@v4
6191
if: failure()
6292
with:
6393
name: ci-report-bdd
6494
path: ./ci-report/ci-report.tar.gz
95+
96+
- name: Check Coredumps
97+
run: sudo ./scripts/check-coredumps.sh --since "${TEST_START_DATE}"
98+
6599
- name: Cleanup
66100
if: always()
67101
run: nix-shell --run "./scripts/pytest-tests.sh --clean-all-exit"
68-
- name: Check Coredumps
69-
run: sudo ./scripts/check-coredumps.sh --since "${TEST_START_DATE}"
70102
# debugging
71103
# - name: Setup tmate session
72104
# if: ${{ failure() }}

.github/workflows/unit-int.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,71 @@ env:
1010
jobs:
1111
int-tests:
1212
runs-on: ubuntu-latest-16-cores
13+
permissions:
14+
contents: read
15+
id-token: write
16+
1317
steps:
1418
- uses: actions/checkout@v4
1519
with:
1620
fetch-depth: 0
1721
submodules: 'recursive'
22+
23+
- uses: cachix/[email protected]
24+
with:
25+
github_access_token: ''
26+
27+
- name: Inject github token to nix config
28+
run: |
29+
cat <<EOF | sudo tee -a /etc/nix/nix.conf
30+
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
31+
trusted-users = root runner
32+
EOF
33+
34+
- name: Restart Nix daemon
35+
run: sudo systemctl restart nix-daemon
36+
1837
- uses: cachix/[email protected]
38+
1939
- name: Pre-populate nix-shell
2040
run: |
2141
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
2242
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
2343
nix-shell --run "echo" shell.nix
44+
2445
- name: Handle Rust dependencies caching
2546
uses: Swatinem/rust-cache@v2
2647
with:
2748
save-if: ${{ startsWith(github.ref_name, 'release/') || github.ref_name == 'develop' }}
49+
2850
- name: Build binaries
2951
run: nix-shell --run "cargo build --bins --features=io-engine-testing"
52+
3053
- name: Setup Test Pre-Requisites
3154
run: |
3255
sudo sysctl -w vm.nr_hugepages=3584
56+
sudo debconf-communicate <<< "set man-db/auto-update false" || true
57+
sudo dpkg-reconfigure man-db || true
58+
ulimit -c unlimited
3359
sudo apt-get update
3460
sudo apt-get install linux-modules-extra-$(uname -r)
3561
for module in nvme_tcp nbd nvme_rdma; do
3662
sudo modprobe $module
3763
done
3864
sudo apt-get install gdb
65+
3966
- name: Run Rust Tests
4067
run: |
4168
echo "TEST_START_DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV
4269
nix-shell --run "./scripts/cargo-test.sh"
70+
71+
- name: Check Coredumps
72+
run: sudo ./scripts/check-coredumps.sh --since "${TEST_START_DATE}"
73+
4374
- name: Cleanup
4475
if: always()
4576
run: nix-shell --run "./scripts/clean-cargo-tests.sh"
46-
- name: Check Coredumps
47-
run: sudo ./scripts/check-coredumps.sh --since "${TEST_START_DATE}"
77+
4878
- name: Run JS Grpc Tests
4979
run: |
5080
echo "TEST_START_DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV
@@ -55,6 +85,7 @@ jobs:
5585
cat $file >> "ci-report/js/$file"
5686
echo "</testsuites>" >> "ci-report/js/$file"
5787
done
88+
5889
- name: Test Report
5990
if: always()
6091
uses: pmeier/pytest-results-action@main
@@ -66,16 +97,19 @@ jobs:
6697
title: Test results
6798
- run: nix-shell --run "./scripts/ci-report.sh"
6899
if: failure()
100+
69101
- uses: actions/upload-artifact@v4
70102
if: failure()
71103
with:
72104
name: ci-report-int
73105
path: ./ci-report/ci-report.tar.gz
106+
107+
- name: Check Coredumps
108+
run: sudo ./scripts/check-coredumps.sh --since "${TEST_START_DATE}"
109+
74110
- name: Cleanup
75111
if: always()
76112
run: nix-shell --run "./scripts/clean-cargo-tests.sh"
77-
- name: Check Coredumps
78-
run: sudo ./scripts/check-coredumps.sh --since "${TEST_START_DATE}"
79113
# debugging
80114
# - name: Setup tmate session
81115
# if: ${{ failure() }}

scripts/ci-report.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ set -eu
1010
mkdir -p "$ROOT_DIR/ci-report"
1111
cd "$ROOT_DIR/ci-report"
1212

13-
# Disable until we find how some CI envs are being included
14-
# journalctl --since="$CI_REPORT_START_DATE" -o short-precise > journalctl.txt
13+
journalctl --since="$CI_REPORT_START_DATE" -o short-precise | sed -E 's/ghs_[^[:space:]]+/ghs_***/g' > journalctl.txt
1514
journalctl -k -b0 -o short-precise > dmesg.txt
1615
lsblk -tfa > lsblk.txt
1716
$SUDO nvme list -v > nvme.txt
1817
$SUDO nvme list-subsys -v >> nvme.txt
1918
cat /proc/meminfo > meminfo.txt
2019

2120
find . -type f \( -name "*.txt" -o -name "*.xml" \) -print0 | xargs -0 tar -czvf ci-report.tar.gz
22-

0 commit comments

Comments
 (0)