From fa97619f8864cf6cd5d0413fc85826390f5fa439 Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Sun, 2 Mar 2025 13:46:53 -0500 Subject: [PATCH 01/13] Replace most mentions of Ubuntu 20.04 with 22.04 Signed-off-by: Andy Fingerhut --- .github/workflows/ci-lint.yaml | 4 +- .github/workflows/ci-ptf-kernels-weekly.yml | 4 +- .github/workflows/ci-ptf.yml | 6 +-- .github/workflows/ci-static-build-test.yml | 6 +-- .github/workflows/ci-test-debian.yml | 12 ++--- .../ci-ubuntu-22-sanitizer-nightly.yml | 44 +++++++++++++++++++ .github/workflows/ci-validation-nightly.yml | 4 +- README.md | 6 +-- tools/ci-ptf/build_vm.sh | 4 +- tools/ci-ptf/run_test.sh | 2 +- 10 files changed, 68 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/ci-ubuntu-22-sanitizer-nightly.yml diff --git a/.github/workflows/ci-lint.yaml b/.github/workflows/ci-lint.yaml index c938f577185..be78dbb2498 100644 --- a/.github/workflows/ci-lint.yaml +++ b/.github/workflows/ci-lint.yaml @@ -10,7 +10,7 @@ on: jobs: p4c-lint: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: IMAGE_TYPE: test CMAKE_ONLY: ON @@ -30,7 +30,7 @@ jobs: key: apply-linters-${{ runner.os }} max-size: 1000M - - name: Build (Ubuntu 20.04) + - name: Build (Ubuntu 22.04) run: | tools/ci-build.sh diff --git a/.github/workflows/ci-ptf-kernels-weekly.yml b/.github/workflows/ci-ptf-kernels-weekly.yml index 9073f755a7c..400fb146c8c 100644 --- a/.github/workflows/ci-ptf-kernels-weekly.yml +++ b/.github/workflows/ci-ptf-kernels-weekly.yml @@ -57,7 +57,7 @@ jobs: if: ${{ github.repository == 'p4lang/p4c' && github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest env: - OS_TYPE: ubuntu-20.04 + OS_TYPE: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -93,7 +93,7 @@ jobs: - kernels: 5.15 kernel_version: 5.15.0-69 env: - OS_TYPE: ubuntu-20.04 + OS_TYPE: ubuntu-22.04 KERNEL_VERSION: ${{ matrix.kernel_version }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/ci-ptf.yml b/.github/workflows/ci-ptf.yml index 3304f705ae4..d91eb953441 100644 --- a/.github/workflows/ci-ptf.yml +++ b/.github/workflows/ci-ptf.yml @@ -30,7 +30,7 @@ concurrency: jobs: ptf-linux: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: CTEST_PARALLEL_LEVEL: 4 IMAGE_TYPE: test @@ -48,10 +48,10 @@ jobs: key: test-ptf-${{ runner.os }} max-size: 1000M - - name: Build (Ubuntu 20.04) + - name: Build (Ubuntu 22.04) run: | tools/ci-build.sh - - name: Run PTF tests for eBPF backend (Ubuntu 20.04) + - name: Run PTF tests for eBPF backend (Ubuntu 22.04) run: sudo -E ./test.sh working-directory: ./backends/ebpf/tests diff --git a/.github/workflows/ci-static-build-test.yml b/.github/workflows/ci-static-build-test.yml index 230a11d9cbf..9fed61147c7 100644 --- a/.github/workflows/ci-static-build-test.yml +++ b/.github/workflows/ci-static-build-test.yml @@ -15,7 +15,7 @@ concurrency: cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: - # Build a p4c release on Ubuntu 20.04. + # Build a p4c release on Ubuntu 22.04. build-linux: # Only run on pull requests with the "run-static" label. if: ${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'run-static') }} @@ -26,7 +26,7 @@ jobs: fail-fast: false matrix: dynamic: [{glibc: ON, stdlib: OFF}, {glibc: OFF, stdlib: ON}] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: IMAGE_TYPE: test CMAKE_UNITY_BUILD: ON @@ -46,7 +46,7 @@ jobs: max-size: 1000M - shell: bash - name: Build (Ubuntu 20.04) + name: Build (Ubuntu 22.04) run: | sudo -E tools/ci-build.sh ./tools/ci-check-static.sh ./build/p4c-bm2-ss ./build/p4c-dpdk ./build/p4c-ebpf \ diff --git a/.github/workflows/ci-test-debian.yml b/.github/workflows/ci-test-debian.yml index b401433fac4..d0950d86915 100644 --- a/.github/workflows/ci-test-debian.yml +++ b/.github/workflows/ci-test-debian.yml @@ -80,9 +80,9 @@ jobs: run: ctest --output-on-failure --schedule-random -R tofino working-directory: ./build - # Build with GCC and test P4C on Ubuntu 20.04. - test-ubuntu20: - name: test-ubuntu20 (Unity ${{ matrix.unity }}, GTest ${{ matrix.gtest }}) + # Build with GCC and test P4C on Ubuntu 22.04. + test-ubuntu22: + name: test-ubuntu22 (Unity ${{ matrix.unity }}, GTest ${{ matrix.gtest }}) strategy: fail-fast: false matrix: @@ -92,7 +92,7 @@ jobs: gtest: ON - unity: OFF gtest: OFF - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: CTEST_PARALLEL_LEVEL: 4 IMAGE_TYPE: test @@ -111,11 +111,11 @@ jobs: key: test-${{ matrix.unity }}-${{ runner.os }}-gcc max-size: 1000M - - name: Build (Ubuntu 20.04, GCC) + - name: Build (Ubuntu 22.04, GCC) run: | tools/ci-build.sh - - name: Run tests (Ubuntu 20.04) + - name: Run tests (Ubuntu 22.04) # Need to use sudo for the eBPF kernel tests. run: sudo -E ctest --output-on-failure --schedule-random working-directory: ./build diff --git a/.github/workflows/ci-ubuntu-22-sanitizer-nightly.yml b/.github/workflows/ci-ubuntu-22-sanitizer-nightly.yml new file mode 100644 index 00000000000..f1afebaabd3 --- /dev/null +++ b/.github/workflows/ci-ubuntu-22-sanitizer-nightly.yml @@ -0,0 +1,44 @@ +name: "test-p4c-ubuntu-22.04-sanitizers" + +on: + schedule: + # Every day on midnight UTC + - cron: "0 0 * * *" + pull_request: + branches: [main] + push: + branches: [main] + +jobs: + # Build with clang and test p4c on Ubuntu 22.04. + test-ubuntu22-clang-sanitizers: + # Only run on pull requests with the "run-sanitizer" label. + if: ${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'run-sanitizer') }} + runs-on: ubuntu-22.04 + env: + CTEST_PARALLEL_LEVEL: 2 + IMAGE_TYPE: test + COMPILE_WITH_CLANG: ON + BUILD_AUTO_VAR_INIT_PATTERN: ON + ENABLE_SANITIZERS: ON + UBSAN_OPTIONS: print_stacktrace=1 + ASAN_OPTIONS: print_stacktrace=1:detect_leaks=0 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: ccache + uses: hendrikmuhs/ccache-action@v1 + with: + key: test-${{ runner.os }}-clang + max-size: 1000M + + - name: Build (Ubuntu 22.04, Clang, Sanitizers) + run: | + tools/ci-build.sh + + - name: Run tests (Ubuntu 22.04) + # Need to use sudo for the eBPF kernel tests. + run: sudo -E ctest --output-on-failure --schedule-random + working-directory: ./build diff --git a/.github/workflows/ci-validation-nightly.yml b/.github/workflows/ci-validation-nightly.yml index b947f603d63..c9e3b4d2e74 100644 --- a/.github/workflows/ci-validation-nightly.yml +++ b/.github/workflows/ci-validation-nightly.yml @@ -20,7 +20,7 @@ jobs: CTEST_PARALLEL_LEVEL: 4 IMAGE_TYPE: test VALIDATION: ON - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 with: @@ -32,7 +32,7 @@ jobs: key: validation-${{ runner.os }} max-size: 1000M - - name: Build (Ubuntu 20.04) + - name: Build (Ubuntu 22.04) run: | tools/ci-build.sh diff --git a/README.md b/README.md index 580302a9872..51bd893279a 100644 --- a/README.md +++ b/README.md @@ -199,7 +199,7 @@ sudo dpkg -i /path/to/package.deb ``` 2. Install [dependencies](#dependencies). You can find specific instructions - for Ubuntu 20.04 [here](#ubuntu-dependencies) and for macOS 11 + for Ubuntu 22.04 [here](#ubuntu-dependencies) and for macOS 11 [here](#macos-dependencies). You can also look at the [CI installation script](https://github.com/p4lang/p4c/blob/main/tools/ci-build.sh). @@ -267,7 +267,7 @@ If you plan to contribute to P4C, you'll find more useful information ## Dependencies -Ubuntu 20.04 is the officially supported platform for P4C. There's also +Ubuntu 22.04 is the officially supported platform for P4C. There's also unofficial support for macOS 11. Other platforms are untested; you can try to use them, but YMMV. @@ -332,7 +332,7 @@ git clone --depth 1 -b v2.3.4 https://github.com/jothepro/doxygen-awesome-css ./ ``` `P4C` also depends on Google Protocol Buffers (Protobuf). `P4C` requires version -3.0 or higher, so the packaged version provided in Ubuntu 20.04 **should** +3.0 or higher, so the packaged version provided in Ubuntu 22.04 **should** work. However, P4C typically installs its own version of Protobuf using CMake's `FetchContent` module (at the moment, 3.25.3). If you are experiencing issues with the Protobuf version shipped with your OS distribution, we recommend that to install Protobuf 3.25.3 from source. You can find instructions [here](https://github.com/protocolbuffers/protobuf/blob/v3.25.3/src/README.md). diff --git a/tools/ci-ptf/build_vm.sh b/tools/ci-ptf/build_vm.sh index 157cb11a2e6..8e106d2786a 100755 --- a/tools/ci-ptf/build_vm.sh +++ b/tools/ci-ptf/build_vm.sh @@ -19,7 +19,7 @@ USER_NAME="ubuntu" # Password: ubuntu # Newer version of mkpasswd from Ubuntu 22.04 generates string that is not correctly understand by -# Ubuntu 20.04, so hardcode password hash +# Ubuntu 22.04, so hardcode password hash # TODO: use option `--password` from virt-builder command instead, e.g. `--password ubuntu:password:ubuntu` USER_PASS="Q7KzRGQd70ZS6" USER_HOME=$(pwd) @@ -38,7 +38,7 @@ function create_kernel_packages_str() { # $@ (list of kernels versions) must be passed without quotes to allow split into separate arguments create_kernel_packages_str $@ -# Note: Image with Ubuntu 20.04 is preinstalled on logical volume which virt-builder is unable to resize +# Note: Image with Ubuntu 22.04 is preinstalled on logical volume which virt-builder is unable to resize virt-builder "$OS_TYPE" \ --memsize 2048 \ --hostname "$VM_NAME" \ diff --git a/tools/ci-ptf/run_test.sh b/tools/ci-ptf/run_test.sh index edff24e9ad8..24cecb29980 100755 --- a/tools/ci-ptf/run_test.sh +++ b/tools/ci-ptf/run_test.sh @@ -25,7 +25,7 @@ fi # `virt-install --osinfo list` or `osinfo-query os` for more information and valid values OS_VARIANT="" case "$OS_TYPE" in - "ubuntu-20.04") OS_VARIANT="ubuntu20.04" ;; + "ubuntu-22.04") OS_VARIANT="ubuntu22.04" ;; *) echo "Unsupported OS_TYPE=$OS_TYPE; please add it to script $0" exit 1 From f160c505b1f92409c01752d0851943604f99738b Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Sun, 2 Mar 2025 15:42:19 -0500 Subject: [PATCH 02/13] Replace matrix test on Ubuntu 20.04 with matrix test on Ubuntu 22.04 Signed-off-by: Andy Fingerhut --- .github/workflows/ci-test-debian.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-test-debian.yml b/.github/workflows/ci-test-debian.yml index d0950d86915..ebcb9c32078 100644 --- a/.github/workflows/ci-test-debian.yml +++ b/.github/workflows/ci-test-debian.yml @@ -16,10 +16,22 @@ concurrency: jobs: # Build with GCC and test P4C on Ubuntu 22.04. test-ubuntu22: + name: test-ubuntu22 (Unity ${{ matrix.unity }}, GTest ${{ matrix.gtest }}) + strategy: + fail-fast: false + matrix: + unity: [ON, OFF] + include: + - unity: ON + gtest: ON + - unity: OFF + gtest: OFF runs-on: ubuntu-22.04 env: CTEST_PARALLEL_LEVEL: 4 IMAGE_TYPE: test + ENABLE_GTESTS: ${{ matrix.gtest }} + CMAKE_UNITY_BUILD: ${{ matrix.unity }} BUILD_GENERATOR: Ninja steps: - uses: actions/checkout@v4 @@ -30,7 +42,7 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1 with: - key: test-${{ runner.os }}-gcc + key: test-${{ matrix.unity }}-${{ runner.os }}-gcc max-size: 1000M - name: Build (Ubuntu 22.04, GCC) @@ -41,6 +53,7 @@ jobs: # Need to use sudo for the eBPF kernel tests. run: sudo -E ctest --output-on-failure --schedule-random working-directory: ./build + if: matrix.unity == 'ON' && matrix.gtest == 'ON' # Build with GCC and test Tofino backend on Ubuntu 22.04. test-ubuntu22-tofino: From 477f3893899305f6a36bebed1ee8c782f997662e Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Sun, 2 Mar 2025 15:45:51 -0500 Subject: [PATCH 03/13] More updates forgotten in previous commit Signed-off-by: Andy Fingerhut --- .github/workflows/ci-test-debian.yml | 41 ---------------------------- 1 file changed, 41 deletions(-) diff --git a/.github/workflows/ci-test-debian.yml b/.github/workflows/ci-test-debian.yml index ebcb9c32078..5a5e215daef 100644 --- a/.github/workflows/ci-test-debian.yml +++ b/.github/workflows/ci-test-debian.yml @@ -92,44 +92,3 @@ jobs: - name: Run tests (Ubuntu 22.04) run: ctest --output-on-failure --schedule-random -R tofino working-directory: ./build - - # Build with GCC and test P4C on Ubuntu 22.04. - test-ubuntu22: - name: test-ubuntu22 (Unity ${{ matrix.unity }}, GTest ${{ matrix.gtest }}) - strategy: - fail-fast: false - matrix: - unity: [ON, OFF] - include: - - unity: ON - gtest: ON - - unity: OFF - gtest: OFF - runs-on: ubuntu-22.04 - env: - CTEST_PARALLEL_LEVEL: 4 - IMAGE_TYPE: test - ENABLE_GTESTS: ${{ matrix.gtest }} - CMAKE_UNITY_BUILD: ${{ matrix.unity }} - BUILD_GENERATOR: Ninja - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 - - - name: ccache - uses: hendrikmuhs/ccache-action@v1 - with: - key: test-${{ matrix.unity }}-${{ runner.os }}-gcc - max-size: 1000M - - - name: Build (Ubuntu 22.04, GCC) - run: | - tools/ci-build.sh - - - name: Run tests (Ubuntu 22.04) - # Need to use sudo for the eBPF kernel tests. - run: sudo -E ctest --output-on-failure --schedule-random - working-directory: ./build - if: matrix.unity == 'ON' && matrix.gtest == 'ON' From 50ff3e954d8c6f78c16c2d23469894cdb38735fd Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Sun, 2 Mar 2025 16:54:20 -0500 Subject: [PATCH 04/13] Add extra debug in failing EBPF test Signed-off-by: Andy Fingerhut --- backends/ebpf/tests/ptf/test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends/ebpf/tests/ptf/test.py b/backends/ebpf/tests/ptf/test.py index 621100c6f02..921c0ae4d80 100644 --- a/backends/ebpf/tests/ptf/test.py +++ b/backends/ebpf/tests/ptf/test.py @@ -683,6 +683,7 @@ def runTest(self): pkt = testutils.simple_udp_packet( eth_src="11:22:33:44:55:66", ip_src="1.2.3.4", ip_dst="192.168.2.1" ) + pkt.show() testutils.send_packet(self, PORT0, pkt) pkt[Ether].type = 0x1122 pkt[IP].proto = 0x7 @@ -691,6 +692,7 @@ def runTest(self): pkt[IP].src = "17.17.17.17" pkt[IP].dst = "255.255.255.255" pkt[UDP].chksum = 0x044D + pkt.show() testutils.verify_packet(self, pkt, PORT1) From b18d6af691d6de2bf94d517e81b0f710fc120641 Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Sun, 2 Mar 2025 18:44:00 -0500 Subject: [PATCH 05/13] Second try at better debug output for failing test Signed-off-by: Andy Fingerhut --- backends/ebpf/tests/ptf/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/ebpf/tests/ptf/test.py b/backends/ebpf/tests/ptf/test.py index 921c0ae4d80..e01ba98ef6d 100644 --- a/backends/ebpf/tests/ptf/test.py +++ b/backends/ebpf/tests/ptf/test.py @@ -683,7 +683,7 @@ def runTest(self): pkt = testutils.simple_udp_packet( eth_src="11:22:33:44:55:66", ip_src="1.2.3.4", ip_dst="192.168.2.1" ) - pkt.show() + print("pkt bytes to send: %s" % (list(bytes(pkt)))) testutils.send_packet(self, PORT0, pkt) pkt[Ether].type = 0x1122 pkt[IP].proto = 0x7 @@ -692,7 +692,7 @@ def runTest(self): pkt[IP].src = "17.17.17.17" pkt[IP].dst = "255.255.255.255" pkt[UDP].chksum = 0x044D - pkt.show() + print("pkt bytes to expect: %s" % (list(bytes(pkt)))) testutils.verify_packet(self, pkt, PORT1) From dcea6c8858cd63c179c3b476a329716d3c1eb506 Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Mon, 3 Mar 2025 01:21:15 -0500 Subject: [PATCH 06/13] Extra debug for failing EBPF test Signed-off-by: Andy Fingerhut --- backends/ebpf/tests/ptf/test.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backends/ebpf/tests/ptf/test.py b/backends/ebpf/tests/ptf/test.py index e01ba98ef6d..408ff51611f 100644 --- a/backends/ebpf/tests/ptf/test.py +++ b/backends/ebpf/tests/ptf/test.py @@ -680,10 +680,16 @@ def runTest(self): priority=10, ) + import pprint as pp + for tbl_name in ['ingress_tbl_ternary_0', 'ingress_tbl_ternary_1', 'ingress_tbl_ternary_2']: + table_data = self.table_get(table=tbl_name) + print("contents of table %s" % (tbl_name)) + pp.pprint(table_data) + pkt = testutils.simple_udp_packet( eth_src="11:22:33:44:55:66", ip_src="1.2.3.4", ip_dst="192.168.2.1" ) - print("pkt bytes to send: %s" % (list(bytes(pkt)))) + print("pkt bytes to send : %s" % (list(map(lambda x: '%02x' % (x), list(bytes(pkt)))))) testutils.send_packet(self, PORT0, pkt) pkt[Ether].type = 0x1122 pkt[IP].proto = 0x7 @@ -692,7 +698,7 @@ def runTest(self): pkt[IP].src = "17.17.17.17" pkt[IP].dst = "255.255.255.255" pkt[UDP].chksum = 0x044D - print("pkt bytes to expect: %s" % (list(bytes(pkt)))) + print("pkt bytes to expect: %s" % (list(map(lambda x: '%02x' % (x), list(bytes(pkt)))))) testutils.verify_packet(self, pkt, PORT1) From 1d126385c33b9b5bf41802258f0ef49d0a5d527e Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Mon, 3 Mar 2025 09:13:13 -0500 Subject: [PATCH 07/13] Revert 2 failing CI tests back to Ubuntu 20.04 Signed-off-by: Andy Fingerhut --- .github/workflows/ci-validation-nightly.yml | 4 ++-- backends/ebpf/tests/ptf/test.py | 8 -------- tools/ci-ptf/build_vm.sh | 4 ++-- tools/ci-ptf/run_test.sh | 2 +- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci-validation-nightly.yml b/.github/workflows/ci-validation-nightly.yml index c9e3b4d2e74..b947f603d63 100644 --- a/.github/workflows/ci-validation-nightly.yml +++ b/.github/workflows/ci-validation-nightly.yml @@ -20,7 +20,7 @@ jobs: CTEST_PARALLEL_LEVEL: 4 IMAGE_TYPE: test VALIDATION: ON - runs-on: ubuntu-22.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 with: @@ -32,7 +32,7 @@ jobs: key: validation-${{ runner.os }} max-size: 1000M - - name: Build (Ubuntu 22.04) + - name: Build (Ubuntu 20.04) run: | tools/ci-build.sh diff --git a/backends/ebpf/tests/ptf/test.py b/backends/ebpf/tests/ptf/test.py index 408ff51611f..621100c6f02 100644 --- a/backends/ebpf/tests/ptf/test.py +++ b/backends/ebpf/tests/ptf/test.py @@ -680,16 +680,9 @@ def runTest(self): priority=10, ) - import pprint as pp - for tbl_name in ['ingress_tbl_ternary_0', 'ingress_tbl_ternary_1', 'ingress_tbl_ternary_2']: - table_data = self.table_get(table=tbl_name) - print("contents of table %s" % (tbl_name)) - pp.pprint(table_data) - pkt = testutils.simple_udp_packet( eth_src="11:22:33:44:55:66", ip_src="1.2.3.4", ip_dst="192.168.2.1" ) - print("pkt bytes to send : %s" % (list(map(lambda x: '%02x' % (x), list(bytes(pkt)))))) testutils.send_packet(self, PORT0, pkt) pkt[Ether].type = 0x1122 pkt[IP].proto = 0x7 @@ -698,7 +691,6 @@ def runTest(self): pkt[IP].src = "17.17.17.17" pkt[IP].dst = "255.255.255.255" pkt[UDP].chksum = 0x044D - print("pkt bytes to expect: %s" % (list(map(lambda x: '%02x' % (x), list(bytes(pkt)))))) testutils.verify_packet(self, pkt, PORT1) diff --git a/tools/ci-ptf/build_vm.sh b/tools/ci-ptf/build_vm.sh index 8e106d2786a..157cb11a2e6 100755 --- a/tools/ci-ptf/build_vm.sh +++ b/tools/ci-ptf/build_vm.sh @@ -19,7 +19,7 @@ USER_NAME="ubuntu" # Password: ubuntu # Newer version of mkpasswd from Ubuntu 22.04 generates string that is not correctly understand by -# Ubuntu 22.04, so hardcode password hash +# Ubuntu 20.04, so hardcode password hash # TODO: use option `--password` from virt-builder command instead, e.g. `--password ubuntu:password:ubuntu` USER_PASS="Q7KzRGQd70ZS6" USER_HOME=$(pwd) @@ -38,7 +38,7 @@ function create_kernel_packages_str() { # $@ (list of kernels versions) must be passed without quotes to allow split into separate arguments create_kernel_packages_str $@ -# Note: Image with Ubuntu 22.04 is preinstalled on logical volume which virt-builder is unable to resize +# Note: Image with Ubuntu 20.04 is preinstalled on logical volume which virt-builder is unable to resize virt-builder "$OS_TYPE" \ --memsize 2048 \ --hostname "$VM_NAME" \ diff --git a/tools/ci-ptf/run_test.sh b/tools/ci-ptf/run_test.sh index 24cecb29980..edff24e9ad8 100755 --- a/tools/ci-ptf/run_test.sh +++ b/tools/ci-ptf/run_test.sh @@ -25,7 +25,7 @@ fi # `virt-install --osinfo list` or `osinfo-query os` for more information and valid values OS_VARIANT="" case "$OS_TYPE" in - "ubuntu-22.04") OS_VARIANT="ubuntu22.04" ;; + "ubuntu-20.04") OS_VARIANT="ubuntu20.04" ;; *) echo "Unsupported OS_TYPE=$OS_TYPE; please add it to script $0" exit 1 From 810e1f197a1ccd0d008f1715e139feed91b1bf97 Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Mon, 3 Mar 2025 09:21:43 -0500 Subject: [PATCH 08/13] Revert ptf test back to Ubuntu 20.04, since it is failing with 22.04 Signed-off-by: Andy Fingerhut --- .github/workflows/ci-ptf.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-ptf.yml b/.github/workflows/ci-ptf.yml index d91eb953441..3304f705ae4 100644 --- a/.github/workflows/ci-ptf.yml +++ b/.github/workflows/ci-ptf.yml @@ -30,7 +30,7 @@ concurrency: jobs: ptf-linux: - runs-on: ubuntu-22.04 + runs-on: ubuntu-20.04 env: CTEST_PARALLEL_LEVEL: 4 IMAGE_TYPE: test @@ -48,10 +48,10 @@ jobs: key: test-ptf-${{ runner.os }} max-size: 1000M - - name: Build (Ubuntu 22.04) + - name: Build (Ubuntu 20.04) run: | tools/ci-build.sh - - name: Run PTF tests for eBPF backend (Ubuntu 22.04) + - name: Run PTF tests for eBPF backend (Ubuntu 20.04) run: sudo -E ./test.sh working-directory: ./backends/ebpf/tests From 830ed8c8aba8efcf7f44072daf56ff6fb97b3a47 Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Mon, 3 Mar 2025 10:14:02 -0500 Subject: [PATCH 09/13] Revert changes to CI test I have not tried yet Signed-off-by: Andy Fingerhut --- .github/workflows/ci-ptf-kernels-weekly.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-ptf-kernels-weekly.yml b/.github/workflows/ci-ptf-kernels-weekly.yml index 400fb146c8c..9073f755a7c 100644 --- a/.github/workflows/ci-ptf-kernels-weekly.yml +++ b/.github/workflows/ci-ptf-kernels-weekly.yml @@ -57,7 +57,7 @@ jobs: if: ${{ github.repository == 'p4lang/p4c' && github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest env: - OS_TYPE: ubuntu-22.04 + OS_TYPE: ubuntu-20.04 steps: - uses: actions/checkout@v4 @@ -93,7 +93,7 @@ jobs: - kernels: 5.15 kernel_version: 5.15.0-69 env: - OS_TYPE: ubuntu-22.04 + OS_TYPE: ubuntu-20.04 KERNEL_VERSION: ${{ matrix.kernel_version }} steps: - uses: actions/checkout@v4 From cec86626bdbfb3558f9b2526efe33fbc6057f8fa Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Mon, 3 Mar 2025 14:44:27 -0500 Subject: [PATCH 10/13] Remove CI test ci-ubuntu-20-sanitizer-nightly.yml If someone wants Ubuntu 20.04 tests in CI longer term, they should create something like the current ci-ubuntu-18-nightly.yml CI test that runs Ubuntu 18.04 inside a Docker container. Signed-off-by: Andy Fingerhut --- .../ci-ubuntu-20-sanitizer-nightly.yml | 44 ------------------- 1 file changed, 44 deletions(-) delete mode 100644 .github/workflows/ci-ubuntu-20-sanitizer-nightly.yml diff --git a/.github/workflows/ci-ubuntu-20-sanitizer-nightly.yml b/.github/workflows/ci-ubuntu-20-sanitizer-nightly.yml deleted file mode 100644 index 830ddade2cd..00000000000 --- a/.github/workflows/ci-ubuntu-20-sanitizer-nightly.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: "test-p4c-ubuntu-20.04-sanitizers" - -on: - schedule: - # Every day on midnight UTC - - cron: "0 0 * * *" - pull_request: - branches: [main] - push: - branches: [main] - -jobs: - # Build with clang and test p4c on Ubuntu 20.04. - test-ubuntu20-clang-sanitizers: - # Only run on pull requests with the "run-sanitizer" label. - if: ${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'run-sanitizer') }} - runs-on: ubuntu-20.04 - env: - CTEST_PARALLEL_LEVEL: 2 - IMAGE_TYPE: test - COMPILE_WITH_CLANG: ON - BUILD_AUTO_VAR_INIT_PATTERN: ON - ENABLE_SANITIZERS: ON - UBSAN_OPTIONS: print_stacktrace=1 - ASAN_OPTIONS: print_stacktrace=1:detect_leaks=0 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: ccache - uses: hendrikmuhs/ccache-action@v1 - with: - key: test-${{ runner.os }}-clang - max-size: 1000M - - - name: Build (Ubuntu 20.04, Clang, Sanitizers) - run: | - tools/ci-build.sh - - - name: Run tests (Ubuntu 20.04) - # Need to use sudo for the eBPF kernel tests. - run: sudo -E ctest --output-on-failure --schedule-random - working-directory: ./build From fd5494114e4db535c9df90e9f0031fca16b8fa0a Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Mon, 3 Mar 2025 23:58:54 -0500 Subject: [PATCH 11/13] Remove another ubuntu-20.04 test Signed-off-by: Andy Fingerhut --- .github/workflows/ci-test-debian.yml | 41 ---------------------------- 1 file changed, 41 deletions(-) diff --git a/.github/workflows/ci-test-debian.yml b/.github/workflows/ci-test-debian.yml index de31a92f9e6..8645a72bd8e 100644 --- a/.github/workflows/ci-test-debian.yml +++ b/.github/workflows/ci-test-debian.yml @@ -92,44 +92,3 @@ jobs: - name: Run tests (Ubuntu 22.04) run: ctest --output-on-failure --schedule-random -R tofino working-directory: ./build - - # Build with GCC and test P4C on Ubuntu 20.04. - test-ubuntu20: - name: test-ubuntu20 (Unity ${{ matrix.unity }}, GTest ${{ matrix.gtest }}) - strategy: - fail-fast: false - matrix: - unity: [ON, OFF] - include: - - unity: ON - gtest: ON - - unity: OFF - gtest: OFF - runs-on: ubuntu-20.04 - env: - CTEST_PARALLEL_LEVEL: 4 - IMAGE_TYPE: test - ENABLE_GTESTS: ${{ matrix.gtest }} - CMAKE_UNITY_BUILD: ${{ matrix.unity }} - BUILD_GENERATOR: Ninja - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 - - - name: ccache - uses: hendrikmuhs/ccache-action@v1 - with: - key: test-${{ matrix.unity }}-${{ runner.os }}-gcc - max-size: 1000M - - - name: Build (Ubuntu 20.04, GCC) - run: | - tools/ci-build.sh - - - name: Run tests (Ubuntu 20.04) - # Need to use sudo for the eBPF kernel tests and need to avoid p4tc_stf tests. - run: sudo -E ctest --output-on-failure --schedule-random -E "p4tc_samples_stf|p4tc_cleanup|p4tc_setup" - working-directory: ./build - if: matrix.unity == 'ON' && matrix.gtest == 'ON' From 78f3f5001994845291a86a88bdd498466e5e537e Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Tue, 4 Mar 2025 09:52:32 -0500 Subject: [PATCH 12/13] Whitespace-only change to trigger CI again Signed-off-by: Andy Fingerhut --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 51bd893279a..b4023ce964d 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ [![Validation](https://github.com/p4lang/p4c/actions/workflows/ci-validation-nightly.yml/badge.svg)](https://github.com/p4lang/p4c/actions/workflows/ci-validation-nightly.yml) [![Docker Container](https://github.com/p4lang/p4c/actions/workflows/ci-container-image.yml/badge.svg)](https://github.com/p4lang/p4c/actions/workflows/ci-container-image.yml) + From 7ba0593abfe355975267548c01516157b7012145 Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Tue, 4 Mar 2025 09:53:01 -0500 Subject: [PATCH 13/13] And again. Signed-off-by: Andy Fingerhut --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index b4023ce964d..51bd893279a 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ [![Validation](https://github.com/p4lang/p4c/actions/workflows/ci-validation-nightly.yml/badge.svg)](https://github.com/p4lang/p4c/actions/workflows/ci-validation-nightly.yml) [![Docker Container](https://github.com/p4lang/p4c/actions/workflows/ci-container-image.yml/badge.svg)](https://github.com/p4lang/p4c/actions/workflows/ci-container-image.yml) -