smolpy 1.10.1.dev2__tar.gz → 1.10.2.dev2__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 (151) hide show
  1. smolpy-1.10.2.dev2/.github/workflows/ns3-base.yml +131 -0
  2. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/PKG-INFO +1 -1
  3. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/adr/0004-execution-backends.md +2 -2
  4. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/roadmap.md +2 -2
  5. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/__init__.py +7 -0
  6. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/cli.py +3 -0
  7. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_cli.py +16 -0
  8. smolpy-1.10.1.dev2/.github/workflows/ns3-base.yml +0 -86
  9. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/.github/workflows/ci.yml +0 -0
  10. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/.github/workflows/dev-build.yml +0 -0
  11. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/.github/workflows/docker-image.yml +0 -0
  12. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/.github/workflows/docs.yml +0 -0
  13. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/.github/workflows/github-release.yml +0 -0
  14. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/.github/workflows/publish.yml +0 -0
  15. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/.github/workflows/release.yml +0 -0
  16. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/.github/workflows/rust-wheels.yml +0 -0
  17. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/.gitignore +0 -0
  18. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/LICENSE +0 -0
  19. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/README.md +0 -0
  20. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/benchmarks/__init__.py +0 -0
  21. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/benchmarks/__main__.py +0 -0
  22. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/benchmarks/load.py +0 -0
  23. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/benchmarks/results/2026-11-13-0921-simpy-jaws-zbook-baseline.json +0 -0
  24. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/benchmarks/results/2026-11-13-1527-simpy-jaws-zbook-optimised.json +0 -0
  25. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/benchmarks/results/2026-11-13-2116-simpy-jaws-zbook-research-batch.json +0 -0
  26. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/benchmarks/results/2026-11-13-2119-simpy-jaws-zbook-research-b4.json +0 -0
  27. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/benchmarks/results/2026-11-15-1255-rust-jaws-zbook-stop-criterion.json +0 -0
  28. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/benchmarks/results/2026-11-15-1333-rust-jaws-zbook-research-b4.json +0 -0
  29. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/benchmarks/results/2026-11-15-1346-rust-jaws-zbook-research-batch.json +0 -0
  30. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/benchmarks/results/2026-11-16-1839-simpy-ns3-jaws-zbook-tcp-under-load.json +0 -0
  31. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/benchmarks/runner.py +0 -0
  32. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/benchmarks/scenarios.py +0 -0
  33. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/benchmarks/worker.py +0 -0
  34. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docker/Dockerfile +0 -0
  35. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docker/Dockerfile.dockerignore +0 -0
  36. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docker/Dockerfile.ns3 +0 -0
  37. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docker/Dockerfile.ns3.dockerignore +0 -0
  38. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docker/ns3-base/Dockerfile +0 -0
  39. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docker/ns3-base/smoke.cc +0 -0
  40. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docker/smoke.smol +0 -0
  41. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/adr/0001-protocol-package-structure.md +0 -0
  42. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/adr/0002-modbus-tcp-implementation.md +0 -0
  43. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/adr/0003-smol-external-dsl.md +0 -0
  44. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/adr/0005-profinet-rt.md +0 -0
  45. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/adr/0006-profiling-and-baseline-benchmark.md +0 -0
  46. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/adr/0007-execution-independent-scenario-model.md +0 -0
  47. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/adr/0008-rust-des-engine-mvp.md +0 -0
  48. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/adr/0009-batch-execution-and-cross-backend-validation.md +0 -0
  49. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/adr/0010-ethernet-frames-on-the-wire.md +0 -0
  50. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/backends.md +0 -0
  51. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/benchmarks.md +0 -0
  52. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/dashboard.md +0 -0
  53. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/dsl-reference.md +0 -0
  54. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/examples.md +0 -0
  55. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/index.md +0 -0
  56. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/language-reference.md +0 -0
  57. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/modbus.md +0 -0
  58. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/model-semantics.md +0 -0
  59. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/mqtt.md +0 -0
  60. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/profinet.md +0 -0
  61. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/scenario-model.md +0 -0
  62. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/docs/simulation-engine.md +0 -0
  63. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/examples/README.md +0 -0
  64. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/examples/example.py +0 -0
  65. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/examples/example.smol +0 -0
  66. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/examples/example_10_clients.py +0 -0
  67. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/examples/example_12_clients.py +0 -0
  68. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/examples/example_20_clients.py +0 -0
  69. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/examples/example_file_transfer.py +0 -0
  70. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/examples/example_modbus.py +0 -0
  71. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/examples/example_mqtt.py +0 -0
  72. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/examples/example_profinet.py +0 -0
  73. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/examples/example_profinet.smol +0 -0
  74. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/examples/example_staggered_transfer.py +0 -0
  75. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/examples/example_two_tier.py +0 -0
  76. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/mkdocs.yml +0 -0
  77. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/pyproject.toml +0 -0
  78. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/rust/Cargo.lock +0 -0
  79. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/rust/Cargo.toml +0 -0
  80. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/rust/smol-engine/Cargo.toml +0 -0
  81. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/rust/smol-engine/src/frames.rs +0 -0
  82. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/rust/smol-engine/src/lib.rs +0 -0
  83. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/rust/smol-engine/src/rng.rs +0 -0
  84. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/rust/smol-engine/src/scenario.rs +0 -0
  85. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/rust/smol-engine/src/sim.rs +0 -0
  86. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/rust/smol-engine/src/timebase.rs +0 -0
  87. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/rust/smolpy-engine-rs/Cargo.toml +0 -0
  88. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/rust/smolpy-engine-rs/README.md +0 -0
  89. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/rust/smolpy-engine-rs/pyproject.toml +0 -0
  90. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/rust/smolpy-engine-rs/smoke_test.py +0 -0
  91. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/rust/smolpy-engine-rs/src/lib.rs +0 -0
  92. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/_worker.py +0 -0
  93. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/backends.py +0 -0
  94. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/batch.py +0 -0
  95. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/core/__init__.py +0 -0
  96. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/core/adapter.py +0 -0
  97. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/core/batch.py +0 -0
  98. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/core/link.py +0 -0
  99. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/core/network.py +0 -0
  100. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/core/node.py +0 -0
  101. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/core/observation.py +0 -0
  102. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/ethernet/__init__.py +0 -0
  103. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/ethernet/switch.py +0 -0
  104. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/lang/__init__.py +0 -0
  105. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/lang/ast.py +0 -0
  106. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/lang/errors.py +0 -0
  107. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/lang/grammar.lark +0 -0
  108. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/lang/interpreter.py +0 -0
  109. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/lang/transformer.py +0 -0
  110. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/modbus/__init__.py +0 -0
  111. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/modbus/slave.py +0 -0
  112. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/model/__init__.py +0 -0
  113. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/model/frames.py +0 -0
  114. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/model/scenario.py +0 -0
  115. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/model/streams.py +0 -0
  116. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/model/timebase.py +0 -0
  117. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/model/validate.py +0 -0
  118. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/mqtt/__init__.py +0 -0
  119. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/mqtt/broker.py +0 -0
  120. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/ns3/__init__.py +0 -0
  121. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/ns3/cpp/smol-ns3.cc +0 -0
  122. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/profinet/__init__.py +0 -0
  123. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/profinet/device.py +0 -0
  124. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/sim/__init__.py +0 -0
  125. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/sim/engine.py +0 -0
  126. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/stats.py +0 -0
  127. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/viz/__init__.py +0 -0
  128. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/viz/dashboard.py +0 -0
  129. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/src/smolpy/viz/text_dashboard.py +0 -0
  130. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/__init__.py +0 -0
  131. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/equivalence/__init__.py +0 -0
  132. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/equivalence/harness.py +0 -0
  133. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/equivalence/scenarios.py +0 -0
  134. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/equivalence/test_equivalence.py +0 -0
  135. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/equivalence/test_rust_timebase.py +0 -0
  136. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_backends.py +0 -0
  137. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_batch.py +0 -0
  138. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_benchmarks.py +0 -0
  139. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_dsl.py +0 -0
  140. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_engine_ir.py +0 -0
  141. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_lang.py +0 -0
  142. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_model.py +0 -0
  143. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_ns3.py +0 -0
  144. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_profinet.py +0 -0
  145. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_semantics.py +0 -0
  146. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_simulation.py +0 -0
  147. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_stats.py +0 -0
  148. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_sweep.py +0 -0
  149. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_timebase.py +0 -0
  150. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/tests/test_validate.py +0 -0
  151. {smolpy-1.10.1.dev2 → smolpy-1.10.2.dev2}/uv.lock +0 -0
