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

Reduce memory footprint of build #391

Closed
tgraf opened this issue Mar 21, 2017 · 4 comments
Closed

Reduce memory footprint of build #391

tgraf opened this issue Mar 21, 2017 · 4 comments
Assignees
Labels
kind/bug This is a bug in the Cilium logic.

Comments

@tgraf
Copy link
Member

tgraf commented Mar 21, 2017

The build currently requires between 3-4GB of memory which is completely insane.

@tgraf tgraf added kind/bug This is a bug in the Cilium logic. release blocker labels Mar 21, 2017
@tgraf tgraf added this to the 0.8 release milestone Mar 21, 2017
@aanm
Copy link
Member

aanm commented Mar 22, 2017

What is the OS?
I'm able to build in our vagrant box with 2GB (1GB Free):

vagrant@cilium-k8s-master:~/go/src/github.com/cilium/cilium$ make clean
...
vagrant@cilium-k8s-master:~/go/src/github.com/cilium/cilium$ free -m
              total        used        free      shared  buff/cache   available
Mem:           2000         613         947          24         438        1163
Swap:             0           0           0
vagrant@cilium-k8s-master:~/go/src/github.com/cilium/cilium$ make
if [ "go1.7.4" = "go1.8" ]; then \
        echo "golang 1.8 is currently not supported, please downgrade to a lower version"; \
        exit 1; \
fi
make[1]: Entering directory '/home/vagrant/go/src/github.com/cilium/cilium/plugins'
make[2]: Entering directory '/home/vagrant/go/src/github.com/cilium/cilium/plugins/cilium-docker'
go build  -ldflags "-X "github.com/cilium/cilium/common".Version=0.1.0.dev" -o cilium-docker
make[2]: Leaving directory '/home/vagrant/go/src/github.com/cilium/cilium/plugins/cilium-docker'
make[2]: Entering directory '/home/vagrant/go/src/github.com/cilium/cilium/plugins/cilium-cni'
go build  -o cilium-cni ./cilium-cni.go
make[2]: Leaving directory '/home/vagrant/go/src/github.com/cilium/cilium/plugins/cilium-cni'
make[1]: Leaving directory '/home/vagrant/go/src/github.com/cilium/cilium/plugins'
make[1]: Entering directory '/home/vagrant/go/src/github.com/cilium/cilium/bpf'
clang -Iinclude -D__NR_CPUS__=2 -O2 -target bpf -I. -Wall -Werror -Wno-address-of-packed-member -Wno-unknown-warning-option -c bpf_lxc.c -o bpf_lxc.o
clang -Iinclude -D__NR_CPUS__=2 -O2 -target bpf -I. -Wall -Werror -Wno-address-of-packed-member -Wno-unknown-warning-option -c bpf_netdev.c -o bpf_netdev.o
clang -Iinclude -D__NR_CPUS__=2 -O2 -target bpf -I. -Wall -Werror -Wno-address-of-packed-member -Wno-unknown-warning-option -c bpf_overlay.c -o bpf_overlay.o
clang -DLB_L3 -Iinclude -D__NR_CPUS__=2 -O2 -target bpf -I. -Wall -Werror -Wno-address-of-packed-member -Wno-unknown-warning-option -c bpf_lb.c -o bpf_lb.o;  clang -DLB_L4 -Iinclude -D__NR_CPUS__=2 -O2 -target bpf -I. -Wall -Werror -Wno-address-of-packed-member -Wno-unknown-warning-option -c bpf_lb.c -o bpf_lb.o;  clang -DLB_L3 -Iinclude -D__NR_CPUS__=2 -O2 -target bpf -I. -Wall -Werror -Wno-address-of-packed-member -Wno-unknown-warning-option -c bpf_lb.c -o bpf_lb.o;  clang -DLB_L4 -Iinclude -D__NR_CPUS__=2 -O2 -target bpf -I. -Wall -Werror -Wno-address-of-packed-member -Wno-unknown-warning-option -c bpf_lb.c -o bpf_lb.o;
make[1]: Leaving directory '/home/vagrant/go/src/github.com/cilium/cilium/bpf'
make[1]: Entering directory '/home/vagrant/go/src/github.com/cilium/cilium/cilium'
go build  -ldflags "-X "github.com/cilium/cilium/common".Version=0.1.0.dev" -o cilium
make[1]: Leaving directory '/home/vagrant/go/src/github.com/cilium/cilium/cilium'
make[1]: Entering directory '/home/vagrant/go/src/github.com/cilium/cilium/daemon'
go build  -ldflags "-X "github.com/cilium/cilium/common".Version=0.1.0.dev" -o cilium-agent
make[1]: Leaving directory '/home/vagrant/go/src/github.com/cilium/cilium/daemon'
vagrant@cilium-k8s-master:~/go/src/github.com/cilium/cilium$ free -m
              total        used        free      shared  buff/cache   available
Mem:           2000         612         916          24         470        1164
Swap:             0           0           0

@tgraf
Copy link
Member Author

tgraf commented Mar 22, 2017

I'm using go version go1.7.5 linux/amd64 on FC25. The build only quickly peaks at using > 2G mem when linking cilium-agent. Running free -m afterwards will not show the real footprint. I'm sometimes crossing 3G limit when building with the vulcand dependencies for the HTTP stuff.

@tgraf tgraf modified the milestones: 0.9, 0.8 release Mar 31, 2017
@tgraf
Copy link
Member Author

tgraf commented Mar 31, 2017

Based on some research, one of the main reasons is the linking to the kubernetes go-client which pulls in a huge dependency chain.

@tgraf tgraf modified the milestones: 0.10, 0.9 May 9, 2017
@tgraf
Copy link
Member Author

tgraf commented Jun 6, 2017

This is no longer a big issue, closing.

@tgraf tgraf closed this as completed Jun 6, 2017
michi-covalent pushed a commit to michi-covalent/cilium that referenced this issue May 30, 2023
Following merge of cilium#400, we broke cilium#391.

This PR fixes the issue by refactoring both EKS workflows to be
consistent with other workflows, now that we are creating a cluster with
nodes available right away just like on other platforms, and thus do not
need to split the `install`/`test` steps anymore.

Fixes 3d2fbdbecb22b37b32417b6a548be1ae212ba3e5

Signed-off-by: Nicolas Busseneau <nicolas@isovalent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is a bug in the Cilium logic.
Projects
None yet
Development

No branches or pull requests

2 participants