dapps 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. {dapps-0.2.0 → dapps-0.2.1}/PKG-INFO +25 -3
  2. {dapps-0.2.0 → dapps-0.2.1}/README.md +21 -1
  3. dapps-0.2.1/VERSION +1 -0
  4. dapps-0.2.1/examples/__init__.py +3 -0
  5. {dapps-0.2.0 → dapps-0.2.1}/examples/nvidia_dapp.py +1 -1
  6. {dapps-0.2.0 → dapps-0.2.1}/examples/simple_dapp.py +2 -2
  7. {dapps-0.2.0 → dapps-0.2.1}/examples/spectrum_dapp.py +2 -2
  8. {dapps-0.2.0 → dapps-0.2.1}/pyproject.toml +14 -2
  9. {dapps-0.2.0 → dapps-0.2.1}/src/dapp/dapp.py +8 -11
  10. {dapps-0.2.0 → dapps-0.2.1}/src/e3interface/e3_interface.py +265 -262
  11. dapps-0.2.1/src/e3interface/e3_transport.py +23 -0
  12. dapps-0.2.1/src/e3interface/libe3_agent.py +244 -0
  13. dapps-0.2.1/src/e3interface/sm_helpers.py +85 -0
  14. dapps-0.2.1/src/simple/defs/__init__.py +0 -0
  15. dapps-0.2.1/src/simple/defs/e3sm_simple.proto +38 -0
  16. dapps-0.2.1/src/simple/defs/e3sm_simple_pb2.py +33 -0
  17. dapps-0.2.1/src/simple/simple_dapp.py +216 -0
  18. dapps-0.2.1/src/spectrum/defs/__init__.py +0 -0
  19. dapps-0.2.1/src/spectrum/defs/e3sm_oai_l1_kpm.proto +36 -0
  20. dapps-0.2.1/src/spectrum/defs/e3sm_oai_l1_kpm_pb2.py +29 -0
  21. dapps-0.2.1/src/spectrum/defs/e3sm_spectrum.proto +83 -0
  22. dapps-0.2.1/src/spectrum/defs/e3sm_spectrum_pb2.py +43 -0
  23. {dapps-0.2.0 → dapps-0.2.1}/src/spectrum/e3_ran_buffers_reader.py +45 -6
  24. {dapps-0.2.0 → dapps-0.2.1}/src/spectrum/spectrum_dapp.py +70 -8
  25. {dapps-0.2.0 → dapps-0.2.1}/tests/test_indication_dispatch.py +42 -13
  26. dapps-0.2.1/tests/test_libe3_agent.py +55 -0
  27. dapps-0.2.1/tests/test_protobuf_sm.py +114 -0
  28. dapps-0.2.1/tools/regen_proto.sh +20 -0
  29. dapps-0.2.0/VERSION +0 -1
  30. dapps-0.2.0/src/e3interface/defs/e3.asn +0 -105
  31. dapps-0.2.0/src/e3interface/defs/e3.json +0 -416
  32. dapps-0.2.0/src/e3interface/e3_connector.py +0 -339
  33. dapps-0.2.0/src/e3interface/e3_encoder.py +0 -473
  34. dapps-0.2.0/src/simple/defs/e3sm_simple.asn +0 -111
  35. dapps-0.2.0/src/simple/simple_dapp.py +0 -285
  36. dapps-0.2.0/tests/test_encoder_roundtrip.py +0 -186
  37. {dapps-0.2.0 → dapps-0.2.1}/.github/CODEOWNERS +0 -0
  38. {dapps-0.2.0 → dapps-0.2.1}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  39. {dapps-0.2.0 → dapps-0.2.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  40. {dapps-0.2.0 → dapps-0.2.1}/.github/ISSUE_TEMPLATE/documentation.yml +0 -0
  41. {dapps-0.2.0 → dapps-0.2.1}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  42. {dapps-0.2.0 → dapps-0.2.1}/.github/ISSUE_TEMPLATE/new_sm.yml +0 -0
  43. {dapps-0.2.0 → dapps-0.2.1}/.github/ISSUE_TEMPLATE/question.yml +0 -0
  44. {dapps-0.2.0 → dapps-0.2.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  45. {dapps-0.2.0 → dapps-0.2.1}/.github/workflows/mirror.yml +0 -0
  46. {dapps-0.2.0 → dapps-0.2.1}/.github/workflows/tag-and-release.yml +0 -0
  47. {dapps-0.2.0 → dapps-0.2.1}/.github/workflows/test.yml +0 -0
  48. {dapps-0.2.0 → dapps-0.2.1}/.gitignore +0 -0
  49. {dapps-0.2.0 → dapps-0.2.1}/CMakeLists.txt +0 -0
  50. {dapps-0.2.0 → dapps-0.2.1}/CONTRIBUTING.md +0 -0
  51. {dapps-0.2.0 → dapps-0.2.1}/CONTRIBUTORS +0 -0
  52. {dapps-0.2.0 → dapps-0.2.1}/LICENSE +0 -0
  53. {dapps-0.2.0 → dapps-0.2.1}/MANIFEST.in +0 -0
  54. {dapps-0.2.0 → dapps-0.2.1}/SECURITY.md +0 -0
  55. {dapps-0.2.0 → dapps-0.2.1}/docs/dapp_uml.txt +0 -0
  56. {dapps-0.2.0 → dapps-0.2.1}/docs/ground_truth_labeling.md +0 -0
  57. {dapps-0.2.0 → dapps-0.2.1}/docs/gui_uml.txt +0 -0
  58. {dapps-0.2.0 → dapps-0.2.1}/libiqsaver/CMakeLists.txt +0 -0
  59. {dapps-0.2.0 → dapps-0.2.1}/libiqsaver/cmake/libiqsaver.pc.in +0 -0
  60. {dapps-0.2.0 → dapps-0.2.1}/libiqsaver/cmake/libiqsaverConfig.cmake.in +0 -0
  61. {dapps-0.2.0 → dapps-0.2.1}/libiqsaver/include/iqsaver/annotation.hpp +0 -0
  62. {dapps-0.2.0 → dapps-0.2.1}/libiqsaver/include/iqsaver/iq_saver_writer.hpp +0 -0
  63. {dapps-0.2.0 → dapps-0.2.1}/libiqsaver/include/iqsaver/iqsaver.hpp +0 -0
  64. {dapps-0.2.0 → dapps-0.2.1}/libiqsaver/include/iqsaver/types.hpp +0 -0
  65. {dapps-0.2.0 → dapps-0.2.1}/libiqsaver/include/iqsaver/version.hpp.in +0 -0
  66. {dapps-0.2.0 → dapps-0.2.1}/libiqsaver/src/iq_saver_writer.cpp +0 -0
  67. {dapps-0.2.0 → dapps-0.2.1}/libiqsaver/swig/iqsaver.i +0 -0
  68. {dapps-0.2.0 → dapps-0.2.1}/libiqsaver/swig/iqsaver_swig.cpp +0 -0
  69. {dapps-0.2.0 → dapps-0.2.1}/libiqsaver/swig/iqsaver_swig.hpp +0 -0
  70. {dapps-0.2.0 → dapps-0.2.1}/src/dapp/__init__.py +0 -0
  71. {dapps-0.2.0 → dapps-0.2.1}/src/e3interface/__init__.py +0 -0
  72. {dapps-0.2.0 → dapps-0.2.1}/src/e3interface/e3_logging.py +0 -0
  73. {dapps-0.2.0 → dapps-0.2.1}/src/iq_saver/__init__.py +0 -0
  74. {dapps-0.2.0 → dapps-0.2.1}/src/iq_saver/iq_saver.py +0 -0
  75. {dapps-0.2.0 → dapps-0.2.1}/src/nvidia/__init__.py +0 -0
  76. {dapps-0.2.0 → dapps-0.2.1}/src/nvidia/defs/e3sm_nvidia.asn +0 -0
  77. {dapps-0.2.0 → dapps-0.2.1}/src/nvidia/defs/e3sm_nvidia.json +0 -0
  78. {dapps-0.2.0 → dapps-0.2.1}/src/nvidia/nvidia_dapp.py +0 -0
  79. {dapps-0.2.0 → dapps-0.2.1}/src/simple/__init__.py +0 -0
  80. {dapps-0.2.0 → dapps-0.2.1}/src/spectrum/README.md +0 -0
  81. {dapps-0.2.0 → dapps-0.2.1}/src/spectrum/__init__.py +0 -0
  82. {dapps-0.2.0 → dapps-0.2.1}/src/spectrum/adaptive_noise_floor.py +0 -0
  83. {dapps-0.2.0 → dapps-0.2.1}/src/spectrum/defs/e3sm_oai_l1_kpm.asn +0 -0
  84. {dapps-0.2.0 → dapps-0.2.1}/src/spectrum/defs/e3sm_spectrum.asn +0 -0
  85. {dapps-0.2.0 → dapps-0.2.1}/src/spectrum/defs/e3sm_spectrum.json +0 -0
  86. {dapps-0.2.0 → dapps-0.2.1}/src/spectrum/e3_l2_sensing_reader.py +0 -0
  87. {dapps-0.2.0 → dapps-0.2.1}/src/spectrum/embargo_manager.py +0 -0
  88. {dapps-0.2.0 → dapps-0.2.1}/src/spectrum/threshold_detector.py +0 -0
  89. {dapps-0.2.0 → dapps-0.2.1}/src/visualization/__init__.py +0 -0
  90. {dapps-0.2.0 → dapps-0.2.1}/src/visualization/energy.py +0 -0
  91. {dapps-0.2.0 → dapps-0.2.1}/src/visualization/grafana.py +0 -0
  92. {dapps-0.2.0 → dapps-0.2.1}/src/visualization/influx.py +0 -0
  93. {dapps-0.2.0 → dapps-0.2.1}/src/visualization/iq.py +0 -0
  94. {dapps-0.2.0 → dapps-0.2.1}/src/visualization/subcarrier/insi_white.png +0 -0
  95. {dapps-0.2.0 → dapps-0.2.1}/src/visualization/subcarrier/start_subcarrier_visualizer.sh +0 -0
  96. {dapps-0.2.0 → dapps-0.2.1}/src/visualization/subcarrier/subcarrier_visualizer.py +0 -0
  97. {dapps-0.2.0 → dapps-0.2.1}/src/visualization/subcarrier_pub.py +0 -0
  98. {dapps-0.2.0 → dapps-0.2.1}/start_dapp.sh +0 -0
  99. {dapps-0.2.0 → dapps-0.2.1}/tests/test_e3_concurrency.py +0 -0
  100. {dapps-0.2.0 → dapps-0.2.1}/tests/test_iq_saver.py +0 -0
  101. {dapps-0.2.0 → dapps-0.2.1}/tests/test_sensing_policy.py +0 -0
  102. {dapps-0.2.0 → dapps-0.2.1}/tests/test_spectrum_telemetry.py +0 -0
  103. {dapps-0.2.0 → dapps-0.2.1}/tools/README.md +0 -0
  104. {dapps-0.2.0 → dapps-0.2.1}/tools/asntojson.py +0 -0
  105. {dapps-0.2.0 → dapps-0.2.1}/tools/generate_sm.sh +0 -0
  106. {dapps-0.2.0 → dapps-0.2.1}/tools/read_recording.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dapps
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: A library for creating and connecting dApps to Open RAN units.
5
5
  Keywords: dApps,O-RAN,5G,cellular,networks
6
6
  Author-Email: Andrea Lacava <thecave003@gmail.com>
@@ -19,9 +19,9 @@ Requires-Python: >=3.12
19
19
  Requires-Dist: asn1tools
20
20
  Requires-Dist: typing_extensions
21
21
  Requires-Dist: numpy
22
- Requires-Dist: pyzmq
23
22
  Requires-Dist: sigmf
24
23
  Requires-Dist: jsonschema>=4.18.0
24
+ Requires-Dist: protobuf>=4.21
25
25
  Provides-Extra: api
26
26
  Requires-Dist: influxdb_client; extra == "api"
27
27
  Provides-Extra: cnn
@@ -31,6 +31,7 @@ Requires-Dist: flask; extra == "gui"
31
31
  Requires-Dist: flask-sock; extra == "gui"
32
32
  Requires-Dist: flask-cors; extra == "gui"
33
33
  Requires-Dist: matplotlib; extra == "gui"
34
+ Requires-Dist: pyzmq; extra == "gui"
34
35
  Provides-Extra: network
35
36
  Requires-Dist: pysctp; extra == "network"
36
37
  Provides-Extra: all
@@ -39,6 +40,7 @@ Requires-Dist: flask; extra == "all"
39
40
  Requires-Dist: flask-sock; extra == "all"
40
41
  Requires-Dist: flask-cors; extra == "all"
41
42
  Requires-Dist: matplotlib; extra == "all"
43
+ Requires-Dist: pyzmq; extra == "all"
42
44
  Requires-Dist: influxdb_client; extra == "all"
43
45
  Requires-Dist: libiq; extra == "all"
44
46
  Description-Content-Type: text/markdown
@@ -49,6 +51,26 @@ A complete tutorial on how to deploy a dApp can be found on the [OpenRAN Gym web
49
51
 
50
52
  ## Installation
51
53
 
54
+ ### Prerequisite: libe3 Python bindings (`libe3py`)
55
+
56
+ All **E3AP** operations (transport, setup handshake, subscribe, indication/control
57
+ framing, and the ASN.1/JSON/Protobuf wire encoding) are handled by
58
+ [**libe3**](https://github.com/wineslab/libe3); this library keeps only the
59
+ **E3SM** (service-model) encode/decode in Python — the same split OAI uses on the
60
+ RAN side. You must therefore install libe3 with its Python bindings **into the
61
+ same interpreter/venv** that runs the dApp, *before* installing this package:
62
+
63
+ ```bash
64
+ cd ~/libe3
65
+ ./build_libe3 --install --enable-swig \
66
+ --cmake-opt "-DLIBE3_ENABLE_ASN1=ON -DLIBE3_ENABLE_JSON=ON"
67
+ python3 -c "import libe3py; print('libe3py OK')"
68
+ ```
69
+
70
+ The dApp's `--link` / `--transport` / `--encoding` must match the gNB's
71
+ `E3Configuration`. See [libe3's `swig/README.md`](https://github.com/wineslab/libe3/blob/main/swig/README.md)
72
+ for the binding architecture.
73
+
52
74
  ### Python package installation (recommended)
53
75
 
54
76
  ```
@@ -237,7 +259,7 @@ spear-openairinterface5g/openair2/E3AP/service_models/<sm_name>_sm/
237
259
 
238
260
  For dApp-side (when `--target dapp` or `both`):
239
261
  ```
240
- spear-dApp/src/<sm_name>/
262
+ dApp-library/src/<sm_name>/
241
263
  ├── __init__.py
242
264
  ├── <sm_name>_dapp.py # Main dApp implementation
243
265
  └── defs/
@@ -4,6 +4,26 @@ A complete tutorial on how to deploy a dApp can be found on the [OpenRAN Gym web
4
4
 
5
5
  ## Installation
6
6
 
7
+ ### Prerequisite: libe3 Python bindings (`libe3py`)
8
+
9
+ All **E3AP** operations (transport, setup handshake, subscribe, indication/control
10
+ framing, and the ASN.1/JSON/Protobuf wire encoding) are handled by
11
+ [**libe3**](https://github.com/wineslab/libe3); this library keeps only the
12
+ **E3SM** (service-model) encode/decode in Python — the same split OAI uses on the
13
+ RAN side. You must therefore install libe3 with its Python bindings **into the
14
+ same interpreter/venv** that runs the dApp, *before* installing this package:
15
+
16
+ ```bash
17
+ cd ~/libe3
18
+ ./build_libe3 --install --enable-swig \
19
+ --cmake-opt "-DLIBE3_ENABLE_ASN1=ON -DLIBE3_ENABLE_JSON=ON"
20
+ python3 -c "import libe3py; print('libe3py OK')"
21
+ ```
22
+
23
+ The dApp's `--link` / `--transport` / `--encoding` must match the gNB's
24
+ `E3Configuration`. See [libe3's `swig/README.md`](https://github.com/wineslab/libe3/blob/main/swig/README.md)
25
+ for the binding architecture.
26
+
7
27
  ### Python package installation (recommended)
8
28
 
9
29
  ```
@@ -192,7 +212,7 @@ spear-openairinterface5g/openair2/E3AP/service_models/<sm_name>_sm/
192
212
 
193
213
  For dApp-side (when `--target dapp` or `both`):
194
214
  ```
195
- spear-dApp/src/<sm_name>/
215
+ dApp-library/src/<sm_name>/
196
216
  ├── __init__.py
197
217
  ├── <sm_name>_dapp.py # Main dApp implementation
198
218
  └── defs/
dapps-0.2.1/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.2.1
@@ -0,0 +1,3 @@
1
+ """Runnable dApp examples, shipped in the wheel so they can be launched with
2
+ ``python -m examples.spectrum_dapp`` / ``python -m examples.simple_dapp`` from an
3
+ installed ``dapps`` package (e.g. the OAI rfsim CI driving the real dApp)."""
@@ -6,7 +6,7 @@ Example script to showcase the Nvidia dApp
6
6
  import argparse
7
7
  import time
8
8
 
9
- from e3interface.e3_connector import E3LinkLayer, E3TransportLayer
9
+ from e3interface.e3_transport import E3LinkLayer, E3TransportLayer
10
10
  from nvidia.nvidia_dapp import NvidiaDApp
11
11
 
12
12
 
@@ -13,7 +13,7 @@ import argparse
13
13
  import threading
14
14
  import time
15
15
 
16
- from e3interface.e3_connector import E3LinkLayer, E3TransportLayer
16
+ from e3interface.e3_transport import E3LinkLayer, E3TransportLayer
17
17
  from simple.simple_dapp import SimpleDApp
18
18
 
19
19
 
@@ -101,7 +101,7 @@ if __name__ == "__main__":
101
101
  "--encoding",
102
102
  type=str,
103
103
  default="asn1",
104
- choices=["asn1", "json"],
104
+ choices=["asn1", "json", "protobuf"],
105
105
  help="Encoding format (default: asn1)",
106
106
  )
107
107
  parser.add_argument(
@@ -8,7 +8,7 @@ import threading
8
8
  import time
9
9
  import logging
10
10
 
11
- from e3interface.e3_connector import E3LinkLayer, E3TransportLayer
11
+ from e3interface.e3_transport import E3LinkLayer, E3TransportLayer
12
12
  from spectrum.spectrum_dapp import (
13
13
  SpectrumSharingDApp,
14
14
  compute_fft_size,
@@ -251,7 +251,7 @@ if __name__ == "__main__":
251
251
  "1/beta). Default 1/2048 matches the gNB code default; "
252
252
  "the X410 sample conf overrides it to 0.0078125 (1/128).")
253
253
  parser.add_argument('--encoding-method', type=str, default='asn1',
254
- choices=['asn1', 'json'],
254
+ choices=['asn1', 'json', 'protobuf'],
255
255
  help="Wire encoding for Spectrum-* envelopes (default: asn1).")
256
256
  parser.add_argument('--no-sensing-only', dest='sensing_only',
257
257
  action='store_false', default=True,
@@ -19,13 +19,20 @@ classifiers = [
19
19
  ]
20
20
  license = "Apache-2.0"
21
21
  license-files = ["LICENSE"]
22
+ # NOTE: E3AP transport is provided by libe3's Python bindings (`libe3py`),
23
+ # which are not on PyPI. Install them into this environment with:
24
+ # cd ~/libe3 && ./build_libe3 --install --enable-swig \
25
+ # --cmake-opt "-DLIBE3_ENABLE_ASN1=ON -DLIBE3_ENABLE_JSON=ON"
26
+ # (asn1tools is still required for the in-Python service-model codecs.)
22
27
  dependencies = [
23
28
  "asn1tools",
24
29
  "typing_extensions",
25
30
  "numpy",
26
- "pyzmq",
27
31
  "sigmf",
28
32
  "jsonschema>=4.18.0",
33
+ # protobuf E3SM codec path (spectrum/simple SMs); >=4.21 for FieldDescriptor
34
+ # .has_presence and the current generated-code format.
35
+ "protobuf>=4.21",
29
36
  ]
30
37
 
31
38
  authors = [
@@ -43,7 +50,7 @@ Source = "https://github.com/wineslab/dApp-library"
43
50
  [project.optional-dependencies]
44
51
  api = ["influxdb_client"]
45
52
  cnn = ["libiq"]
46
- gui = ["flask", "flask-sock", "flask-cors", "matplotlib"]
53
+ gui = ["flask", "flask-sock", "flask-cors", "matplotlib", "pyzmq"]
47
54
  network = ["pysctp"]
48
55
  all = [
49
56
  "pysctp",
@@ -51,6 +58,7 @@ all = [
51
58
  "flask-sock",
52
59
  "flask-cors",
53
60
  "matplotlib",
61
+ "pyzmq",
54
62
  "influxdb_client",
55
63
  "libiq",
56
64
  ]
@@ -72,6 +80,10 @@ wheel.packages = [
72
80
  "src/simple",
73
81
  "src/iq_saver",
74
82
  "src/visualization",
83
+ # Ship the runnable examples so they can be launched from the installed
84
+ # wheel via `python -m examples.<name>` (e.g. the OAI rfsim CI driving the
85
+ # real spectrum dApp) instead of a hand-rolled launcher.
86
+ "examples",
75
87
  ]
76
88
 
77
89
  # Include the libiqsaver C++ tree and the root CMake in the sdist so
@@ -10,7 +10,6 @@ from abc import ABC, abstractmethod
10
10
  import threading
11
11
  import time
12
12
  from e3interface.e3_interface import E3Interface
13
- from e3interface.e3_encoder import AsnE3Encoder, JsonE3Encoder
14
13
  from e3interface.e3_logging import dapp_logger
15
14
 
16
15
  class DApp(ABC):
@@ -30,16 +29,14 @@ class DApp(ABC):
30
29
  self.dapp_version = dapp_version
31
30
  self.vendor = vendor
32
31
  self.e3ap_protocol_version = e3ap_protocol_version
33
- self.encoding_method = encoding_method
34
- match self.encoding_method:
35
- case "asn1":
36
- encoder = AsnE3Encoder()
37
- case "json":
38
- encoder = JsonE3Encoder()
39
- case _:
40
- raise ValueError(f"Unsupported encoding method: {self.encoding_method}")
41
-
42
- self.e3_interface = E3Interface(encoder=encoder, link=link, transport=transport)
32
+ self.encoding_method = encoding_method
33
+ if encoding_method not in ("asn1", "json", "protobuf"):
34
+ raise ValueError(f"Unsupported encoding method: {encoding_method}")
35
+
36
+ # libe3 owns E3AP (transport + wire encoding); the encoding string is
37
+ # passed straight through and must match the gNB E3Configuration.
38
+ self.e3_interface = E3Interface(
39
+ link=link, transport=transport, encoding=encoding_method)
43
40
  self.stop_event = threading.Event()
44
41
 
45
42
  dapp_logger.info(f'Using {link} and {transport}')