Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post 0.107 cleanup & dropping API/ABI compat #400

Merged
merged 16 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/autopkgtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
# it's needed (will be auto-loaded) by routing.test_vrf_basic
- name: Install dependencies
run: |
sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list
sudo apt update
sudo apt install autopkgtest ubuntu-dev-tools devscripts openvswitch-switch linux-modules-extra-$(uname -r)
# work around LP: #1878225 as fallback
Expand All @@ -46,6 +45,12 @@ jobs:
pull-lp-source netplan.io
cp -r netplan.io-*/debian .
rm -r debian/patches/ # clear any distro patches
# usrmerge-fix
mkdir debian/extra
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this will start to fail when your changes get synced with Ubuntu but we can fix the CI again later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. And I just uploaded 0.107.1-2 into Debian unstable. I'll use my next PR to adopt CI accordingly, once that landed.

touch debian/extra/PLACEHOLDER
echo "../extra/PLACEHOLDER usr/lib/netplan/PLACEHOLDER" >> debian/extra/PLACEHOLDER
sed -i 's|rm debian/tmp/lib/netplan/generate|sh -c "mkdir -p debian/tmp/usr/lib/systemd/system-generators; rm -rf debian/tmp/lib; ln -sf /usr/libexec/netplan/generate debian/tmp/usr/lib/systemd/system-generators/netplan"|' debian/rules
# usrmerge-fix-end
TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) # find latest (stable) tag
REV=$(git rev-parse --short HEAD) # get current git revision
VER="$TAG+git~$REV"
Expand All @@ -56,6 +61,5 @@ jobs:
# cmocka/pytest/rich/ethtool until they become proper test-deps
# The network-manager PPA is used here temporally due to a bug with veths and network-manager 1.36. See LP: #2032824
autopkgtest . \
--setup-commands='apt -y install ethtool python3-rich python3-pytest python3-pytest-cov python3-cffi libpython3-dev libcmocka-dev' \
--setup-commands='sudo add-apt-repository -y -u -s ppa:danilogondolfo/network-manager' \
-U --env=DPKG_GENSYMBOLS_CHECK_LEVEL=0 --env=DEB_BUILD_OPTIONS=nocheck -- lxd autopkgtest/ubuntu/jammy/amd64
9 changes: 4 additions & 5 deletions .github/workflows/build-abi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# Installs the build dependencies
# Always include phased updates (LP: #1979244)
- name: Install build depends
run: |
echo "APT::Get::Always-Include-Phased-Updates \"true\";" | sudo tee /etc/apt/apt.conf.d/90phased-updates
sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list
sudo apt update
#sudo apt install lcov python3-coverage curl
sudo apt install abigail-tools meson python3-coverage python3-pytest python3-pytest-cov python3-cffi libpython3-dev
sudo apt build-dep netplan.io
sudo apt install abigail-tools ubuntu-dev-tools devscripts equivs
pull-lp-source netplan.io
mk-build-deps -i -B -s sudo netplan.io-*/debian/control

# Runs the build
- name: Run build
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/check-address-sanitizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install build depends
run: |
echo "APT::Get::Always-Include-Phased-Updates \"true\";" | sudo tee /etc/apt/apt.conf.d/90phased-updates
sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list
sudo apt update
sudo apt -y install python3-rich python3-coverage python3-pytest python3-pytest-cov curl meson gcovr expect libcmocka-dev python3-cffi libpython3-dev
sudo apt -y build-dep netplan.io
sudo apt -y install curl expect ubuntu-dev-tools devscripts equivs
pull-lp-source netplan.io
mk-build-deps -i -B -s sudo netplan.io-*/debian/control

- name: Run unit tests
run: |
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/check-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ jobs:
- name: Install build depends
run: |
echo "APT::Get::Always-Include-Phased-Updates \"true\";" | sudo tee /etc/apt/apt.conf.d/90phased-updates
sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list
sudo apt update
sudo apt install python3-rich python3-coverage python3-pytest python3-pytest-cov curl meson gcovr expect libcmocka-dev python3-cffi libpython3-dev
sudo apt build-dep netplan.io
sudo apt install curl expect ubuntu-dev-tools devscripts equivs gcovr
pull-lp-source netplan.io
mk-build-deps -i -B -s sudo netplan.io-*/debian/control
rm -rf netplan.io-*/
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gcovr/gcovr_5.2-1_all.deb
sudo dpkg -i gcovr*.deb # we need newer gcovr to make the gcovr.cfg:exclude setting work

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list
echo "APT::Get::Always-Include-Phased-Updates \"true\";" | sudo tee /etc/apt/apt.conf.d/90phased-updates
sudo apt update
sudo apt -y build-dep netplan.io
sudo apt -y install libcmocka-dev meson python3-pytest curl python3-cffi libpython3-dev
sudo apt -y install curl
pull-lp-source netplan.io
mk-build-deps -i -B -s sudo netplan.io-*/debian/control
- name: Download Coverity
run: |
curl https://scan.coverity.com/download/cxx/linux64 --no-progress-meter --output ${HOME}/coverity.tar.gz --data "token=${{ secrets.COVERITY_TOKEN }}&project=Netplan"
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/debci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: |
git fetch --unshallow --tags
# Install openvswitch-switch to make the OVS integration tests work
# Install linux-modules-extra-azure to provide the 'vrf' kernel module,
# it's needed (will be auto-loaded) by routing.test_vrf_basic
- name: Install dependencies
run: |
sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list
sudo apt update
sudo apt install debci lxc lxc-templates debian-archive-keyring autopkgtest ubuntu-dev-tools devscripts linux-modules-extra-$(uname -r) #openvswitch-switch
# See: https://discourse.ubuntu.com/t/containers-lxc/11526 (Apparmor section)
Expand All @@ -46,10 +45,11 @@ jobs:
- name: Prepare test
run: |
# pull-debian-source netplan.io # snapshot.debian.org is not up-to-date
V=$(rmadison -u debian -s unstable netplan.io | cut -d"|" -f2 | xargs)
V=$(rmadison -u debian -s unstable netplan.io | tail -n1 | cut -d"|" -f2 | xargs)
dget -u "https://deb.debian.org/debian/pool/main/n/netplan.io/netplan.io_$V.dsc"
cp -r netplan.io-*/debian .
rm -r debian/patches/ # clear any distro patches
sed -i 's|rm debian/tmp/lib/netplan/generate|# DELETED|' debian/rules
TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) # find latest (stable) tag
REV=$(git rev-parse --short HEAD) # get current git revision
VER="$TAG+git~$REV"
Expand All @@ -58,4 +58,5 @@ jobs:
run: |
# using --setup-commands='apt -y install ...' temporarily to install
# (test-/build-) deps until they become part of the packaging
sudo autopkgtest . -U --env=DPKG_GENSYMBOLS_CHECK_LEVEL=0 --env=DEB_BUILD_OPTIONS=nocheck --setup-commands='apt -y install python3-cffi libpython3-dev' -- lxc autopkgtest-testing-amd64 || test $? -eq 2 # allow OVS test to be skipped (exit code = 2)
sudo autopkgtest . \
-U --env=DPKG_GENSYMBOLS_CHECK_LEVEL=0 --env=DEB_BUILD_OPTIONS=nocheck -- lxc autopkgtest-testing-amd64 || test $? -eq 2 # allow OVS test to be skipped (exit code = 2)
12 changes: 9 additions & 3 deletions .github/workflows/network-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,19 @@ jobs:
# it's needed (will be auto-loaded) by routing.test_vrf_basic
- name: Install dependencies
run: |
sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list
sudo apt update
sudo apt install autopkgtest ubuntu-dev-tools devscripts openvswitch-switch linux-modules-extra-$(uname -r)
- name: Prepare test
run: |
pull-lp-source netplan.io
cp -r netplan.io-*/debian .
rm -r debian/patches/ # clear any distro patches
# usrmerge-fix
mkdir debian/extra
touch debian/extra/PLACEHOLDER
echo "../extra/PLACEHOLDER usr/lib/netplan/PLACEHOLDER" >> debian/extra/PLACEHOLDER
sed -i 's|rm debian/tmp/lib/netplan/generate|sh -c "mkdir -p debian/tmp/usr/lib/systemd/system-generators; rm -rf debian/tmp/lib; ln -sf /usr/libexec/netplan/generate debian/tmp/usr/lib/systemd/system-generators/netplan"|' debian/rules
# usrmerge-fix-end
echo "3.0 (native)" > debian/source/format # force native build
TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) # find latest (stable) tag
REV=$(git rev-parse --short HEAD) # get current git revision
Expand All @@ -54,7 +59,7 @@ jobs:
with:
docker-image: ubuntu:mantic
buildpackage-opts: --build=binary --no-sign
extra-build-deps: python3-cffi libpython3-dev
#extra-build-deps: python3-cffi libpython3-dev
# work around LP: #1878225 as fallback
- name: Preparing autopkgtest-build-lxd
run: |
Expand All @@ -64,4 +69,5 @@ jobs:
run: |
# using --setup-commands temporarily to install:
# cmocka/pytest/rich/ethtool until they become proper test-deps
sudo autopkgtest -U debian/artifacts/*.deb network-manager --apt-pocket=proposed=src:network-manager -- lxd autopkgtest/ubuntu/mantic/amd64 || test $? -eq 2 # allow for skipped tests (exit code = 2)
sudo autopkgtest -U debian/artifacts/*.deb \
network-manager --apt-pocket=proposed=src:network-manager -- lxd autopkgtest/ubuntu/mantic/amd64 || test $? -eq 2 # allow for skipped tests (exit code = 2)
2 changes: 1 addition & 1 deletion .github/workflows/spread.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: canonical/[email protected]
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install spread
run: |
go install github.com/snapcore/spread/cmd/spread@latest
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ clean:
rm -rf _build
rm -rf _build-cov
rm -rf _leakcheckbuild
rm -rf _cleanbuild
rm -rf tmproot
rm -f python-cffi/netplan/_netplan_cffi.*
rm -f tools/keyfile_to_yaml

dist: clean _build
tar --exclude="_build" --exclude=".git" --exclude="debian" --exclude=".vscode" -cvJf ../netplan-$(VER).tar.xz .
Expand Down
14 changes: 0 additions & 14 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
- improve IPv6 RA handling

- support tunnel device types

- support ethtool/sysctl knobs (TSO, LRO, txqueuelen)

- inspecting current network config via "netplan show $interface" for a
Expand All @@ -11,10 +9,6 @@
- netplan diff system: compare generated config with current ip addr output
- netplan diff backend: compare generated config with current config for backend

- support other devices types from networkd/NetworkManager:
- infiniband
- veth

- better handle VLAN Q-in-Q (mostly generation tweaks + patching backends)

- support device aliases (eth0 + eth0.1; add eth0 to multiple bridges)
Expand All @@ -26,22 +20,14 @@

- better parsing/validation for time-based values (ie. bond, bridge params)

- openvswitch integration

- wpa enterprise support

- better parsing/validation for all schema

- improve exit codes / behavior on error

- integrate 'netplan try' in tmux/screen

- add automated integration tests for WPA Enterprise / 802.1x that can run self-contained

# After soname bump (ABI break)

- get rid of abi_compat.c

- change route->scope to ENUM

- move tunnel_ttl into tunnel struct
Expand Down
Loading
Loading