@@ -0,0 +1,131 @@
1
+ name: ns-3 base image
2
+
3
+ # ghcr.io/jwszolek/smolpy-ns3-base:<ns-3 version> (ADR-0004, Container
4
+ # images): the pinned ns-3 release, built once. It is rebuilt only when its
5
+ # Dockerfile changes, which is how the pinned release changes, so releases
6
+ # never build ns-3. For linux/amd64 and linux/arm64, each built on a runner of
7
+ # its own architecture, as an emulated build of ns-3 would take hours: each
8
+ # platform is pushed as <ns-3 version>-<arch>, and <ns-3 version> is the
9
+ # multi-platform index of the two.
10
+ #
11
+ # Every build is tested before it is pushed: a scratch program, as the ns-3
12
+ # backend's generated scenarios will be, built and run against it.
13
+ #
14
+ # - On a pull request that changes it: build and test both, push nothing.
15
+ # - After the merge to main, or run by hand: build, test and push.
16
+
17
+ on:
18
+ push:
19
+ branches:
20
+ - main
21
+ paths:
22
+ - "docker/ns3-base/**"
23
+ - ".github/workflows/ns3-base.yml"
24
+ pull_request:
25
+ paths:
26
+ - "docker/ns3-base/**"
27
+ - ".github/workflows/ns3-base.yml"
28
+ workflow_dispatch:
29
+
30
+ jobs:
31
+ image:
32
+ name: ns-3 base image, ${{ matrix.platform }}
33
+ runs-on: ${{ matrix.runner }}
34
+ timeout-minutes: 120
35
+ permissions:
36
+ contents: read
37
+ packages: write # push to ghcr.io
38
+
39
+ strategy:
40
+ fail-fast: false
41
+ matrix:
42
+ include:
43
+ - { platform: linux/amd64, arch: amd64, runner: ubuntu-latest }
44
+ - { platform: linux/arm64, arch: arm64, runner: ubuntu-24.04-arm }
45
+
46
+ env:
47
+ IMAGE: ghcr.io/${{ github.repository_owner }}/smolpy-ns3-base
48
+ PUSH: ${{ github.event_name != 'pull_request' }}
49
+
50
+ outputs:
51
+ version: ${{ steps.v.outputs.version }}
52
+
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+
56
+ - name: The pinned ns-3 release
57
+ id: v
58
+ run: |
59
+ VERSION=$(sed -nE 's/^ARG NS3_VERSION=(.+)$/\1/p' docker/ns3-base/Dockerfile)
60
+ test -n "$VERSION"
61
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
62
+ echo "ns-3 $VERSION on $(uname -m)"
63
+
64
+ - uses: docker/setup-buildx-action@v3
65
+
66
+ # the layers of an unchanged ns-3 build come from the cache
67
+ - name: Build
68
+ uses: docker/build-push-action@v6
69
+ with:
70
+ context: docker/ns3-base
71
+ platforms: ${{ matrix.platform }}
72
+ load: true
73
+ tags: ns3-base:test
74
+ cache-from: type=gha,scope=ns3-base-${{ matrix.arch }}
75
+ cache-to: type=gha,scope=ns3-base-${{ matrix.arch }},mode=max
76
+
77
+ - name: Test with a scratch program
78
+ run: |
79
+ docker run --rm -v "$PWD/docker/ns3-base/smoke.cc:/opt/ns-3/scratch/smoke.cc:ro" \
80
+ ns3-base:test ./ns3 run smoke
81
+ docker image inspect --format '{{.Os}}/{{.Architecture}}' ns3-base:test \
82
+ | grep -qx "${{ matrix.platform }}"
83
+ docker image ls ns3-base:test
84
+
85
+ - name: Log in to ghcr.io
86
+ if: ${{ env.PUSH == 'true' }}
87
+ uses: docker/login-action@v3
88
+ with:
89
+ registry: ghcr.io
90
+ username: ${{ github.actor }}
91
+ password: ${{ secrets.GITHUB_TOKEN }}
92
+
93
+ - name: Push
94
+ if: ${{ env.PUSH == 'true' }}
95
+ env:
96
+ VERSION: ${{ steps.v.outputs.version }}
97
+ run: |
98
+ docker tag ns3-base:test "$IMAGE:$VERSION-${{ matrix.arch }}"
99
+ docker push "$IMAGE:$VERSION-${{ matrix.arch }}"
100
+ echo "Pushed $IMAGE:$VERSION-${{ matrix.arch }}" >> "$GITHUB_STEP_SUMMARY"
101
+
102
+ # <ns-3 version>: one tag for both platforms, from the images tested above
103
+ index:
104
+ name: ns-3 base image, both platforms
105
+ needs: image
106
+ if: ${{ github.event_name != 'pull_request' }}
107
+ runs-on: ubuntu-latest
108
+ permissions:
109
+ contents: read
110
+ packages: write # push to ghcr.io
111
+
112
+ env:
113
+ IMAGE: ghcr.io/${{ github.repository_owner }}/smolpy-ns3-base
114
+ VERSION: ${{ needs.image.outputs.version }}
115
+
116
+ steps:
117
+ - uses: docker/setup-buildx-action@v3
118
+
119
+ - name: Log in to ghcr.io
120
+ uses: docker/login-action@v3
121
+ with:
122
+ registry: ghcr.io
123
+ username: ${{ github.actor }}
124
+ password: ${{ secrets.GITHUB_TOKEN }}
125
+
126
+ - name: Push the index
127
+ run: |
128
+ docker buildx imagetools create -t "$IMAGE:$VERSION" \
129
+ "$IMAGE:$VERSION-amd64" "$IMAGE:$VERSION-arm64"
130
+ docker buildx imagetools inspect "$IMAGE:$VERSION"
131
+ echo "Pushed $IMAGE:$VERSION for linux/amd64 and linux/arm64" >> "$GITHUB_STEP_SUMMARY"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: smolpy
3
- Version: 1.10.1.dev2
3
+ Version: 1.10.2.dev2
4
4
  Summary: Network simulation DSL and discrete-event simulator
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -308,7 +308,7 @@ PROFINET RT is a layer 2 protocol (EtherType 0x8892), without IP, so ns-3's stac
308
308
  This meets Phase 6's exit criterion that differences under load are quantified and documented.
