Skip to content

Commit

Permalink
Add dev ran
Browse files Browse the repository at this point in the history
  • Loading branch information
louisroyer committed Oct 31, 2024
1 parent f21d331 commit ccb25bb
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ set/full-debug/%: $(BCONFIG)
@echo Set full-debug to $(@F)
@./scripts/config_edit.py $(BCONFIG) --full-debug=$(@F)

.PHONY: set/ran
set/ran/%: $(BCONFIG)
@echo Set ran to $(@F)
@./scripts/config_edit.py $(BCONFIG) --ran=$(@F)

.PHONY: set/handover
set/handover:
@$(MAKE) set/dataplane/free5gc
@$(MAKE) set/nb-ue/2
@$(MAKE) set/nb-edges/1
@$(MAKE) set/log-level/debug
@$(MAKE) set/full-debug/true
@$(MAKE) set/ran/dev

.PHONY: clean
clean:
@rm -rf $(BUILD_DIR)
Expand Down
4 changes: 4 additions & 0 deletions default-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ config:
topology:
nb_edges: 2
nb_ue: 1
nb_gnb: 1
ran:
version: "stable" # ( stable | dev )
dev_build_path: ../../ueransim/build/ # relative to the root of the testbed, not to the testbed build directory
dataplane: # ( nextmn-srv6 | free5gc | nextmn-upf)
- "nextmn-srv6"
log_level: "info"
Expand Down
6 changes: 6 additions & 0 deletions scripts/config_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def increase_indent(self, flow=False, indentless=False):
parser.add_argument('--nb-edges')
parser.add_argument('--log-level')
parser.add_argument('--full-debug')
parser.add_argument('--ran')
args = parser.parse_args()
ran = ('stable', 'dev')
dataplane = ('free5gc', 'nextmn-upf', 'nextmn-srv6')
log_levels = ('trace', 'debug', 'info', 'warning', 'error', 'fatal', 'panic')
try:
Expand All @@ -45,6 +47,8 @@ def increase_indent(self, flow=False, indentless=False):
raise ConfigException(f'Invalid log level: use one from {log_levels}')
if args.full_debug and (args.full_debug.lower() not in ('true', 'false')):
raise ConfigException('Invalid value for full debug: must be a boolean')
if args.ran and (args.ran not in ran):
raise ConfigException(f'Invalid ran config: use one from {ran}')
except ConfigException as e:
print(f'Error: {e}', file=sys.stderr)
sys.exit(1)
Expand All @@ -62,5 +66,7 @@ def increase_indent(self, flow=False, indentless=False):
c['config']['topology']['log_level'] = args.log_level
if args.full_debug is not None:
c['config']['topology']['full_debug'] = args.full_debug.lower() == 'true'
if args.ran:
c['config']['topology']['ran']['version'] = args.ran
with open(args.buildconfig, 'w', encoding='utf-8') as f2:
yaml.dump(c, f2, Dumper, default_flow_style=False)
40 changes: 40 additions & 0 deletions templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ services:
depends_on:
amf:
condition: service_started
#~ if config["topology"]["ran"]["version"] == "dev"
volumes:
- ../{{ config.topology.ran.dev_build_path }}/nr-ue:/usr/bin/nr-ue:ro
- ../{{ config.topology.ran.dev_build_path }}/nr-cli:/usr/bin/nr-cli:ro
#~ endif
environment:
MSISDN: "0000000001"
GNBS: |-
Expand All @@ -34,6 +39,11 @@ services:
depends_on:
amf:
condition: service_started
#~ if config["topology"]["ran"]["version"] == "dev"
volumes:
- ../{{ config.topology.ran.dev_build_path }}/nr-ue:/usr/bin/nr-ue:ro
- ../{{ config.topology.ran.dev_build_path }}/nr-cli:/usr/bin/nr-cli:ro
#~ endif
environment:
MSISDN: "0000000002"
GNBS: |-
Expand All @@ -60,6 +70,11 @@ services:
depends_on:
amf:
condition: service_started
#~ if config["topology"]["ran"]["version"] == "dev"
volumes:
- ../{{ config.topology.ran.dev_build_path }}/nr-ue:/usr/bin/nr-ue:ro
- ../{{ config.topology.ran.dev_build_path }}/nr-cli:/usr/bin/nr-cli:ro
#~ endif
environment:
MSISDN: "0000000003"
GNBS: |-
Expand All @@ -84,6 +99,11 @@ services:
depends_on:
amf:
condition: service_started
#~ if config["topology"]["ran"]["version"] == "dev"
volumes:
- ../{{ config.topology.ran.dev_build_path }}/nr-ue:/usr/bin/nr-ue:ro
- ../{{ config.topology.ran.dev_build_path }}/nr-cli:/usr/bin/nr-cli:ro
#~ endif
environment:
MSISDN: "0000000004"
GNBS: |-
Expand All @@ -110,6 +130,11 @@ services:
depends_on:
amf:
condition: service_started
#~ if config["topology"]["ran"]["version"] == "dev"
volumes:
- ../{{ config.topology.ran.dev_build_path }}/nr-ue:/usr/bin/nr-ue:ro
- ../{{ config.topology.ran.dev_build_path }}/nr-cli:/usr/bin/nr-cli:ro
#~ endif
environment:
MSISDN: "0000000005"
GNBS: |-
Expand All @@ -134,6 +159,11 @@ services:
depends_on:
amf:
condition: service_started
#~ if config["topology"]["ran"]["version"] == "dev"
volumes:
- ../{{ config.topology.ran.dev_build_path }}/nr-ue:/usr/bin/nr-ue:ro
- ../{{ config.topology.ran.dev_build_path }}/nr-cli:/usr/bin/nr-cli:ro
#~ endif
environment:
MSISDN: "0000000006"
GNBS: |-
Expand All @@ -159,6 +189,11 @@ services:
depends_on:
amf:
condition: service_started
#~ if config["topology"]["ran"]["version"] == "dev"
volumes:
- ../{{ config.topology.ran.dev_build_path }}/nr-gnb:/usr/bin/nr-gnb:ro
- ../{{ config.topology.ran.dev_build_path }}/nr-cli:/usr/bin/nr-cli:ro
#~ endif
environment:
NCI: 000000001
RLS_IP: "{{ ipv6('gnb1', 'ran') }}"
Expand Down Expand Up @@ -200,6 +235,11 @@ services:
depends_on:
amf:
condition: service_started
#~ if config["topology"]["ran"]["version"] == "dev"
volumes:
- ../{{ config.topology.ran.dev_build_path }}/nr-gnb:/usr/bin/nr-gnb:ro
- ../{{ config.topology.ran.dev_build_path }}/nr-cli:/usr/bin/nr-cli:ro
#~ endif
environment:
NCI: 000000002
RLS_IP: "{{ ipv6('gnb2', 'ran') }}"
Expand Down

0 comments on commit ccb25bb

Please sign in to comment.