Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/docker #21

Draft
wants to merge 4 commits into
base: development
Choose a base branch
from
Draft

Feature/docker #21

wants to merge 4 commits into from

Conversation

dsilhavy
Copy link
Contributor

@dsilhavy dsilhavy commented Dec 6, 2024

Description

This PR can solve as a starting point for a Docker based setup as outlined in #18 . @davidjwbbc is working on this as well so we might use this PR to consolidate our changes. For now, I mainly used it to execute the regressions tests on a Mac ARM based machine.

Changes

  • Fixes a duplicate entry in readme.md listing gittwice as a dependency
  • Adds a Dockerfile to build the DCAF and run the regression tests
  • Adds a Docker compose file to serve as an entry point for the Docker setup
  • Adds an entrypoint.sh to run nrfd and dcafd.

Notes

Note that not all regression tests run successful, which is why the execution stops at step 7/8 (also see Regression Test Output below):

 ERROR [data-collection-application-function 7/8] RUN meson test -C build regression 

We need to check and discuss how to run and expose dcafd.

Regression Test output

0.478 1/1 rt-data-collection-application-function / regression RUNNING                                                                                                                                                                                                                                             
0.478 >>> UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MALLOC_PERTURB_=178 /rt-data-collection-application-function/tests/run_test_scripts.sh
0.478 ――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――
3.498 (I): 000_prepare: 1/1 passed
3.596 (I): 001_provisioning_session: 9/9 passed
3.660 (I): 002_configure: 4/4 passed
3.710 (I): 003_data_reporting_session:fetch_data_reporting_session: DataReportingSession unmodified
104.8 (I): 003_data_reporting_session:fetch_expired_data_reporting_session: DataReportingSession has expired
104.8 (I): 003_data_reporting_session: 7/7 passed
104.9 (I): 004_data_reporting: 1/1 passed
105.9 (E): 005_event_exposure_subscription:cmp_field_array_size: Response field "eventNotifs" does not contain the expected number of elements
105.9 (E): 005_event_exposure_subscription:create_event_exposure_subscription: Expected one immediate event notification
105.9 (E): 005_event_exposure_subscription:create_event_exposure_subscription: {
105.9   "eventsSubs":   [{
105.9                   "event":        "UE_COMM",
105.9                   "eventFilter":  {
105.9                           "anyUeInd":     true
105.9                   }
105.9           }],
105.9   "eventsRepInfo":        {
105.9           "immRep":       true,
105.9           "notifMethod":  "PERIODIC",
105.9           "repPeriod":    30
105.9   },
105.9   "notifUri":     "http://127.0.0.1:44657/path/to/my/notification/handler",
105.9   "notifId":      "events-notifications-id",
105.9   "suppFeat":     "04"
105.9 }
105.9 (E): 005_event_exposure_subscription: 1/5 failed
105.9 (I): 005_event_exposure_subscription: 4/5 passed
105.9 /rt-data-collection-application-function/tests/scripts/006_event_exposure_notification.sh: line 107: waitpid: command not found
107.0 (E): 006_event_exposure_notification:check_modifed_timestamp: Event Exposure Notification not received
107.0 /rt-data-collection-application-function/tests/scripts/006_event_exposure_notification.sh: line 107: waitpid: command not found
108.0 (E): 006_event_exposure_notification:check_modifed_timestamp: Event Exposure Notification not received
108.0 jq: error (at /tmp/dcaf-regression-notif-log.4wHtqY4Q:1): Cannot index string with string "body"
108.0 /rt-data-collection-application-function/tests/run_test_scripts.sh: line 296: [: : integer expression expected
108.0 (E): 006_event_exposure_notification:cmp_field_int: Response field "eventNotifs[0].ueCommInfos[0].comms[0].ulVol": is not an integer
108.0 (E): 006_event_exposure_notification:check_logged_last_event_notification_ulVol: ulVol of the last event notiication does not match the expected value
108.0 /rt-data-collection-application-function/tests/run_test_scripts.sh: line 296: [: : integer expression expected
108.0 (E): 006_event_exposure_notification:cmp_field_int: Response field "eventNotifs[0].ueCommInfos[0].comms[0].dlVol": is not an integer
108.0 (E): 006_event_exposure_notification:check_logged_last_event_notification_dlVol: dlVol of the last event notiication does not match the expected value
108.0 (E): 006_event_exposure_notification: 4/6 failed
108.0 (I): 006_event_exposure_notification: 2/6 passed
108.1 (I): 007_bucketing: 7/7 passed
115.0 (I): 008_aggregations: 58/58 passed
115.0 (W): 987_delete_event_exposure:delete_event_exposure_subscription: Delete AfEventExposureSubsc skipped due to missing afEventExposureSubscId
115.0 (I): 987_delete_event_exposure: 1 skipped, 1/2 passed
115.0 (I): 988_delete_data_reporting_session: 1/1 passed
115.0 (I): 989_delete_configuration: 1/1 passed
115.0 (I): 990_delete_provisioning_session: 1/1 passed
115.0 (I): 999_shutdown: 1/1 passed
115.0 (E): Overall 98 passed, 5 failed, 1 skipped out of 104 tests

@dsilhavy dsilhavy added the New Feature A new high level feature label Dec 6, 2024
@dsilhavy dsilhavy requested review from davidjwbbc and devbbc December 6, 2024 06:53
@dsilhavy
Copy link
Contributor Author

dsilhavy commented Dec 6, 2024

One more important note: I am pointing to the development branch of https://github.com/davidjwbbc/rt-data-collection-application-function.git right now since #20 is not merged yet

@davidjwbbc
Copy link
Contributor

davidjwbbc commented Dec 11, 2024

Just pushed my Dockerfile. This performs the regression tests to:
"Overall 100 passed, 1 failed, 1 skipped out of 102 tests"

To build the docker container using the current repository clone (and any edits you've made) you can:

docker build --progress=plain .

There's something strange going on with the event immediate reporting in the docker container that will need some debugging. It's currently preventing the final container from being prepared as the regression tests are failing.

@dsilhavy
Copy link
Contributor Author

Just pushed my Dockerfile. This performs the regression tests to: "Overall 100 passed, 1 failed, 1 skipped out of 102 tests"

To build the docker container using the current repository clone (and any edits you've made) you can:

docker build --progress=plain .

There's something strange going on with the event immediate reporting in the docker container that will need some debugging. It's currently preventing the final container from being prepared as the regression tests are failing.

Thanks @davidjwbbc . Building the container on MacOSX with an ARM chipset I get:

#13 57.65 FAILED: lib/data-collection-service-provider/libspdc.so.0.1.0.p/data-collection-nf-service.c.o 
#13 57.65 cc -Ilib/data-collection-service-provider/libspdc.so.0.1.0.p -Ilib/data-collection-service-provider -I../rt-data-collection-application-function/lib/data-collection-service-provider -I../rt-data-collection-application-function/lib/data-collection-service-provider/openapi/model -Ilib/data-collection-service-provider/include -I../rt-data-collection-application-function/lib/data-collection-service-provider/include -Ilib/common -I../rt-data-collection-application-function/lib/common -Isubprojects/open5gs/lib -I../rt-data-collection-application-function/subprojects/open5gs/lib -Isubprojects/open5gs/lib/app -I../rt-data-collection-application-function/subprojects/open5gs/lib/app -Isubprojects/open5gs/lib/core -I../rt-data-collection-application-function/subprojects/open5gs/lib/core -Isubprojects/open5gs/lib/crypt -I../rt-data-collection-application-function/subprojects/open5gs/lib/crypt -Isubprojects/open5gs/lib/proto -I../rt-data-collection-application-function/subprojects/open5gs/lib/proto -Isubprojects/open5gs/lib/sbi -I../rt-data-collection-application-function/subprojects/open5gs/lib/sbi -Isubprojects/open5gs/lib/sbi/openapi -I../rt-data-collection-application-function/subprojects/open5gs/lib/sbi/openapi -I/usr/include/p11-kit-1 -I/usr/include/aarch64-linux-gnu -fvisibility=hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O0 -g -fPIC -pthread -DBUILD_DATA_COLLECTION_LIB -MD -MQ lib/data-collection-service-provider/libspdc.so.0.1.0.p/data-collection-nf-service.c.o -MF lib/data-collection-service-provider/libspdc.so.0.1.0.p/data-collection-nf-service.c.o.d -o lib/data-collection-service-provider/libspdc.so.0.1.0.p/data-collection-nf-service.c.o -c ../rt-data-collection-application-function/lib/data-collection-service-provider/data-collection-nf-service.c
#13 57.65 ../rt-data-collection-application-function/lib/data-collection-service-provider/data-collection-nf-service.c:16:10: fatal error: openapi/api/ApplicationEventSubscriptionCollectionApi-info.h: No such file or directory
#13 57.65    16 | #include "openapi/api/ApplicationEventSubscriptionCollectionApi-info.h"
#13 57.65       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#13 57.65 compilation terminated.
#13 57.77 [3919/4421] Compiling C object lib/data-collection-service-provider/libspdc.so.0.1.0.p/data-collection-process.c.o
#13 57.77 [3920/4421] Compiling C object lib/data-collection-service-provider/libspdc.so.0.1.0.p/context.c.o
#13 57.78 [3921/4421] Compiling C object lib/data-collection-service-provider/libspdc.so.0.1.0.p/data-collection.c.o
#13 57.80 [3922/4421] Compiling C object subprojects/open5gs/tests/handover/handover.p/5gc-xn-test.c.o
#13 57.82 [3923/4421] Compiling C object subprojects/open5gs/tests/non3gpp/non3gpp.p/abts-main.c.o
#13 57.83 [3924/4421] Compiling C object subprojects/open5gs/tests/non3gpp/non3gpp.p/s2b-build.c.o
#13 57.87 [3925/4421] Compiling C object lib/data-collection-service-provider/libspdc.so.0.1.0.p/data-report-record.c.o
#13 57.91 [3926/4421] Compiling C object lib/data-collection-service-provider/libspdc.so.0.1.0.p/data-report.c.o
#13 58.02 [3927/4421] Compiling C object subprojects/open5gs/tests/non3gpp/non3gpp.p/gtp-path.c.o
#13 58.07 [3928/4421] Compiling C object subprojects/open5gs/tests/non3gpp/non3gpp.p/s2b-handler.c.o
#13 58.30 [3929/4421] Compiling C object subprojects/open5gs/tests/non3gpp/non3gpp.p/epdg-test.c.o
#13 58.30 ninja: build stopped: subcommand failed.
#13 ERROR: process "/bin/sh -c ninja -C build" did not complete successfully: exit code: 1
------
 > [building  8/12] RUN --mount=type=bind,source=.,dst=/source/rt-data-collection-application-function,rw ninja -C build:
57.78 [3921/4421] Compiling C object lib/data-collection-service-provider/libspdc.so.0.1.0.p/data-collection.c.o
57.80 [3922/4421] Compiling C object subprojects/open5gs/tests/handover/handover.p/5gc-xn-test.c.o
57.82 [3923/4421] Compiling C object subprojects/open5gs/tests/non3gpp/non3gpp.p/abts-main.c.o
57.83 [3924/4421] Compiling C object subprojects/open5gs/tests/non3gpp/non3gpp.p/s2b-build.c.o
57.87 [3925/4421] Compiling C object lib/data-collection-service-provider/libspdc.so.0.1.0.p/data-report-record.c.o
57.91 [3926/4421] Compiling C object lib/data-collection-service-provider/libspdc.so.0.1.0.p/data-report.c.o
58.02 [3927/4421] Compiling C object subprojects/open5gs/tests/non3gpp/non3gpp.p/gtp-path.c.o
58.07 [3928/4421] Compiling C object subprojects/open5gs/tests/non3gpp/non3gpp.p/s2b-handler.c.o
58.30 [3929/4421] Compiling C object subprojects/open5gs/tests/non3gpp/non3gpp.p/epdg-test.c.o
58.30 ninja: build stopped: subcommand failed.
------
dockerfile-test:12
--------------------
  10 |     # Build DCAF
  11 |     RUN --mount=type=bind,source=.,dst=/source/rt-data-collection-application-function,rw --network=default cd rt-data-collection-application-function; meson setup --prefix /usr --sysconfdir /etc --localstatedir /var ../build
  12 | >>> RUN --mount=type=bind,source=.,dst=/source/rt-data-collection-application-function,rw ninja -C build
  13 |     RUN --mount=type=bind,source=.,dst=/source/rt-data-collection-application-function,rw MESON_BUILD_ROOT=$PWD/build meson test -C build regression
  14 |     RUN --mount=type=bind,source=.,dst=/source/rt-data-collection-application-function,rw DESTDIR=/install ninja -C build install
--------------------
ERROR: failed to solve: process "/bin/sh -c ninja -C build" did not complete successfully: exit code: 1

I will give it a try on an Ubuntu machine.

@dsilhavy
Copy link
Contributor Author

Builds successfully in the Docker container on Ubuntu 22 and fails one test:

#14 174.7 (E): Overall 100 passed, 1 failed, 1 skipped out of 102 tests

@davidjwbbc
Copy link
Contributor

Rebased on top of merged PR #20 and disabled regression tests in Dockerfile.

@davidjwbbc
Copy link
Contributor

I had all regression tests pass, but then I tried a clean rebuild of the Docker image and most of the regression tests failed, so I've disabled regression tests in the build of the Docker image for now until this can be understood.

@davidjwbbc
Copy link
Contributor

Fixed the issue with the regression tests and re-added tests into Dockerfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature A new high level feature
Development

Successfully merging this pull request may close these issues.

2 participants