-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
metallb version: v0.14.8 frr version: 9.0.2
- Loading branch information
1 parent
aa20629
commit ee44e63
Showing
5 changed files
with
288 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
name: frr | ||
summary: Rock for FRRouting. | ||
description: > | ||
This rock is a drop in replacement for the | ||
quay.io/frrouting/frr image. | ||
version: 9.1.0 | ||
license: Apache-2.0 | ||
|
||
base: ubuntu@22.04 | ||
build-base: ubuntu@22.04 | ||
platforms: | ||
amd64: | ||
arm64: | ||
|
||
entrypoint-service: frr | ||
services: | ||
frr: | ||
command: /usr/sbin/docker-start [ -h ] | ||
override: replace | ||
startup: enabled | ||
|
||
parts: | ||
build-deps: | ||
plugin: nil | ||
build-packages: | ||
# Basic build requirements from documentation | ||
- autoconf | ||
- automake | ||
- bison | ||
- build-essential | ||
- flex | ||
- git | ||
- install-info | ||
- libc-ares-dev | ||
- libcap-dev | ||
- libelf-dev | ||
- libjson-c-dev | ||
- libpam0g-dev | ||
- libreadline-dev | ||
- libsnmp-dev | ||
- libsqlite3-dev | ||
- libtool | ||
- make | ||
- perl | ||
- pkg-config | ||
- python3-dev | ||
- python3-sphinx | ||
- texinfo | ||
# Protobuf build requirements | ||
- libprotobuf-c-dev | ||
- protobuf-c-compiler | ||
# Libyang2 extra build requirements | ||
- cmake | ||
- libpcre2-dev | ||
# GRPC extra build requirements | ||
- libgrpc-dev | ||
- libgrpc++-dev | ||
- protobuf-compiler-grpc | ||
# additional requirements | ||
- liblua5.3-dev | ||
- libssl-dev | ||
- lua5.3 | ||
- librtr-dev | ||
|
||
users: | ||
after: [build-deps] | ||
plugin: nil | ||
overlay-script: | | ||
groupadd -R $CRAFT_OVERLAY -r -g 92 frr | ||
groupadd -R $CRAFT_OVERLAY -r -g 85 frrvty | ||
useradd -R $CRAFT_OVERLAY -r -u 92 -g 85 \ | ||
-d /home/frr -s /bin/bash -m frr | ||
usermod -R $CRAFT_OVERLAY -a -G frrvty frr | ||
mkdir -p $CRAFT_OVERLAY/etc/sudoers.d | ||
echo 'frr ALL = NOPASSWD: ALL' | tee $CRAFT_OVERLAY/etc/sudoers.d/frr | ||
libyang: | ||
after: [users] | ||
plugin: nil | ||
source-type: git | ||
source: https://github.com/CESNET/libyang.git | ||
source-tag: v2.1.128 | ||
source-depth: 1 | ||
override-build: | | ||
mkdir -p build | ||
cd build | ||
mkdir -p $CRAFT_PART_INSTALL/usr | ||
cmake -DCMAKE_INSTALL_PREFIX:PATH=$CRAFT_PART_INSTALL/usr \ | ||
-DCMAKE_BUILD_TYPE:String="Release" .. | ||
make -j $(nproc) | ||
make install | ||
frr: | ||
after: [libyang] | ||
plugin: nil | ||
source-type: git | ||
source: https://github.com/FRRouting/frr | ||
source-tag: docker/9.1.0 | ||
source-depth: 1 | ||
override-build: | | ||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CRAFT_STAGE/usr/lib | ||
./bootstrap.sh | ||
./configure \ | ||
--prefix=$CRAFT_PART_INSTALL/usr \ | ||
--sysconfdir=/etc \ | ||
--localstatedir=/var \ | ||
--sbindir=$CRAFT_PART_INSTALL/usr/lib/frr \ | ||
--enable-rpki \ | ||
--enable-vtysh \ | ||
--enable-multipath=64 \ | ||
--enable-vty-group=frrvty \ | ||
--enable-user=frr \ | ||
--enable-group=frr \ | ||
--enable-scripting | ||
make -j $(nproc) | ||
make install | ||
mkdir -p $CRAFT_PART_INSTALL/usr/sbin | ||
cp $CRAFT_PART_SRC/docker/debian/docker-start \ | ||
$CRAFT_PART_INSTALL/usr/sbin/docker-start | ||
runtime-deps: | ||
plugin: nil | ||
stage-packages: | ||
- libc-ares2 | ||
- libcap2 | ||
- libjson-c5 | ||
- libpam0g | ||
- libreadline8 | ||
- libsnmp40 | ||
- libsqlite3-0 | ||
- libprotobuf-c1 | ||
- libpcre2-posix3 | ||
- libgrpc++1 | ||
- libgrpc10 | ||
- liblua5.3-0 | ||
- lua5.3 | ||
- libssl3 | ||
- librtr0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: metallb-controller | ||
summary: Rock for the Metallb controller. | ||
description: > | ||
This rock is a drop in replacement for the | ||
quay.io/metallb/controller image. | ||
version: v0.14.8 | ||
license: Apache-2.0 | ||
|
||
base: bare | ||
build-base: ubuntu@22.04 | ||
platforms: | ||
amd64: | ||
arm64: | ||
|
||
entrypoint-service: controller | ||
services: | ||
controller: | ||
command: /controller [ -h ] | ||
override: replace | ||
startup: enabled | ||
|
||
parts: | ||
add-base-files: | ||
plugin: nil | ||
stage-packages: | ||
# Original Dockerfile uses gcr.io/distroless/static:latest as a base. | ||
# This image contains the following: | ||
# https://github.com/GoogleContainerTools/distroless/blob/1533e54a73805ec13fe0cc68218fc7a215a0a6f7/base/README.md | ||
- ca-certificates | ||
- tzdata | ||
- base-passwd | ||
|
||
# Can't have stage packages and stage slices together, apparently. | ||
add-base-slices: | ||
plugin: nil | ||
stage-packages: | ||
- base-files_tmp | ||
|
||
build-deps: | ||
plugin: nil | ||
build-snaps: | ||
- go/1.22/stable | ||
|
||
controller: | ||
after: [build-deps] | ||
plugin: go | ||
source-type: git | ||
source: https://github.com/metallb/metallb | ||
source-tag: v0.14.8 | ||
source-depth: 1 | ||
override-build: | | ||
GIT_COMMIT=`git rev-parse HEAD` | ||
# We'll use the tag name. | ||
GIT_BRANCH=`git describe --tags --abbrev=0` | ||
CGO_ENABLED=0 go build -v -o $CRAFT_PART_INSTALL/controller \ | ||
-ldflags "-X 'go.universe.tf/metallb/internal/version.gitCommit=${GIT_COMMIT}' -X 'go.universe.tf/metallb/internal/version.gitBranch=${GIT_BRANCH}'" \ | ||
./controller | ||
cp $CRAFT_PART_BUILD/LICENSE $CRAFT_PART_INSTALL/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: metallb-speaker | ||
summary: Rock for the Metallb speaker. | ||
description: > | ||
This rock is a drop in replacement for the | ||
quay.io/metallb/speaker image. | ||
version: v0.14.8 | ||
license: Apache-2.0 | ||
|
||
base: bare | ||
build-base: ubuntu@22.04 | ||
platforms: | ||
amd64: | ||
arm64: | ||
|
||
entrypoint-service: speaker | ||
services: | ||
speaker: | ||
command: /speaker [ -h ] | ||
override: replace | ||
startup: enabled | ||
|
||
parts: | ||
add-base-files: | ||
plugin: nil | ||
stage-packages: | ||
# Original Dockerfile uses gcr.io/distroless/static:latest as a base. | ||
# This image contains the following: | ||
# https://github.com/GoogleContainerTools/distroless/blob/1533e54a73805ec13fe0cc68218fc7a215a0a6f7/base/README.md | ||
- ca-certificates | ||
- tzdata | ||
- base-passwd | ||
# Helm charts may expect the image to be able to copy some files. | ||
- bash | ||
- coreutils | ||
override-build: | | ||
ln -sf bash "${CRAFT_PART_INSTALL}/bin/sh" | ||
# Can't have stage packages and stage slices together, apparently. | ||
add-base-slices: | ||
plugin: nil | ||
stage-packages: | ||
- base-files_tmp | ||
|
||
build-deps: | ||
plugin: nil | ||
build-snaps: | ||
- go/1.22/stable | ||
|
||
speaker: | ||
after: [build-deps] | ||
plugin: go | ||
source-type: git | ||
source: https://github.com/metallb/metallb | ||
source-tag: v0.14.8 | ||
source-depth: 1 | ||
override-build: | | ||
GIT_COMMIT=`git rev-parse HEAD` | ||
# We'll use the tag name. | ||
GIT_BRANCH=`git describe --tags --abbrev=0` | ||
# build frr metrics | ||
CGO_ENABLED=0 go build -v -o $CRAFT_PART_INSTALL/frr-metrics \ | ||
-ldflags "-X 'go.universe.tf/metallb/internal/version.gitCommit=${GIT_COMMIT}' -X 'go.universe.tf/metallb/internal/version.gitBranch=${GIT_BRANCH}'" \ | ||
./frr-tools/metrics/exporter.go | ||
# build speaker | ||
CGO_ENABLED=0 go build -v -o $CRAFT_PART_INSTALL/speaker \ | ||
-ldflags "-X 'go.universe.tf/metallb/internal/version.gitCommit=${GIT_COMMIT}' -X 'go.universe.tf/metallb/internal/version.gitBranch=${GIT_BRANCH}'" \ | ||
./speaker | ||
cp $CRAFT_PART_BUILD/LICENSE $CRAFT_PART_INSTALL/ | ||
cp $CRAFT_PART_SRC/frr-tools/reloader/frr-reloader.sh $CRAFT_PART_INSTALL/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters