This repository was archived by the owner on Aug 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
132 lines (103 loc) · 5.26 KB
/
Copy pathMakefile
File metadata and controls
132 lines (103 loc) · 5.26 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
ifndef DOCKER_CMD
DOCKER_CMD=bash
endif
ifndef USONIC_IMAGE_TAG
USONIC_IMAGE_TAG=201904
endif
ifndef USONIC_RUN_IMAGE
USONIC_RUN_IMAGE=usonic
endif
ifndef USONIC_DEBUG_IMAGE
USONIC_DEBUG_IMAGE=usonic-debug
endif
ifndef USONIC_SWSS_COMMON_IMAGE
USONIC_SWSS_COMMON_IMAGE=usonic-swss-common
endif
ifndef USONIC_SAIREDIS_IMAGE
USONIC_SAIREDIS_IMAGE=usonic-sairedis
endif
ifndef USONIC_SWSS_IMAGE
USONIC_SWSS_IMAGE=usonic-swss
endif
ifndef USONIC_LIBTEAM_IMAGE
USONIC_LIBTEAM_IMAGE=usonic-libteam
endif
ifndef USONIC_SONIC_FRR_IMAGE
USONIC_SONIC_FRR_IMAGE=usonic-sonic-frr
endif
ifndef USONIC_LLDPD_IMAGE
USONIC_LLDPD_IMAGE=usonic-lldpd
endif
ifndef USONIC_CLI_IMAGE
USONIC_CLI_IMAGE=usonic-cli
endif
ifndef DOCKER_REPO
DOCKER_REPO := ghcr.io/microsonic
endif
ifndef DOCKER_IMAGE
DOCKER_IMAGE := $(DOCKER_REPO)/$(USONIC_DEBUG_IMAGE):$(USONIC_IMAGE_TAG)
endif
LIBTEAM_DIR := sm/libteam/
LLDPD_DIR := src/lldpd/
LLDPD_SYNC_DIR := sm/sonic-dbsyncd/
LLDPD_PATCH := ../../patches/lldpd/patch/0001-lldp-syncd-fix.patch
all: swss-common sairedis libteam lldpd sonic-frr swss run-image debug-image
cli:
DOCKER_BUILDKIT=1 docker build $(DOCKER_BUILD_OPTION) -f docker/cli.Dockerfile \
-t $(DOCKER_REPO)/$(USONIC_CLI_IMAGE):$(USONIC_IMAGE_TAG) .
swss-common:
DOCKER_BUILDKIT=1 docker build $(DOCKER_BUILD_OPTION) -f docker/build-swss-common.Dockerfile \
-t $(DOCKER_REPO)/$(USONIC_SWSS_COMMON_IMAGE):$(USONIC_IMAGE_TAG) .
sonic-frr:
DOCKER_BUILDKIT=1 docker build $(DOCKER_BUILD_OPTION) -f docker/build-sonic-frr.Dockerfile \
-t $(DOCKER_REPO)/$(USONIC_SONIC_FRR_IMAGE):$(USONIC_IMAGE_TAG) .
sairedis:
DOCKER_BUILDKIT=1 docker build $(DOCKER_BUILD_OPTION) --build-arg USONIC_SWSS_COMMON_IMAGE=$(DOCKER_REPO)/$(USONIC_SWSS_COMMON_IMAGE):$(USONIC_IMAGE_TAG) \
-f docker/build-sairedis.Dockerfile \
-t $(DOCKER_REPO)/$(USONIC_SAIREDIS_IMAGE):$(USONIC_IMAGE_TAG) .
swss:
DOCKER_BUILDKIT=1 docker build $(DOCKER_BUILD_OPTION) --build-arg USONIC_SWSS_COMMON_IMAGE=$(DOCKER_REPO)/$(USONIC_SWSS_COMMON_IMAGE):$(USONIC_IMAGE_TAG) \
--build-arg USONIC_SAIREDIS_IMAGE=$(DOCKER_REPO)/$(USONIC_SAIREDIS_IMAGE):$(USONIC_IMAGE_TAG) \
--build-arg USONIC_LIBTEAM_IMAGE=$(DOCKER_REPO)/$(USONIC_LIBTEAM_IMAGE):$(USONIC_IMAGE_TAG) \
--build-arg USONIC_LLDPD_IMAGE=$(DOCKER_REPO)/$(USONIC_LLDPD_IMAGE):$(USONIC_IMAGE_TAG) \
-f docker/build-swss.Dockerfile \
-t $(DOCKER_REPO)/$(USONIC_SWSS_IMAGE):$(USONIC_IMAGE_TAG) .
libteam:
cd $(LIBTEAM_DIR) && make all
DOCKER_BUILDKIT=1 docker build $(DOCKER_BUILD_OPTION) --build-arg USONIC_SWSS_COMMON_IMAGE=$(DOCKER_REPO)/$(USONIC_SWSS_COMMON_IMAGE):$(USONIC_IMAGE_TAG) \
-f docker/build-libteam.Dockerfile \
-t $(DOCKER_REPO)/$(USONIC_LIBTEAM_IMAGE):$(USONIC_IMAGE_TAG) .
lldpd:
cd $(LLDPD_DIR) && make all
DOCKER_BUILDKIT=1 docker build $(DOCKER_BUILD_OPTION) --build-arg USONIC_SWSS_COMMON_IMAGE=$(DOCKER_REPO)/$(USONIC_SWSS_COMMON_IMAGE):$(USONIC_IMAGE_TAG) \
-f docker/build-lldpd.Dockerfile \
-t $(DOCKER_REPO)/$(USONIC_LLDPD_IMAGE):$(USONIC_IMAGE_TAG) .
run-image:
DOCKER_BUILDKIT=1 docker build $(DOCKER_BUILD_OPTION) --build-arg USONIC_SWSS_COMMON_IMAGE=$(DOCKER_REPO)/$(USONIC_SWSS_COMMON_IMAGE):$(USONIC_IMAGE_TAG) \
--build-arg USONIC_SAIREDIS_IMAGE=$(DOCKER_REPO)/$(USONIC_SAIREDIS_IMAGE):$(USONIC_IMAGE_TAG) \
--build-arg USONIC_SWSS_IMAGE=$(DOCKER_REPO)/$(USONIC_SWSS_IMAGE):$(USONIC_IMAGE_TAG) \
--build-arg USONIC_LIBTEAM_IMAGE=$(DOCKER_REPO)/$(USONIC_LIBTEAM_IMAGE):$(USONIC_IMAGE_TAG) \
--build-arg USONIC_SONIC_FRR_IMAGE=$(DOCKER_REPO)/$(USONIC_SONIC_FRR_IMAGE):$(USONIC_IMAGE_TAG) \
--build-arg USONIC_LLDPD_IMAGE=$(DOCKER_REPO)/$(USONIC_LLDPD_IMAGE):$(USONIC_IMAGE_TAG) \
-f docker/run.Dockerfile \
-t $(DOCKER_REPO)/$(USONIC_RUN_IMAGE):$(USONIC_IMAGE_TAG) .
debug-image:
cd $(LLDPD_SYNC_DIR) && git config --global user.email "BPraveen@palcnetworks.com"
cd $(LLDPD_SYNC_DIR) && git config --global user.name "PRAVEEN-BABY"
cd $(LLDPD_SYNC_DIR) && git am $(LLDPD_PATCH)
DOCKER_BUILDKIT=1 docker build $(DOCKER_BUILD_OPTION) --build-arg USONIC_SWSS_COMMON_IMAGE=$(DOCKER_REPO)/$(USONIC_SWSS_COMMON_IMAGE):$(USONIC_IMAGE_TAG) \
--build-arg USONIC_SAIREDIS_IMAGE=$(DOCKER_REPO)/$(USONIC_SAIREDIS_IMAGE):$(USONIC_IMAGE_TAG) \
--build-arg USONIC_SWSS_IMAGE=$(DOCKER_REPO)/$(USONIC_SWSS_IMAGE):$(USONIC_IMAGE_TAG) \
--build-arg USONIC_LIBTEAM_IMAGE=$(DOCKER_REPO)/$(USONIC_LIBTEAM_IMAGE):$(USONIC_IMAGE_TAG) \
--build-arg USONIC_SONIC_FRR_IMAGE=$(DOCKER_REPO)/$(USONIC_SONIC_FRR_IMAGE):$(USONIC_IMAGE_TAG) \
--build-arg USONIC_LLDPD_IMAGE=$(DOCKER_REPO)/$(USONIC_LLDPD_IMAGE):$(USONIC_IMAGE_TAG) \
--build-arg USONIC_RUN_IMAGE=$(DOCKER_REPO)/$(USONIC_RUN_IMAGE):$(USONIC_IMAGE_TAG) \
-f docker/debug.Dockerfile \
-t $(DOCKER_REPO)/$(USONIC_DEBUG_IMAGE):$(USONIC_IMAGE_TAG) .
run:
-kubectl delete pods --force --grace-period=0 --timeout=0 usonic
kubectl create -f ./files/usonic.yaml
bash:
$(MAKE) cmd
cmd:
docker run -it -v `pwd`:/data -w /data --privileged --rm $(DOCKER_IMAGE) $(DOCKER_CMD)