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

frr: Remove FRR container creation #67

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 0 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
ARG IMAGE=scratch
FROM ${IMAGE} AS frr
# size reduction hack
RUN for frr in /nix/store/*-frr-*; do \
ln -s "${frr}" "$(sed 's|/nix/store/.*-\(.*-frr-.*\)|/nix/store/\1|' <<<"${frr}")"; \
done
FROM ${IMAGE} AS doc-env
FROM ${IMAGE} AS compile-env

Expand Down
58 changes: 0 additions & 58 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -270,22 +270,6 @@ rec {
"--disable-shared"
];
});
frr =
(buildWithMyFlags (
self.callPackage ./nix/frr {
stdenv = fancy.stdenvDynamic;
json_c = json_c.dev;
}
)).overrideAttrs
(orig: {
nativeBuildInputs = (orig.nativeBuildInputs or [ ]) ++ [
self.fancy.pcre2
self.protobufc
];
LDFLAGS =
(orig.LDFLAGS or "")
+ " -L${self.protobufc}/lib -Wl,-lprotobuf-c -L${self.fancy.pcre2}/lib -Wl,-lpcre2-8";
});
};

pkgs.dev =
Expand Down Expand Up @@ -538,49 +522,7 @@ rec {

maxLayers = 120;

initfrr = toolchainPkgs.stdenv.mkDerivation {
name = "${project-name}-initfrr";
src = ./nix/frr/bin;
dontUnpack = true;
installPhase = ''
mkdir -p $out/bin
cp $src/init.sh $out/bin/init.sh
chmod +x $out/bin/init.sh
'';
};

frrContainerContents = (
with pkgs.release.gnu64;
[
bash
coreutils
frr
glibc.bin
glibc.out
gnugrep
gnused
initfrr
libxcrypt
ncurses
readline
tmpdir
]
);

container = {
frr = toolchainPkgs.dockerTools.buildLayeredImage {
name = "${contianer-repo}/frr";
tag = "${image-tag}";
contents = map clearDeps frrContainerContents;
config = {
Env = [
"LD_LIBRARY_PATH=/lib"
"PATH=/bin:/libexec/frr"
];
Entrypoint = [ "/bin/init.sh" ];
};
inherit maxLayers;
};
compile-env = toolchainPkgs.dockerTools.buildLayeredImage {
name = "${contianer-repo}/compile-env";
tag = "${image-tag}";
Expand Down
12 changes: 1 addition & 11 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ _doc_env_container_name := container_repo + "/doc-env"

_compile_env_container_name := container_repo + "/compile-env"

_frr_container_name := container_repo + "/frr"

# This is a unique identifier for the build.
# We temporarily tag our containers with this id so that we can be certain that we are
# not retagging or pushing some other container.
Expand Down Expand Up @@ -127,9 +125,6 @@ build-sysroot: \
# Build doc env packages
build-docEnvPackageList: (_nix_build "docEnvPackageList")

# Build FRR
build-frr-contents: (_nix_build "frrContainerContents")

# Builds and post processes a container from the nix build
[private]
[script]
Expand Down Expand Up @@ -193,11 +188,8 @@ build-doc-env-container: build-docEnvPackageList (_build-container "doc-env" _do
# Build and tag the compile-env container
build-compile-env-container: build-sysroot (_build-container "compile-env" _compile_env_container_name)

# Build and tag the frr container
build-frr-container: build-frr-contents (_build-container "frr" _frr_container_name)

# Build the sysroot, and compile-env containers
build: build-sysroot build-frr-container build-compile-env-container build-doc-env-container
build: build-sysroot build-compile-env-container build-doc-env-container

# Push the compile-env and doc-env containers to the container registry
[script]
Expand All @@ -207,8 +199,6 @@ push: build
docker push "{{ _compile_env_container_name }}:{{ _commit }}.rust-{{ rust }}"
docker push "{{ _doc_env_container_name }}:{{ _slug }}.rust-{{ rust }}"
docker push "{{ _doc_env_container_name }}:{{ _commit }}.rust-{{ rust }}"
docker push "{{ _frr_container_name }}:{{ _slug }}.rust-{{ rust }}"
docker push "{{ _frr_container_name }}:{{ _commit }}.rust-{{ rust }}"

# Delete all the old generations of the nix store and run the garbage collector
[script]
Expand Down
8 changes: 0 additions & 8 deletions nix/frr/bin/init.sh

This file was deleted.

66 changes: 0 additions & 66 deletions nix/frr/clippy-helper.nix

This file was deleted.

Loading