Skip to content

Commit

Permalink
Merge pull request #3 from ovn-org/main
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
ts170710 authored Dec 27, 2023
2 parents 433502d + ef45415 commit 27d9424
Show file tree
Hide file tree
Showing 90 changed files with 6,047 additions and 2,466 deletions.
16 changes: 13 additions & 3 deletions .ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CONTAINER_WORKDIR="/workspace/ovn-tmp"
IMAGE_NAME=${IMAGE_NAME:-"ovn-org/ovn-tests"}

# Test variables
ARCH=${ARCH:-$(uname -i)}
ARCH=${ARCH:-$(uname -m)}
CC=${CC:-gcc}


Expand Down Expand Up @@ -101,10 +101,20 @@ function run_tests() {
&& \
ARCH=$ARCH CC=$CC LIBS=$LIBS OPTS=$OPTS TESTSUITE=$TESTSUITE \
TEST_RANGE=$TEST_RANGE SANITIZERS=$SANITIZERS DPDK=$DPDK \
./.ci/linux-build.sh
RECHECK=$RECHECK UNSTABLE=$UNSTABLE ./.ci/linux-build.sh
"
}

function check_clang_version_ge() {
lower=$1
version=$(clang --version | head -n1 | cut -d' ' -f3)
if ! echo -e "$lower\n$version" | sort -CV; then
return 1
fi

return 0
}

options=$(getopt --options "" \
--long help,shell,archive-logs,jobs:,ovn-path:,ovs-path:,image-name:\
-- "${@}")
Expand Down Expand Up @@ -149,7 +159,7 @@ while true; do
done

# Workaround for https://bugzilla.redhat.com/2153359
if [ "$ARCH" = "aarch64" ]; then
if [ "$ARCH" = "aarch64" ] && ! check_clang_version_ge "16.0.0"; then
ASAN_OPTIONS="detect_leaks=0"
fi

Expand Down
79 changes: 63 additions & 16 deletions .ci/linux-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ COMMON_CFLAGS=""
OVN_CFLAGS=""
OPTS="$OPTS --enable-Werror"
JOBS=${JOBS:-"-j4"}
RECHECK=${RECHECK:-"no"}

function install_dpdk()
{
Expand Down Expand Up @@ -80,7 +81,7 @@ function configure_gcc()
# We should install gcc-multilib for x86 build, we cannot
# do it directly because gcc-multilib is not available
# for arm64
sudo apt install -y gcc-multilib
sudo apt update && sudo apt install -y gcc-multilib
fi
fi
}
Expand All @@ -99,34 +100,80 @@ function configure_clang()
COMMON_CFLAGS="${COMMON_CFLAGS} -Wno-error=unused-command-line-argument"
}

function run_tests()
{
if ! make distcheck CFLAGS="${COMMON_CFLAGS} ${OVN_CFLAGS}" $JOBS \
TESTSUITEFLAGS="$JOBS $TEST_RANGE" RECHECK=$RECHECK \
SKIP_UNSTABLE=$SKIP_UNSTABLE
then
# testsuite.log is necessary for debugging.
cat */_build/sub/tests/testsuite.log
return 1
fi
}

function execute_tests()
{
# 'distcheck' will reconfigure with required options.
# Now we only need to prepare the Makefile without sparse-wrapped CC.
configure_ovn

export DISTCHECK_CONFIGURE_FLAGS="$OPTS"
if ! make distcheck CFLAGS="${COMMON_CFLAGS} ${OVN_CFLAGS}" $JOBS \
TESTSUITEFLAGS="$JOBS $TEST_RANGE" RECHECK=yes
then
# testsuite.log is necessary for debugging.
cat */_build/sub/tests/testsuite.log

local stable_rc=0
local unstable_rc=0

if ! SKIP_UNSTABLE=yes run_tests; then
stable_rc=1
fi

if [ "$UNSTABLE" ]; then
if ! SKIP_UNSTABLE=no TEST_RANGE="-k unstable" RECHECK=yes \
run_tests; then
unstable_rc=1
fi
fi

if [[ $stable_rc -ne 0 ]] || [[ $unstable_rc -ne 0 ]]; then
exit 1
fi
}

function run_system_tests()
{
local type=$1
local log_file=$2

if ! sudo make $JOBS $type TESTSUITEFLAGS="$TEST_RANGE" \
RECHECK=$RECHECK SKIP_UNSTABLE=$SKIP_UNSTABLE; then
# $log_file is necessary for debugging.
cat tests/$log_file
return 1
fi
}

function execute_system_tests()
{
type=$1
log_file=$2

configure_ovn $OPTS
make $JOBS || { cat config.log; exit 1; }
if ! sudo make $JOBS $type TESTSUITEFLAGS="$TEST_RANGE" RECHECK=yes; then
# $log_file is necessary for debugging.
cat tests/$log_file
exit 1
fi
configure_ovn $OPTS
make $JOBS || { cat config.log; exit 1; }

local stable_rc=0
local unstable_rc=0

if ! SKIP_UNSTABLE=yes run_system_tests $@; then
stable_rc=1
fi

if [ "$UNSTABLE" ]; then
if ! SKIP_UNSTABLE=no TEST_RANGE="-k unstable" RECHECK=yes \
run_system_tests $@; then
unstable_rc=1
fi
fi

if [[ $stable_rc -ne 0 ]] || [[ $unstable_rc -ne 0 ]]; then
exit 1
fi
}

configure_$CC
Expand Down
19 changes: 19 additions & 0 deletions .ci/linux-util.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

function free_up_disk_space_ubuntu()
{
local pkgs='azure-cli aspnetcore-* dotnet-* ghc-* firefox*
google-chrome-stable google-cloud-cli libmono-* llvm-*
microsoft-edge-stable mono-* msbuild mysql-server-core-*
php-* php7* powershell* temurin-* zulu-*'

# Use apt patterns to only select real packages that match the names
# in the list above.
local pkgs=$(echo $pkgs | sed 's/[^ ]* */~n&/g')

sudo apt update && sudo apt-get --auto-remove -y purge $pkgs

local paths='/usr/local/lib/android/ /usr/share/dotnet/ /opt/ghc/
/usr/local/share/boost/'
sudo rm -rf $paths
}
1 change: 1 addition & 0 deletions .ci/ovn-kubernetes/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ RUN dnf install -y *.rpm && rm -f *.rpm
# install ovn-kubernetes binaries built in previous stage
RUN mkdir -p /usr/libexec/cni/
COPY --from=ovnkubebuilder /root/ovn-kubernetes/go-controller/_output/go/bin/ovnkube /usr/bin/
COPY --from=ovnkubebuilder /root/ovn-kubernetes/go-controller/_output/go/bin/ovnkube-identity /usr/bin/
COPY --from=ovnkubebuilder /root/ovn-kubernetes/go-controller/_output/go/bin/ovn-kube-util /usr/bin/
COPY --from=ovnkubebuilder /root/ovn-kubernetes/go-controller/_output/go/bin/ovndbchecker /usr/bin/
COPY --from=ovnkubebuilder /root/ovn-kubernetes/go-controller/_output/go/bin/ovn-k8s-cni-overlay /usr/libexec/cni/ovn-k8s-cni-overlay
Expand Down
15 changes: 9 additions & 6 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,28 @@ arm_unit_tests_task:
ARCH: aarch64
CIRRUS_CLONE_SUBMODULES: true
PATH: ${HOME}/bin:${HOME}/.local/bin:${PATH}
RECHECK: yes
matrix:
- CC: gcc
TESTSUITE: test
TEST_RANGE: -500
TEST_RANGE: -300
- CC: gcc
TESTSUITE: test
TEST_RANGE: 501-1000
TEST_RANGE: 301-600
- CC: gcc
TESTSUITE: test
TEST_RANGE: 1001-
TEST_RANGE: 601-
UNSTABLE: yes
- CC: clang
TESTSUITE: test
TEST_RANGE: -500
TEST_RANGE: -300
- CC: clang
TESTSUITE: test
TEST_RANGE: 501-1000
TEST_RANGE: 301-600
- CC: clang
TESTSUITE: test
TEST_RANGE: 1001-
TEST_RANGE: 601-
UNSTABLE: yes

name: ARM64 ${CC} ${TESTSUITE} ${TEST_RANGE}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:

jobs:
container:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
distro: [ fedora, ubuntu ]
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/ovn-fake-multinode-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
jobs:
build:
name: Build ovn-fake-multinode image
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
cfg:
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
path: /tmp/_output/ovn_${{ matrix.cfg.branch }}_image.tar

multinode-tests:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 15
needs: [build]
strategy:
Expand Down Expand Up @@ -99,13 +99,18 @@ jobs:
XDG_RUNTIME_DIR: ''

steps:
- name: Check out ovn
uses: actions/checkout@v3

- name: install required dependencies
run: |
sudo apt update || true
sudo apt install -y ${{ env.dependencies }}
- name: Free up disk space
run: sudo eatmydata apt-get remove --auto-remove -y aspnetcore-* dotnet-* libmono-* mono-* msbuild php-* php7* ghc-* zulu-*
run: |
. .ci/linux-util.sh
free_up_disk_space_ubuntu
- uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -153,7 +158,7 @@ jobs:
- name: set up python
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.12'

- name: Check out ovn
uses: actions/checkout@v3
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/ovn-kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ env:
jobs:
build:
name: Build
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Enable Docker experimental features
run: |
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
e2e:
name: e2e
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 220
strategy:
fail-fast: false
Expand Down Expand Up @@ -95,18 +95,14 @@ jobs:
KIND_IPV6_SUPPORT: "${{ matrix.ipfamily == 'IPv6' || matrix.ipfamily == 'dualstack' }}"
steps:

- name: Free up disk space
run: |
sudo eatmydata apt-get purge --auto-remove -y \
azure-cli aspnetcore-* dotnet-* ghc-* firefox \
google-chrome-stable google-cloud-sdk \
llvm-* microsoft-edge-stable mono-* \
msbuild mysql-server-core-* php-* php7* \
powershell temurin-* zulu-*
- name: Check out ovn
uses: actions/checkout@v3

- name: Free up disk space
run: |
. .ci/linux-util.sh
free_up_disk_space_ubuntu
- name: Check out ovn-kubernetes
uses: actions/checkout@v3
with:
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ jobs:
TESTSUITE: ${{ matrix.cfg.testsuite }}
TEST_RANGE: ${{ matrix.cfg.test_range }}
SANITIZERS: ${{ matrix.cfg.sanitizers }}
UNSTABLE: ${{ matrix.cfg.unstable }}

name: linux ${{ join(matrix.cfg.*, ' ') }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

strategy:
fail-fast: false
Expand All @@ -104,21 +105,21 @@ jobs:
- { compiler: clang, opts: --disable-ssl }
- { compiler: gcc, testsuite: test, test_range: "-300" }
- { compiler: gcc, testsuite: test, test_range: "301-600" }
- { compiler: gcc, testsuite: test, test_range: "601-" }
- { compiler: gcc, testsuite: test, test_range: "601-", unstable: unstable }
- { compiler: clang, testsuite: test, sanitizers: sanitizers, test_range: "-300" }
- { compiler: clang, testsuite: test, sanitizers: sanitizers, test_range: "301-600" }
- { compiler: clang, testsuite: test, sanitizers: sanitizers, test_range: "601-" }
- { compiler: clang, testsuite: test, sanitizers: sanitizers, test_range: "601-", unstable: unstable }
- { compiler: gcc, testsuite: test, libs: -ljemalloc, test_range: "-300" }
- { compiler: gcc, testsuite: test, libs: -ljemalloc, test_range: "301-600" }
- { compiler: gcc, testsuite: test, libs: -ljemalloc, test_range: "601-" }
- { compiler: gcc, testsuite: test, libs: -ljemalloc, test_range: "601-", unstable: unstable }
- { compiler: gcc, testsuite: system-test-dpdk, dpdk: dpdk, test_range: "-100" }
- { compiler: gcc, testsuite: system-test-dpdk, dpdk: dpdk, test_range: "101-" }
- { compiler: gcc, testsuite: system-test-dpdk, dpdk: dpdk, test_range: "101-", unstable: unstable }
- { compiler: gcc, testsuite: system-test-userspace, test_range: "-100" }
- { compiler: gcc, testsuite: system-test-userspace, test_range: "101-" }
- { compiler: gcc, testsuite: system-test-userspace, test_range: "101-", unstable: unstable }
- { compiler: gcc, testsuite: system-test, test_range: "-100" }
- { compiler: gcc, testsuite: system-test, test_range: "101-" }
- { compiler: gcc, testsuite: system-test, test_range: "101-", unstable: unstable }
- { compiler: clang, testsuite: system-test, sanitizers: sanitizers, test_range: "-100" }
- { compiler: clang, testsuite: system-test, sanitizers: sanitizers, test_range: "101-" }
- { compiler: clang, testsuite: system-test, sanitizers: sanitizers, test_range: "101-", unstable: unstable }
- { arch: x86, compiler: gcc, opts: --disable-ssl }

steps:
Expand Down Expand Up @@ -219,7 +220,7 @@ jobs:
- name: set up python
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.12'
- name: prepare
run: ./.ci/osx-prepare.sh
- name: build
Expand All @@ -233,7 +234,7 @@ jobs:

build-linux-rpm:
name: linux rpm fedora
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
container: fedora:latest
timeout-minutes: 30

Expand Down
26 changes: 26 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .readthedocs.yaml
# Read the Docs configuration file.
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details.

# Required.
version: 2

# Set the OS, Python version, etc.
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the "Documentation/" directory with Sphinx.
sphinx:
configuration: Documentation/conf.py
# Default HTML builder.
builder: "html"

# Build all formats: HTML, PDF, ePub.
formats: all

# Declare the Python requirements.
python:
install:
- requirements: Documentation/requirements.txt
Loading

0 comments on commit 27d9424

Please sign in to comment.