This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
89 lines (64 loc) · 2.01 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
# SPDX-FileCopyrightText: 2022-present Intel Corporation
# SPDX-License-Identifier: Apache-2.0
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIR := $(patsubst %/,%,$(dir $(MKFILE_PATH)))
# TODO: add other topos
# oneswitch, leafpair, leafspine
export TOPO ?= leafspine
ONOS_URL := http://localhost:8181/onos
ONOS_CURL := curl --fail -sSL --user onos:rocks --noproxy localhost
.PHONY: $(SCENARIOS)
start: ./tmp
$(info *** Starting ONOS and mininet...)
docker compose up -d
start-upf: ./tmp
$(info *** Starting UPF containers...)
docker compose --profile upf up -d
stop:
$(info *** Stopping all containers...)
docker compose down -t0 --remove-orphans
restart: reset start
mn-cli:
$(info *** Attaching to Mininet CLI...)
$(info *** To detach press Ctrl-D (Mininet will keep running))
-@docker attach --detach-keys "ctrl-d" mininet || echo "*** Detached from Mininet CLI"
mn-log:
docker logs -f mininet
onos-cli:
ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -o LogLevel=ERROR -p 8101 onos@localhost
onos-log:
docker compose logs -f onos1
onos-ui:
open http://localhost:8181/onos/ui
pfcp-log:
docker compose logs -f pfcp-agent
netcfg: NETCFG_JSON := ./config/netcfg-${TOPO}.json
netcfg: _netcfg
netcfg-up4: NETCFG_JSON := ./config/netcfg-up4.json
netcfg-up4: _netcfg
_netcfg:
$(info *** Pushing ${NETCFG_JSON} to ONOS...)
${ONOS_CURL} -X POST -H 'Content-Type:application/json' \
${ONOS_URL}/v1/network/configuration -d@${NETCFG_JSON}
@echo
# Create ./tmp before Docker does so it doesn't have root owner.
./tmp:
@mkdir -p ./tmp
deps: pull build
pull:
docker compose pull
build:
docker compose build --pull
reset:
-docker compose down -t0 --remove-orphans
# -make fix-permissions
# TODO: make it work without sudo
-sudo rm -rf ./tmp
smf-sim:
docker compose exec smf-sim /up4/bin/smf-sim.py pfcp-agent \
--pcap-file /tmp/smf-sim.pcap -vvv
up4-p4rt-sh:
docker compose exec p4rt \
python3 -m p4runtime_sh \
--grpc-addr onos1:51001 \
--device-id 1 --election-id 0,1