diff --git a/ci-scripts/yaml_files/5g_rfsimulator/README.md b/ci-scripts/yaml_files/5g_rfsimulator/README.md index 87e98633f3..e815047bda 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/README.md +++ b/ci-scripts/yaml_files/5g_rfsimulator/README.md @@ -535,3 +535,40 @@ snssais: ``` The `ST` and `SD` values shall also match. + + +# 6. Running with local changes + +You can run the testcase with local changes by substituting the binaries in +execution images. `local-override.yaml` file provides a way to substitute the +gNB and nrUE executables as well as librfsimulator.so. Refer to the `-volumes` +section in the file for details. This includes an image build service as well as +code compilation service. This is necessary as the executable has to be linked +against the same libraries that are present in the executing image. This might +take a while the first time but other that that is very fast. Here is a list of +commands (wait between each command). Tested with `docker compose` v2.27.0 + + +This command deploys OAI 5G Core Network +```bash +docker compose -f docker-compose.yaml -f local-override.yaml up -d mysql oai-amf oai-smf oai-upf oai-ext-dn +``` +This command builds base images locally, builds local gNB & nrUE executable and +runs the gnb service with modified gNB executable. +```bash +docker compose -f docker-compose.yaml -f local-override.yaml up -d oai-gnb +``` +This command rebuilds both the gNB & nrUE and runs the oai-nr-ue container with +modified nrUE executable. +```bash +docker compose -f docker-compose.yaml -f local-override.yaml up -d oai-nr-ue +``` + +## 6.1 Running nrUE in gdb +`local-override-ue-gdb.yaml` is an additional override file which can be used +to run the UE executable in gdb. Replace the last command above with the +following: + +```bash +docker compose -f docker-compose.yaml -f local-override.yaml -f local-override-ue-gdb.yaml run oai-nr-ue +``` diff --git a/ci-scripts/yaml_files/5g_rfsimulator/local-override-ue-gdb.yaml b/ci-scripts/yaml_files/5g_rfsimulator/local-override-ue-gdb.yaml new file mode 100644 index 0000000000..83498e44f7 --- /dev/null +++ b/ci-scripts/yaml_files/5g_rfsimulator/local-override-ue-gdb.yaml @@ -0,0 +1,6 @@ +services: + oai-nr-ue: + privileged: true + stdin_open: true + tty: true + command: gdb --args /opt/oai-nr-ue/bin/nr-uesoftmodem -O /opt/oai-nr-ue/etc/nr-ue.conf -E --sa --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time diff --git a/ci-scripts/yaml_files/5g_rfsimulator/local-override.yaml b/ci-scripts/yaml_files/5g_rfsimulator/local-override.yaml new file mode 100644 index 0000000000..40d9b7ecc9 --- /dev/null +++ b/ci-scripts/yaml_files/5g_rfsimulator/local-override.yaml @@ -0,0 +1,27 @@ +include: + - ../local_common_overrides/build_images.yaml + - ../local_common_overrides/rebuild_nr_softmodems.yaml +services: + oai-gnb: + privileged: true + depends_on: + rebuild-nr-softmodems: + condition: service_completed_successfully + volumes: + - ../../../cmake_targets/ran_build/build/nr-softmodem:/opt/oai-gnb/bin/nr-softmodem + - ../../../cmake_targets/ran_build/build/librfsimulator.so:/usr/local/lib/librfsimulator.so + oai-nr-ue: + privileged: true + image: ue-local + depends_on: + build-ran-build: + condition: service_completed_successfully + restart: true + oai-gnb: + condition: service_started + rebuild-nr-softmodems: + condition: service_completed_successfully + volumes: + - ../../../cmake_targets/ran_build/build/nr-uesoftmodem:/opt/oai-nr-ue/bin/nr-uesoftmodem + - ../../../cmake_targets/ran_build/build/librfsimulator.so:/usr/local/lib/librfsimulator.so + - ../../../crashdumps/:/cores/ diff --git a/ci-scripts/yaml_files/5g_rfsimulator_tdd_dora/local-override.yaml b/ci-scripts/yaml_files/5g_rfsimulator_tdd_dora/local-override.yaml new file mode 100644 index 0000000000..c65d52ed29 --- /dev/null +++ b/ci-scripts/yaml_files/5g_rfsimulator_tdd_dora/local-override.yaml @@ -0,0 +1,27 @@ +include: + - ../local_common_overrides/build_images.yaml + - ../local_common_overrides/rebuild_nr_softmodems.yaml +services: + oai-gnb: + privileged: true + depends_on: + rebuild-nr-softmodems: + condition: service_completed_successfully + # volumes: + # replace the gnb executable here + oai-nr-ue: + privileged: true + image: ue-local + depends_on: + build-ran-build: + condition: service_completed_successfully + restart: true + oai-gnb: + condition: service_started + rebuild-nr-softmodems: + condition: service_completed_successfully + container_name: local-oai-nr-ue + volumes: + - ../../../cmake_targets/ran_build/build/nr-uesoftmodem:/opt/oai-nr-ue/bin/nr-uesoftmodem + - ../../../cmake_targets/ran_build/build/librfsimulator.so:/usr/local/lib/librfsimulator.so + - ../../../crashdumps/:/cores/ diff --git a/ci-scripts/yaml_files/local_common_overrides/build_images.yaml b/ci-scripts/yaml_files/local_common_overrides/build_images.yaml new file mode 100644 index 0000000000..a771289ae4 --- /dev/null +++ b/ci-scripts/yaml_files/local_common_overrides/build_images.yaml @@ -0,0 +1,45 @@ +services: + build-ran-base: + image: ran-base + build: + context: ../../../ + dockerfile: docker/Dockerfile.base.ubuntu22 + tags: + - ran-base + + build-ran-build: + image: ran-build + build: + context: ../../../ + dockerfile: docker/Dockerfile.build.ubuntu22 + tags: + - ran-build + depends_on: + build-ran-base: + condition: service_completed_successfully + + build-gnb-image: + image: gnb-local + build: + context: ../../../ + dockerfile: docker/Dockerfile.gNB.ubuntu22 + tags: + - gnb-local + depends_on: + build-ran-build: + condition: service_completed_successfully + entrypoint: "" + command: echo "gnb-image built" + + build-ue-image: + image: ue-local + build: + context: ../../../ + dockerfile: docker/Dockerfile.nrUE.ubuntu22 + tags: + - ue-local + depends_on: + build-ran-build: + condition: service_completed_successfully + entrypoint: "" + command: echo "ue-image built" diff --git a/ci-scripts/yaml_files/local_common_overrides/rebuild_nr_softmodems.yaml b/ci-scripts/yaml_files/local_common_overrides/rebuild_nr_softmodems.yaml new file mode 100644 index 0000000000..ca9cdb334d --- /dev/null +++ b/ci-scripts/yaml_files/local_common_overrides/rebuild_nr_softmodems.yaml @@ -0,0 +1,13 @@ +services: + rebuild-nr-softmodems: + image: ran-build + volumes: + - ../../../:/oai-dir/ + command: + bash -c "cd /oai-dir/ && mkdir -p cmake_targets/ran_build/build && cd cmake_targets/ran_build/build && cmake ../../../ -GNinja && cmake --build . --target nr-uesoftmodem rfsimulator nr-softmodem" + entrypoint: "" + depends_on: + build-gnb-image: + condition: service_completed_successfully + build-ue-image: + condition: service_completed_successfully