309
309
 
310
310
  **The ns-3 base image, as built** *(2026-11-16)*:
311
- - `ghcr.io/jwszolek/smolpy-ns3-base:3.49`, built by `.github/workflows/ns3-base.yml` from `docker/ns3-base/Dockerfile`, for `linux/amd64` only for now. It is rebuilt when that Dockerfile changes, and pushed after the merge to `main`.
311
+ - `ghcr.io/jwszolek/smolpy-ns3-base:3.49`, built by `.github/workflows/ns3-base.yml` from `docker/ns3-base/Dockerfile`, for `linux/amd64` and `linux/arm64`. Each platform is built and tested on a GitHub runner of its own architecture (`ubuntu-latest`, `ubuntu-24.04-arm`) and pushed as `3.49-amd64` and `3.49-arm64`; `3.49` is the index of both. It is rebuilt when that Dockerfile changes, and pushed after the merge to `main`.
312
312
  - **Pinned release:** ns-3.49 (released 2026-10-07), as the git tag `ns-3.49` with its commit checked. Debian 12's g++ 12 and CMake 3.25 meet its minimums: g++ 11.1, C++23 and CMake 3.25.
313
313
  - **Build:**
314
314
  - The `release` profile, without examples, tests or Python bindings.
@@ -332,7 +332,7 @@ This meets Phase 6's exit criterion that differences under load are quantified a
332
332
  - How ns-3 queue lengths should be sampled so that `queue_depth` is comparable to SimPy's per-port frame count.
333
333
  - Whether the pinned ns-3 release's build tool supports building scratch programs with an extra module cleanly, or the module should be installed as a contrib module. *(Resolved: scratch programs build against the prebuilt modules; see the base image above.)*
334
334
  - The size of the `-ns3` image, and whether to build ns-3 in its `optimized` profile only, without examples and tests, to keep it small.
335
- - Whether GitHub's hosted runners can build the ns-3 base image for `linux/arm64` in reasonable time, or that platform needs a native arm64 runner or is offered for `amd64` only at first. *(Decided: `amd64` only at first; `arm64` on a native runner later.)*
335
+ - Whether GitHub's hosted runners can build the ns-3 base image for `linux/arm64` in reasonable time, or that platform needs a native arm64 runner or is offered for `amd64` only at first. *(Decided: `amd64` only at first; `arm64` on a native runner later. As built (2026-11-17): the base image on GitHub's hosted arm64 runner.)*
336
336
 
337
337
  ---
338
338
 
@@ -172,9 +172,9 @@ A code-generated ns-3 scenario from the Scenario IR. Gives a realistic TCP/IP st
172
172
 
173
173
  ns-3 cannot be installed with `pip`, so the backend ships as a container image, `ghcr.io/jwszolek/smolpy:<version>-ns3`. It holds the pinned ns-3 release built once, and CI runs the ns-3 equivalence suite in it ([ADR-0004 — Container images](adr/0004-execution-backends.md#container-images)). A lighter image with SMOLPy and the Rust engine, without ns-3, can be published from the first release of `smolpy-engine-rs`.
174
174
 
175
- **Status: done.** All 3 steps are done, and so are the exit criteria. `arm64` for the ns-3 images follows on a native runner.
175
+ **Status: done.** All 3 steps are done, and so are the exit criteria. The ns-3 base image is built for `arm64` too, on a native runner; the `-ns3` image follows it there.
176
176
  1. **The image without ns-3: done.** `ghcr.io/jwszolek/smolpy:<version>` holds SMOLPy and the Rust engine, for `linux/amd64` and `linux/arm64`. It is built, tested and pushed at each release.
177
- 2. **The ns-3 base image: done.** `ghcr.io/jwszolek/smolpy-ns3-base:3.49` holds ns-3.49, built once, for `linux/amd64`. `arm64` follows on a native runner.
177
+ 2. **The ns-3 base image: done.** `ghcr.io/jwszolek/smolpy-ns3-base:3.49` holds ns-3.49, built once, for `linux/amd64` and `linux/arm64`, each on a runner of its own architecture.
178
178
  3. **The ns-3 backend.**
179
179
  - **Ethernet: done.** `backend="ns3"` runs adapters, switches and flows with every pattern, IMIX and 802.1Q priorities, with the six Ethernet metrics, on ns-3's IPv4/UDP stack.
180
180
  - It runs over SMOL's own full-duplex Ethernet device, because ns-3's CSMA is half duplex (ADR-0004).
@@ -1,9 +1,16 @@
1
+ from importlib.metadata import PackageNotFoundError, version
2
+
1
3
  from smolpy.batch import BatchResult, Run, run_many
2
4
  from smolpy.core.network import Network
3
5
  from smolpy.modbus.slave import ModbusSlave
4
6
  from smolpy.mqtt.broker import MQTTBroker
5
7
  from smolpy.profinet.device import ProfinetDevice
6
8
 
9
+ try:
10
+ __version__ = version("smolpy") # the installed distribution's, from git at build time
11
+ except PackageNotFoundError: # run from a source tree that is not installed
12
+ __version__ = "0+unknown"
13
+
7
14
  __all__ = [
8
15
  "BatchResult",
9
16
  "MQTTBroker",
@@ -14,6 +14,8 @@ from rich.progress import Progress, SpinnerColumn, TextColumn, TimeElapsedColumn
14
14
  from rich.text import Text
15
15
  from rich.theme import Theme
16
16
 
17
+ from smolpy import __version__
18
+
17
19
  if TYPE_CHECKING:
18
20
  from smolpy.model import Scenario
19
21
 
@@ -303,6 +305,7 @@ def main() -> None:
303
305
  prog="smolpy",
304
306
  description="SMOLPy — Network simulation DSL and discrete-event simulator",
305
307
  )
308
+ parser.add_argument("--version", action="version", version=f"smolpy {__version__}")
306
309
  sub = parser.add_subparsers(dest="command", required=True)
307
310
 
308
311
  run_cmd = sub.add_parser(
@@ -93,3 +93,19 @@ def test_runs_apply_to_smol_files_only(tmp_path) -> None:
93
93
  # after a Python script, the options are the script's own
94
94
  done = _smolpy(str(script), "--runs", "3")
95
95
  assert done.returncode == 0 and "args ['--runs', '3']" in done.stdout
96
+
97
+
98
+ def test_version_is_the_installed_distributions() -> None:
99
+ from importlib.metadata import version
100
+
101
+ import smolpy
102
+
103
+ assert smolpy.__version__ == version("smolpy")
104
+ out = subprocess.run(
105
+ [sys.executable, "-c", "from smolpy.cli import main; main()", "--version"],
106
+ capture_output=True,
107
+ text=True,
108
+ timeout=60,
109
+ )
110
+ assert out.returncode == 0
111
+ assert out.stdout.strip() == f"smolpy {smolpy.__version__}"
@@ -1,86 +0,0 @@
1
- name: ns-3 base image
2
-
3
- # ghcr.io/jwszolek/smolpy-ns3-base:<ns-3 version> (ADR-0004, Container
4
- # images): the pinned ns-3 release, built once. It is rebuilt only when its
5
- # Dockerfile changes, which is how the pinned release changes, so releases
6
- # never build ns-3. linux/amd64 for now; linux/arm64 is to follow on a native
7
- # runner, as an emulated build of ns-3 would take hours.
8
- #
9
- # Every build is tested before it is pushed: a scratch program, as the ns-3
10
- # backend's generated scenarios will be, built and run against it.
11
- #
12
- # - On a pull request that changes it: build and test, push nothing.
13
- # - After the merge to main, or run by hand: build, test and push.
14
-
15
- on:
16
- push:
17
- branches:
18
- - main
19
- paths:
20
- - "docker/ns3-base/**"
21
- - ".github/workflows/ns3-base.yml"
22
- pull_request:
23
- paths:
24
- - "docker/ns3-base/**"
25
- - ".github/workflows/ns3-base.yml"
26
- workflow_dispatch:
27
-
28
- jobs:
29
- image:
30
- name: ns-3 base image
31
- runs-on: ubuntu-latest
32
- timeout-minutes: 120
33
- permissions:
34
- contents: read
35
- packages: write # push to ghcr.io
36
-
37
- env:
38
- IMAGE: ghcr.io/${{ github.repository_owner }}/smolpy-ns3-base
39
- PUSH: ${{ github.event_name != 'pull_request' }}
40
-
41
- steps:
42
- - uses: actions/checkout@v4
43
-
44
- - name: The pinned ns-3 release
45
- id: v
46
- run: |
47
- VERSION=$(sed -nE 's/^ARG NS3_VERSION=(.+)$/\1/p' docker/ns3-base/Dockerfile)
48
- test -n "$VERSION"
49
- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
50
- echo "ns-3 $VERSION"
51
-
52
- - uses: docker/setup-buildx-action@v3
53
-
54
- # the layers of an unchanged ns-3 build come from the cache
55
- - name: Build
56
- uses: docker/build-push-action@v6
57
- with:
58
- context: docker/ns3-base
59
- platforms: linux/amd64
60
- load: true
61
- tags: ns3-base:test
62
- cache-from: type=gha,scope=ns3-base
63
- cache-to: type=gha,scope=ns3-base,mode=max
64
-
65
- - name: Test with a scratch program
66
- run: |
67
- docker run --rm -v "$PWD/docker/ns3-base/smoke.cc:/opt/ns-3/scratch/smoke.cc:ro" \
68
- ns3-base:test ./ns3 run smoke
69
- docker image ls ns3-base:test
70
-
71
- - name: Log in to ghcr.io
72
- if: ${{ env.PUSH == 'true' }}
73
- uses: docker/login-action@v3
74
- with:
75
- registry: ghcr.io
76
- username: ${{ github.actor }}
77
- password: ${{ secrets.GITHUB_TOKEN }}
78
-
79
- - name: Push
80
- if: ${{ env.PUSH == 'true' }}
81
- env:
82
- VERSION: ${{ steps.v.outputs.version }}
83
- run: |
84
- docker tag ns3-base:test "$IMAGE:$VERSION"
85
- docker push "$IMAGE:$VERSION"
86
- echo "Pushed $IMAGE:$VERSION" >> "$GITHUB_STEP_SUMMARY"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes