From d95d89c7af063eaba4cd43d7a25872daf4b06130 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 20 Jul 2023 21:46:38 +0300 Subject: [PATCH 1/8] snapcraft: Use libyang 2.1.80 Signed-off-by: Donatas Abraitis --- snapcraft/snapcraft.yaml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snapcraft/snapcraft.yaml.in b/snapcraft/snapcraft.yaml.in index fa34304898..607cbc7fe3 100644 --- a/snapcraft/snapcraft.yaml.in +++ b/snapcraft/snapcraft.yaml.in @@ -302,7 +302,7 @@ parts: - libpcre2-8-0 source: https://github.com/CESNET/libyang.git source-type: git - source-tag: v2.0.7 + source-tag: v2.1.80 plugin: cmake configflags: - -DCMAKE_INSTALL_PREFIX:PATH=/usr From 86f1ec3f252a876978e0e171a583daa30198a32f Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 20 Jul 2023 21:52:26 +0300 Subject: [PATCH 2/8] debian: Require libyang 2.1.80 Signed-off-by: Donatas Abraitis --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 9b7dcfe418..22d08b315d 100644 --- a/debian/control +++ b/debian/control @@ -22,7 +22,7 @@ Build-Depends: bison, librtr-dev (>= 0.8.0~) , libsnmp-dev, libssh-dev , - libyang2-dev, + libyang2-dev (>= 2.1.80), lsb-base, pkg-config, python3:native, From 8014544e2a0b461bde2bfff53a47a21a7535e740 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 20 Jul 2023 21:54:22 +0300 Subject: [PATCH 3/8] redhat: Require libyang 2.1.80 Signed-off-by: Donatas Abraitis --- redhat/frr.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redhat/frr.spec.in b/redhat/frr.spec.in index 4dec84b8fb..9d1c399f2e 100644 --- a/redhat/frr.spec.in +++ b/redhat/frr.spec.in @@ -184,7 +184,7 @@ BuildRequires: make BuildRequires: ncurses-devel BuildRequires: readline-devel BuildRequires: texinfo -BuildRequires: libyang2-devel +BuildRequires: libyang-devel >= 2.1.80 %if 0%{?rhel} && 0%{?rhel} < 7 #python27-devel is available from ius community repo for RedHat/CentOS 6 BuildRequires: python27-devel From b775e359bcf43ee54cc9153a080a2778f104e4d0 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 20 Jul 2023 22:10:19 +0300 Subject: [PATCH 4/8] docker: Use libyang 2.1.80 Signed-off-by: Donatas Abraitis --- docker/alpine/libyang/APKBUILD | 2 +- docker/centos-8/Dockerfile | 6 +++--- docker/ubi8-minimal/Dockerfile | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docker/alpine/libyang/APKBUILD b/docker/alpine/libyang/APKBUILD index aa792e7f0b..04e943fe48 100755 --- a/docker/alpine/libyang/APKBUILD +++ b/docker/alpine/libyang/APKBUILD @@ -1,7 +1,7 @@ # Contributor: Sören Tempel # Maintainer: Christian Franke pkgname=libyang -pkgver=2.0.194 +pkgver=2.1.80 pkgrel=0 pkgdesc="YANG data modelling language parser and toolkit" url="https://github.com/CESNET/libyang" diff --git a/docker/centos-8/Dockerfile b/docker/centos-8/Dockerfile index 88a7d6a007..baed1fe4f3 100644 --- a/docker/centos-8/Dockerfile +++ b/docker/centos-8/Dockerfile @@ -10,8 +10,8 @@ RUN dnf install --enablerepo=powertools -y rpm-build git autoconf pcre-devel \ groff pkgconfig json-c-devel pam-devel bison flex python3-pytest \ c-ares-devel python3-devel python3-sphinx libcap-devel platform-python-devel \ protobuf-c-devel \ - https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-2/CentOS-8-x86_64-Packages/libyang2-2.0.0.10.g2eb910e4-1.el8.x86_64.rpm \ - https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-2/CentOS-8-x86_64-Packages/libyang2-devel-2.0.0.10.g2eb910e4-1.el8.x86_64.rpm \ + https://ci1.netdef.org/artifact/LIBYANG-LIBYANG2/shared/build-00181/RedHat-8-x86_64-Packages/libyang-2.1.80-1.el8.x86_64.rpm \ + https://ci1.netdef.org/artifact/LIBYANG-LIBYANG2/shared/build-00181/RedHat-8-x86_64-Packages/libyang-devel-2.1.80-1.el8.x86_64.rpm \ https://ci1.netdef.org/artifact/RPKI-RTRLIB/shared/build-00146/CentOS-7-x86_64-Packages/librtr-0.8.0-1.el7.x86_64.rpm \ https://ci1.netdef.org/artifact/RPKI-RTRLIB/shared/build-00146/CentOS-7-x86_64-Packages/librtr-devel-0.8.0-1.el7.x86_64.rpm @@ -42,7 +42,7 @@ RUN sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-* \ && sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-* RUN mkdir -p /pkgs/rpm \ - && yum install -y https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-2/CentOS-8-x86_64-Packages/libyang2-2.0.0.10.g2eb910e4-1.el8.x86_64.rpm \ + && yum install -y https://ci1.netdef.org/artifact/LIBYANG-LIBYANG2/shared/build-00181/RedHat-8-x86_64-Packages/libyang-2.1.80-1.el8.x86_64.rpm \ https://ci1.netdef.org/artifact/RPKI-RTRLIB/shared/build-00146/CentOS-7-x86_64-Packages/librtr-0.8.0-1.el7.x86_64.rpm COPY --from=centos-8-builder /rpmbuild/RPMS/ /pkgs/rpm/ diff --git a/docker/ubi8-minimal/Dockerfile b/docker/ubi8-minimal/Dockerfile index adb04219be..0b7d16c3d1 100644 --- a/docker/ubi8-minimal/Dockerfile +++ b/docker/ubi8-minimal/Dockerfile @@ -39,11 +39,11 @@ RUN microdnf --disableplugin=subscription-manager --setopt=install_weak_deps=0 i tzdata \ && microdnf --disableplugin=subscription-manager clean all -RUN curl -sSL -o /tmp/libyang2.rpm https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-12/RedHat-8-x86_64-Packages/libyang2-2.0.7-1.el8.x86_64.rpm \ +RUN curl -sSL -o /tmp/libyang2.rpm https://ci1.netdef.org/artifact/LIBYANG-LIBYANG2/shared/build-181/RedHat-8-x86_64-Packages/libyang-2.1.80-1.el8.x86_64.rpm \ && rpm -i /tmp/libyang2.rpm \ && rm -f /tmp/libyang2.rpm -RUN curl -sSL -o /tmp/libyang2-devel.rpm https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-12/RedHat-8-x86_64-Packages/libyang2-devel-2.0.7-1.el8.x86_64.rpm \ +RUN curl -sSL -o /tmp/libyang2-devel.rpm https://ci1.netdef.org/artifact/LIBYANG-LIBYANG2/shared/build-181/RedHat-8-x86_64-Packages/libyang-devel-2.1.80-1.el8.x86_64.rpm \ && rpm -i /tmp/libyang2-devel.rpm \ && rm -f /tmp/libyang2-devel.rpm @@ -102,7 +102,7 @@ RUN microdnf --disableplugin=subscription-manager --setopt=install_weak_deps=0 i systemd \ && microdnf --disableplugin=subscription-manager clean all -RUN curl -sSL -o /tmp/libyang2.rpm https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-12/RedHat-8-x86_64-Packages/libyang2-2.0.7-1.el8.x86_64.rpm \ +RUN curl -sSL -o /tmp/libyang2.rpm https://ci1.netdef.org/artifact/LIBYANG-LIBYANG2/shared/build-181/RedHat-8-x86_64-Packages/libyang-2.1.80-1.el8.x86_64.rpm \ && rpm -i /tmp/libyang2.rpm \ && rm -f /tmp/libyang2.rpm From 61cac0a627589450fb2e0434e7f53987fdce1ec1 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 20 Jul 2023 22:11:03 +0300 Subject: [PATCH 5/8] docker: Use Alpine Linux 3.18 It has the newer libyang version 2.1.55, while 3.17 has 2.1.30. 3.19 will have 2.1.80. Signed-off-by: Donatas Abraitis --- docker/alpine/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/alpine/Dockerfile b/docker/alpine/Dockerfile index 54621a49fd..6268d83936 100644 --- a/docker/alpine/Dockerfile +++ b/docker/alpine/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 # Create a basic stage set up to build APKs -FROM alpine:3.17 as alpine-builder +FROM alpine:3.18 as alpine-builder RUN apk add \ --update-cache \ abuild \ @@ -13,7 +13,7 @@ RUN apk add \ RUN adduser -D -G abuild builder && su builder -c 'abuild-keygen -a -n' # This stage builds a dist tarball from the source -FROM alpine:3.17 as source-builder +FROM alpine:3.18 as source-builder RUN mkdir -p /src/alpine COPY alpine/APKBUILD.in /src/alpine @@ -49,7 +49,7 @@ RUN cd /dist \ && abuild -r -P /pkgs/apk # This stage installs frr from the apk -FROM alpine:3.17 +FROM alpine:3.18 RUN mkdir -p /pkgs/apk COPY --from=alpine-apk-builder /pkgs/apk/ /pkgs/apk/ RUN apk add \ From 6b59d69cb229a93368ed9afa08b8be59aa4665fe Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 20 Jul 2023 22:33:10 +0300 Subject: [PATCH 6/8] docker: Install protobuf-c-devel for ubi8-minimal configure: error: in `/src': configure: error: protobuf requested but protoc-c not found. Install protobuf-c. See `config.log' for more details Signed-off-by: Donatas Abraitis --- docker/ubi8-minimal/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/ubi8-minimal/Dockerfile b/docker/ubi8-minimal/Dockerfile index 0b7d16c3d1..53f8d25697 100644 --- a/docker/ubi8-minimal/Dockerfile +++ b/docker/ubi8-minimal/Dockerfile @@ -37,6 +37,7 @@ RUN microdnf --disableplugin=subscription-manager --setopt=install_weak_deps=0 i systemd-devel \ texinfo \ tzdata \ + protobuf-c-devel \ && microdnf --disableplugin=subscription-manager clean all RUN curl -sSL -o /tmp/libyang2.rpm https://ci1.netdef.org/artifact/LIBYANG-LIBYANG2/shared/build-181/RedHat-8-x86_64-Packages/libyang-2.1.80-1.el8.x86_64.rpm \ From 31b91c9ba0f2c9459489de482ad4c339c19e146f Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 20 Jul 2023 22:39:14 +0300 Subject: [PATCH 7/8] docker: Move Alpine dependency packages to APKBUILD file Do not mix APKBUILD and Dockerfile when installing dependencies. Signed-off-by: Donatas Abraitis --- alpine/APKBUILD.in | 2 +- docker/alpine/Dockerfile | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/alpine/APKBUILD.in b/alpine/APKBUILD.in index fd3c02f47e..660a118279 100644 --- a/alpine/APKBUILD.in +++ b/alpine/APKBUILD.in @@ -19,7 +19,7 @@ makedepends="ncurses-dev net-snmp-dev gawk texinfo perl perl pkgconf python3 python3-dev readline readline-dev sqlite-libs pcre2-dev squashfs-tools sudo tar texinfo xorriso xz-libs py-pip rtrlib rtrlib-dev py3-sphinx elfutils elfutils-dev libyang-dev protobuf-c-compiler protobuf-c-dev - lua5.3-dev lua5.3" + lua5.3-dev lua5.3 gzip" checkdepends="pytest py-setuptools" install="$pkgname.pre-install $pkgname.pre-deinstall $pkgname.post-deinstall" subpackages="$pkgname-dev $pkgname-doc $pkgname-dbg" diff --git a/docker/alpine/Dockerfile b/docker/alpine/Dockerfile index 6268d83936..b8c79682b1 100644 --- a/docker/alpine/Dockerfile +++ b/docker/alpine/Dockerfile @@ -22,10 +22,6 @@ RUN source /src/alpine/APKBUILD.in \ --no-cache \ --update-cache \ $makedepends \ - gzip \ - py-pip \ - rtrlib \ - protobuf-c-dev \ && pip install pytest RUN mkdir -p /pkgs/apk COPY . /src From 997a31c57730bfd9d125dcce52a05fd7b0f25bc3 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 20 Jul 2023 23:16:38 +0300 Subject: [PATCH 8/8] docker: Use libyang 2.1.80 for Alpine builds Signed-off-by: Donatas Abraitis --- alpine/APKBUILD.in | 2 +- docker/alpine/Dockerfile | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/alpine/APKBUILD.in b/alpine/APKBUILD.in index 660a118279..63fb5c46b9 100644 --- a/alpine/APKBUILD.in +++ b/alpine/APKBUILD.in @@ -18,7 +18,7 @@ makedepends="ncurses-dev net-snmp-dev gawk texinfo perl ncurses-libs ncurses-terminfo ncurses-terminfo-base patch pax-utils pcre2 perl pkgconf python3 python3-dev readline readline-dev sqlite-libs pcre2-dev squashfs-tools sudo tar texinfo xorriso xz-libs py-pip rtrlib rtrlib-dev - py3-sphinx elfutils elfutils-dev libyang-dev protobuf-c-compiler protobuf-c-dev + py3-sphinx elfutils elfutils-dev protobuf-c-compiler protobuf-c-dev lua5.3-dev lua5.3 gzip" checkdepends="pytest py-setuptools" install="$pkgname.pre-install $pkgname.pre-deinstall $pkgname.post-deinstall" diff --git a/docker/alpine/Dockerfile b/docker/alpine/Dockerfile index b8c79682b1..d1c3060069 100644 --- a/docker/alpine/Dockerfile +++ b/docker/alpine/Dockerfile @@ -12,18 +12,29 @@ RUN apk add \ && echo 'builder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers RUN adduser -D -G abuild builder && su builder -c 'abuild-keygen -a -n' +# This stage builds an APK for libyang +FROM alpine-builder as alpine-apk-builder-libyang +RUN mkdir -p /src/libyang +COPY docker/alpine/libyang/APKBUILD /src/libyang +RUN chown -R builder /pkgs /src +USER builder +RUN cd /src/libyang \ + && abuild checksum \ + && git init \ + && abuild -r -P /pkgs/apk + # This stage builds a dist tarball from the source FROM alpine:3.18 as source-builder - -RUN mkdir -p /src/alpine +RUN mkdir -p /src/alpine /pkgs/apk COPY alpine/APKBUILD.in /src/alpine +COPY --from=alpine-apk-builder-libyang /pkgs/apk/src /pkgs/apk +RUN cd /pkgs/apk/x86_64 && apk add --allow-untrusted *.apk RUN source /src/alpine/APKBUILD.in \ && apk add \ --no-cache \ --update-cache \ $makedepends \ && pip install pytest -RUN mkdir -p /pkgs/apk COPY . /src ARG PKGVER RUN cd /src \ @@ -36,6 +47,8 @@ RUN cd /src \ # This stage builds an APK from the dist tarball FROM alpine-builder as alpine-apk-builder COPY --from=source-builder /src/frr-*.tar.gz /src/alpine/* /dist/ +COPY --from=alpine-apk-builder-libyang /pkgs/apk/src /pkgs/apk +RUN cd /pkgs/apk/x86_64 && apk add --allow-untrusted *.apk RUN find /pkgs/apk -type f -name APKINDEX.tar.gz -delete RUN chown -R builder /dist /pkgs USER builder