forked from projectcalico/vpp-dataplane
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
110 lines (93 loc) · 3.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
check-%:
@: $(if $(value $*),,$(error $* is undefined))
.PHONY: build
build:
$(MAKE) -C calico-vpp-agent $@
$(MAKE) -C vpp-manager $@
.PHONY: image images
images: image
image:
$(MAKE) -C calico-vpp-agent $@
$(MAKE) -C vpp-manager $@
.PHONY: push
push:
$(MAKE) -C calico-vpp-agent $@
$(MAKE) -C vpp-manager $@
.PHONY: dev
dev:
$(MAKE) -C calico-vpp-agent $@
$(MAKE) -C vpp-manager $@
.PHONY: proto
proto:
$(MAKE) -C calico-vpp-agent $@
.PHONY: dev.k3s
dev.k3s: dev
@for x in node vpp ; do \
docker save -o /tmp/$$x.tar calicovpp/$$x:latest ; \
sudo k3s ctr images import /tmp/$$x.tar ; \
rm -f /tmp/$$x.tar ; \
done
.PHONY: install-test-deps
install-test-deps:
sudo apt-get update
sudo apt-get install -y jq nfs-kernel-server qemu-kvm libvirt-daemon-system \
libvirt-clients bridge-utils qemu ebtables dnsmasq-base libxslt-dev \
libxml2-dev libvirt-dev zlib1g-dev ruby-dev build-essential \
libguestfs-tools
sudo chmod a+r /boot/vmlinuz* # Required for libguestfs
sudo adduser `id -un` libvirt
sudo adduser `id -un` kvm
wget https://releases.hashicorp.com/vagrant/2.2.14/vagrant_2.2.14_x86_64.deb
sudo dpkg -i vagrant_2.2.14_x86_64.deb
rm vagrant_2.2.14_x86_64.deb
vagrant plugin install vagrant-libvirt
newgrp libvirt
.PHONY: start-test-cluster
start-test-cluster:
$(MAKE) -C test/vagrant up
.PHONY: load-images
load-images:
$(MAKE) -C test/vagrant load-image -j99 IMG=calicovpp/node:latest
$(MAKE) -C test/vagrant load-image -j99 IMG=calicovpp/vpp:latest
# Allows to simply run calico-vpp from release images in a test cluster
.PHONY: test-install-calicovpp
test-install-calicovpp:
kubectl kustomize yaml/overlays/test-vagrant | kubectl apply -f -
# Allows to run calico-vpp in a test cluster with locally-built binaries for dev / debug
.PHONY: test-install-calicovpp-dev
test-install-calicovpp-dev:
kubectl kustomize yaml/overlays/test-vagrant-mounts | kubectl apply -f -
.PHONY: test-install-calicovpp-dev-v6
test-install-calicovpp-dev-v6:
kubectl kustomize yaml/overlays/test-vagrant-v6-mounts | kubectl apply -f -
.PHONY: run-tests
run-tests:
test/scripts/test.sh up iperf
kubectl -n iperf wait pod/iperf-client $$(kubectl -n iperf get pods -l 'app in (iperf-server,iperf-nodeport)' -o name) --for=condition=Ready --timeout=30s
test/scripts/cases.sh ipv4
test/scripts/test.sh down iperf
.PHONY: restart-calicovpp
restart-calicovpp:
kubectl -n kube-system rollout restart ds/calico-vpp-node
kubectl -n kube-system rollout status ds/calico-vpp-node
.PHONY: goapi
goapi:
@./vpplink/binapi/generate_binapi.sh
.PHONY: yaml
yaml:
$(MAKE) -C yaml
.PHONY: release
# TAG must be set to something like v0.6.0-calicov3.9.1
release: check-TAG
@[ -z "$(shell git status --porcelain)" ] || (echo "Repo is not clean! Aborting." && exit 1)
# Generate yaml file for this release
sed -i.bak "s|:latest|:$(TAG)|g" yaml/base/calico-vpp.yaml
rm yaml/base/calico-vpp.yaml.bak
$(MAKE) -C yaml
git checkout -b release/$(TAG)
git add yaml
git commit -sm "Release $(TAG)"
# Tag release and push it
git tag $(TAG)
git push --set-upstream origin release/$(TAG)
git push origin $(TAG)