From 1d8161b5b12730dc141b69940acfe9a2ebb92d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A5=96=E5=BB=BA?= Date: Wed, 6 Sep 2023 13:30:09 +0800 Subject: [PATCH] fix ovn build (#3166) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张祖建 --- .github/workflows/build-windows.yaml | 15 ++++++++------- dist/images/Dockerfile.base | 2 ++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-windows.yaml b/.github/workflows/build-windows.yaml index 0eaccc7fc3e6..160fc796b41d 100644 --- a/.github/workflows/build-windows.yaml +++ b/.github/workflows/build-windows.yaml @@ -100,7 +100,7 @@ jobs: # fix kernel crash Invoke-WebRequest -Uri "https://github.com/kubeovn/ovs/commit/64383c14a9c25e9e0ca53c6758d9499c60132536.patch" -OutFile ..\ovs-02.patch # support for building in github actions - Invoke-WebRequest -Uri "https://github.com/kubeovn/ovs/commit/08a95db2ca506fce4d89fdf4fafab74607b2bb9f.patch" -OutFile ..\ovs-03.patch + Invoke-WebRequest -Uri "https://github.com/kubeovn/ovs/commit/d170c6237cb6a7bbe16f916ab2286c3c942a852c.patch" -OutFile ..\ovs-03.patch # listen on tcp 127.0.0.1:6643 by default Invoke-WebRequest -Uri "https://github.com/kubeovn/ovs/commit/680e77a190ae7df3086bc35bb6150238e97f9020.patch" -OutFile ..\ovs-04.patch git apply ..\ovs-01.patch @@ -111,12 +111,15 @@ jobs: - name: Apply OVN patches working-directory: ovn run: | + # python: Rename build related code to ovs_build_helpers. + Invoke-WebRequest -Uri "https://github.com/kubeovn/ovn/commit/9d961aec6fd7ef3e3002bc34e285833279e989c2.patch" -OutFile ..\ovn-00.patch # change hash type from dp_hash to hash with field src_ip Invoke-WebRequest -Uri "https://github.com/kubeovn/ovn/commit/ab923b252271cbbcccc8091e338ee7efe75e5fcd.patch" -OutFile ..\ovn-01.patch # add support for windows - Invoke-WebRequest -Uri "https://github.com/kubeovn/ovn/commit/700870525ffbbccb70c6b00ca0f807b2a387e6ee.patch" -OutFile ..\ovn-02.patch + Invoke-WebRequest -Uri "https://github.com/kubeovn/ovn/commit/2be843b9fc7cba253fb27fc57c384034e97db148.patch" -OutFile ..\ovn-02.patch # set br-int controller to TCP 127.0.0.1:6653 Invoke-WebRequest -Uri "https://github.com/kubeovn/ovn/commit/e498c03eda80248dd786775d8f7779d9b895e3ff.patch" -OutFile ..\ovn-03.patch + git apply ..\ovn-00.patch git apply ..\ovn-01.patch git apply ..\ovn-02.patch git apply ..\ovn-03.patch @@ -128,9 +131,6 @@ jobs: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" nmake all install - - name: Install pypiwin32 - run: python3 -m pip install pypiwin32 - - name: Build OVS and OVN shell: cmd env: @@ -150,14 +150,15 @@ jobs: echo %%~d | findstr /C:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" > nul && set _vs_path=!_vs_path!;%%~d ) SET PATH="%_vs_path%;%PATH%" - C:\msys64\usr\bin\bash.exe -lc "pacman -S --noconfirm libtool autoconf automake-wrapper" + C:\msys64\usr\bin\bash.exe -lc "pacman -S --noconfirm python-pip libtool autoconf automake-wrapper" + C:\msys64\usr\bin\bash.exe -lc "python3 -m pip install pypiwin32" C:\msys64\usr\bin\bash.exe -lc "rm -f `which link`" C:\msys64\usr\bin\bash.exe -lc "cd '%_ovs_dir%' && ./boot.sh" C:\msys64\usr\bin\bash.exe -lc "cd '%_ovs_dir%' && ./configure CC=./build-aux/cccl LD='`which link`' LIBS='-lws2_32 -lShlwapi -liphlpapi -lwbemuuid -lole32 -loleaut32' --prefix='C:/openvswitch/usr' --localstatedir='C:/openvswitch/var' --sysconfdir='C:/openvswitch/etc' --with-pthread='%_p4w_dir%' --disable-ssl" C:\msys64\usr\bin\bash.exe -lc "cd '%_ovs_dir%' && make -j" C:\msys64\usr\bin\bash.exe -lc "cd '%_ovs_dir%' && make windows_installer" C:\msys64\usr\bin\bash.exe -lc "cd '%_ovn_dir%' && ./boot.sh" - C:\msys64\usr\bin\bash.exe -lc "cd '%_ovn_dir%' && ./configure CC=./build-aux/cccl LD='`which link`' LIBS='-lws2_32 -lShlwapi -liphlpapi -lwbemuuid -lole32 -loleaut32' --prefix='C:/ovn/usr' --localstatedir='C:/ovn/var' --sysconfdir='C:/ovn/etc' --with-pthread='%_p4w_dir%' --disable-ssl --with-ovs-source='../ovs' --with-ovs-build='../ovs'" + C:\msys64\usr\bin\bash.exe -lc "cd '%_ovn_dir%' && ./configure CC=./build-aux/cccl LD='`which link`' LIBS='-lws2_32 -lShlwapi -liphlpapi -lwbemuuid -lole32 -loleaut32' --prefix='C:/ovn/usr' --localstatedir='C:/ovn/var' --sysconfdir='C:/ovn/etc' --with-pthread='%_p4w_dir%' --disable-ssl --with-ovs-source='../ovs'" C:\msys64\usr\bin\bash.exe -lc "cd '%_ovn_dir%' && make -j" C:\msys64\usr\bin\bash.exe -lc "cd '%_ovn_dir%' && make install" diff --git a/dist/images/Dockerfile.base b/dist/images/Dockerfile.base index 49e4e3dd703f..33af94e6c960 100644 --- a/dist/images/Dockerfile.base +++ b/dist/images/Dockerfile.base @@ -44,6 +44,8 @@ RUN dpkg -i /usr/src/python3-openvswitch*.deb /usr/src/libopenvswitch*.deb RUN cd /usr/src/ && git clone -b branch-22.03 --depth=1 https://github.com/ovn-org/ovn.git && \ cd ovn && \ + # python: Rename build related code to ovs_build_helpers. + curl -s https://github.com/kubeovn/ovn/commit/9d961aec6fd7ef3e3002bc34e285833279e989c2.patch | git apply && \ # fix ssl listen address curl -s https://github.com/kubeovn/ovn/commit/dca043b2c35756fd370214fc40d61f755bd3a66f.patch | git apply && \ # ovn-controller: Add a generic way to check if the daemon started recently.