smolpy 1.8.2.dev10__tar.gz → 1.9.0__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.
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/.github/workflows/dev-build.yml +1 -0
- smolpy-1.9.0/.github/workflows/docker-image.yml +152 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/.github/workflows/publish.yml +15 -1
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/.github/workflows/release.yml +1 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/PKG-INFO +11 -1
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/README.md +10 -0
- smolpy-1.9.0/docker/Dockerfile +36 -0
- smolpy-1.9.0/docker/Dockerfile.dockerignore +3 -0
- smolpy-1.9.0/docker/smoke.smol +30 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/adr/0004-execution-backends.md +2 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/roadmap.md +5 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/.github/workflows/ci.yml +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/.github/workflows/docs.yml +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/.github/workflows/github-release.yml +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/.github/workflows/rust-wheels.yml +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/.gitignore +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/LICENSE +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/benchmarks/__init__.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/benchmarks/__main__.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/benchmarks/results/2026-11-13-0921-simpy-jaws-zbook-baseline.json +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/benchmarks/results/2026-11-13-1527-simpy-jaws-zbook-optimised.json +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/benchmarks/results/2026-11-13-2116-simpy-jaws-zbook-research-batch.json +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/benchmarks/results/2026-11-13-2119-simpy-jaws-zbook-research-b4.json +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/benchmarks/results/2026-11-15-1255-rust-jaws-zbook-stop-criterion.json +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/benchmarks/results/2026-11-15-1333-rust-jaws-zbook-research-b4.json +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/benchmarks/results/2026-11-15-1346-rust-jaws-zbook-research-batch.json +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/benchmarks/runner.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/benchmarks/scenarios.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/benchmarks/worker.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/adr/0001-protocol-package-structure.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/adr/0002-modbus-tcp-implementation.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/adr/0003-smol-external-dsl.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/adr/0005-profinet-rt.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/adr/0006-profiling-and-baseline-benchmark.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/adr/0007-execution-independent-scenario-model.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/adr/0008-rust-des-engine-mvp.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/adr/0009-batch-execution-and-cross-backend-validation.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/adr/0010-ethernet-frames-on-the-wire.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/benchmarks.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/dashboard.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/dsl-reference.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/examples.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/index.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/language-reference.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/modbus.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/model-semantics.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/mqtt.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/profinet.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/scenario-model.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/simulation-engine.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/examples/README.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/examples/example.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/examples/example.smol +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/examples/example_10_clients.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/examples/example_12_clients.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/examples/example_20_clients.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/examples/example_file_transfer.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/examples/example_modbus.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/examples/example_mqtt.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/examples/example_profinet.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/examples/example_profinet.smol +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/examples/example_staggered_transfer.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/examples/example_two_tier.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/mkdocs.yml +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/pyproject.toml +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/rust/Cargo.lock +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/rust/Cargo.toml +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/rust/smol-engine/Cargo.toml +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/rust/smol-engine/src/frames.rs +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/rust/smol-engine/src/lib.rs +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/rust/smol-engine/src/rng.rs +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/rust/smol-engine/src/scenario.rs +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/rust/smol-engine/src/sim.rs +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/rust/smol-engine/src/timebase.rs +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/rust/smolpy-engine-rs/Cargo.toml +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/rust/smolpy-engine-rs/README.md +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/rust/smolpy-engine-rs/pyproject.toml +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/rust/smolpy-engine-rs/smoke_test.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/rust/smolpy-engine-rs/src/lib.rs +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/__init__.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/_worker.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/backends.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/batch.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/cli.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/core/__init__.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/core/adapter.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/core/batch.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/core/link.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/core/network.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/core/node.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/core/observation.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/ethernet/__init__.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/ethernet/switch.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/lang/__init__.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/lang/ast.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/lang/errors.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/lang/grammar.lark +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/lang/interpreter.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/lang/transformer.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/modbus/__init__.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/modbus/slave.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/model/__init__.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/model/frames.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/model/scenario.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/model/streams.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/model/timebase.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/model/validate.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/mqtt/__init__.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/mqtt/broker.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/profinet/__init__.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/profinet/device.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/sim/__init__.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/sim/engine.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/stats.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/viz/__init__.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/viz/dashboard.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/src/smolpy/viz/text_dashboard.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/__init__.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/equivalence/__init__.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/equivalence/harness.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/equivalence/scenarios.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/equivalence/test_equivalence.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/equivalence/test_rust_timebase.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/test_backends.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/test_batch.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/test_benchmarks.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/test_cli.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/test_dsl.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/test_engine_ir.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/test_lang.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/test_model.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/test_profinet.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/test_semantics.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/test_simulation.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/test_stats.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/test_sweep.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/test_timebase.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/tests/test_validate.py +0 -0
- {smolpy-1.8.2.dev10 → smolpy-1.9.0}/uv.lock +0 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
name: Docker image
|
|
2
|
+
|
|
3
|
+
# The image without ns-3, ghcr.io/jwszolek/smolpy (ADR-0004, Container
|
|
4
|
+
# images): Python, smolpy and smolpy-engine-rs for linux/amd64 and
|
|
5
|
+
# linux/arm64, installed from the wheels of one version. Every image is tested
|
|
6
|
+
# before anything is pushed: the wheel smoke test (bit-exact with SimPy) and a
|
|
7
|
+
# .smol run through the CLI.
|
|
8
|
+
#
|
|
9
|
+
# - Called by publish.yml at a release, once both packages are on PyPI: uses
|
|
10
|
+
# the files of the same run and pushes <version> and latest.
|
|
11
|
+
# - On a pull request that touches the image: builds the wheels here, for
|
|
12
|
+
# linux/amd64 only, tests that image and pushes nothing.
|
|
13
|
+
|
|
14
|
+
on:
|
|
15
|
+
pull_request:
|
|
16
|
+
paths:
|
|
17
|
+
- "docker/**"
|
|
18
|
+
- ".github/workflows/docker-image.yml"
|
|
19
|
+
workflow_call:
|
|
20
|
+
inputs:
|
|
21
|
+
version:
|
|
22
|
+
description: The release version, e.g. 1.9.0
|
|
23
|
+
required: true
|
|
24
|
+
type: string
|
|
25
|
+
ref:
|
|
26
|
+
description: The release tag, e.g. v1.9.0
|
|
27
|
+
required: true
|
|
28
|
+
type: string
|
|
29
|
+
|
|
30
|
+
jobs:
|
|
31
|
+
image:
|
|
32
|
+
name: ${{ inputs.version && format('Image {0}', inputs.version) || 'Image (test build)' }}
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
permissions:
|
|
35
|
+
contents: read
|
|
36
|
+
packages: write # push to ghcr.io
|
|
37
|
+
|
|
38
|
+
env:
|
|
39
|
+
IMAGE: ghcr.io/${{ github.repository_owner }}/smolpy
|
|
40
|
+
RELEASE: ${{ inputs.version && 'true' || 'false' }} # no inputs on a pull request
|
|
41
|
+
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v4
|
|
44
|
+
with:
|
|
45
|
+
ref: ${{ inputs.ref }}
|
|
46
|
+
fetch-depth: 0 # hatch-vcs numbers a test build from git
|
|
47
|
+
|
|
48
|
+
# --- a release: the files the calling run has published ---
|
|
49
|
+
|
|
50
|
+
- name: Download smolpy
|
|
51
|
+
if: ${{ env.RELEASE == 'true' }}
|
|
52
|
+
uses: actions/download-artifact@v4
|
|
53
|
+
with:
|
|
54
|
+
name: dist
|
|
55
|
+
path: dist/
|
|
56
|
+
|
|
57
|
+
- name: Download smolpy-engine-rs
|
|
58
|
+
if: ${{ env.RELEASE == 'true' }}
|
|
59
|
+
uses: actions/download-artifact@v4
|
|
60
|
+
with:
|
|
61
|
+
pattern: engine-*
|
|
62
|
+
merge-multiple: true
|
|
63
|
+
path: dist/
|
|
64
|
+
|
|
65
|
+
# --- a pull request: both wheels built here, with one version ---
|
|
66
|
+
|
|
67
|
+
- name: Install uv
|
|
68
|
+
if: ${{ env.RELEASE != 'true' }}
|
|
69
|
+
uses: astral-sh/setup-uv@v4
|
|
70
|
+
with:
|
|
71
|
+
version: "latest"
|
|
72
|
+
|
|
73
|
+
- name: Build smolpy and number the engine alike
|
|
74
|
+
if: ${{ env.RELEASE != 'true' }}
|
|
75
|
+
run: |
|
|
76
|
+
uv build --wheel
|
|
77
|
+
wheels=(dist/smolpy-*.whl) # smolpy-<version>-py3-none-any.whl
|
|
78
|
+
VERSION=$(basename "${wheels[0]}" | cut -d- -f2)
|
|
79
|
+
CARGO_VERSION=$(echo "$VERSION" | sed -E 's/\.dev([0-9]+)$/-dev.\1/')
|
|
80
|
+
sed -i "s/^dynamic = \[\"version\"\]$/version = \"$VERSION\"/" rust/smolpy-engine-rs/pyproject.toml
|
|
81
|
+
sed -i "s/^version = \"[^\"]*\"$/version = \"$CARGO_VERSION\"/" rust/Cargo.toml
|
|
82
|
+
echo "Test build of version $VERSION"
|
|
83
|
+
|
|
84
|
+
- name: Build smolpy-engine-rs
|
|
85
|
+
if: ${{ env.RELEASE != 'true' }}
|
|
86
|
+
uses: PyO3/maturin-action@v1
|
|
87
|
+
with:
|
|
88
|
+
target: x86_64
|
|
89
|
+
manylinux: auto
|
|
90
|
+
args: --release --out dist -m rust/smolpy-engine-rs/Cargo.toml
|
|
91
|
+
|
|
92
|
+
# --- the image ---
|
|
93
|
+
|
|
94
|
+
- name: Version
|
|
95
|
+
id: v
|
|
96
|
+
env:
|
|
97
|
+
VERSION: ${{ inputs.version }}
|
|
98
|
+
run: |
|
|
99
|
+
if [ -z "$VERSION" ]; then
|
|
100
|
+
wheels=(dist/smolpy-*.whl)
|
|
101
|
+
VERSION=$(basename "${wheels[0]}" | cut -d- -f2)
|
|
102
|
+
fi
|
|
103
|
+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
104
|
+
ls dist/
|
|
105
|
+
|
|
106
|
+
- name: Set up QEMU, for linux/arm64
|
|
107
|
+
if: ${{ env.RELEASE == 'true' }}
|
|
108
|
+
uses: docker/setup-qemu-action@v3
|
|
109
|
+
|
|
110
|
+
- uses: docker/setup-buildx-action@v3
|
|
111
|
+
|
|
112
|
+
- name: Build and test each platform
|
|
113
|
+
env:
|
|
114
|
+
VERSION: ${{ steps.v.outputs.version }}
|
|
115
|
+
PLATFORMS: ${{ env.RELEASE == 'true' && 'linux/amd64 linux/arm64' || 'linux/amd64' }}
|
|
116
|
+
run: |
|
|
117
|
+
for platform in $PLATFORMS; do
|
|
118
|
+
echo "::group::$platform"
|
|
119
|
+
docker buildx build --platform "$platform" --load \
|
|
120
|
+
--build-arg VERSION="$VERSION" -f docker/Dockerfile -t smolpy:test .
|
|
121
|
+
docker run --rm --platform "$platform" smolpy:test --help
|
|
122
|
+
# the wheel smoke test: bit-exact with SimPy on this platform
|
|
123
|
+
docker run --rm --platform "$platform" -v "$PWD/rust/smolpy-engine-rs:/test:ro" \
|
|
124
|
+
--entrypoint python smolpy:test /test/smoke_test.py
|
|
125
|
+
# the CLI, as a user runs it, writing to the mounted directory
|
|
126
|
+
mkdir -p out && chmod 777 out
|
|
127
|
+
cp docker/smoke.smol out/
|
|
128
|
+
docker run --rm --platform "$platform" -v "$PWD/out:/work" \
|
|
129
|
+
smolpy:test run smoke.smol --backend rust -o results.csv
|
|
130
|
+
grep -q "pn_latency:plc" out/results.csv
|
|
131
|
+
rm -rf out
|
|
132
|
+
echo "::endgroup::"
|
|
133
|
+
done
|
|
134
|
+
|
|
135
|
+
- name: Log in to ghcr.io
|
|
136
|
+
if: ${{ env.RELEASE == 'true' }}
|
|
137
|
+
uses: docker/login-action@v3
|
|
138
|
+
with:
|
|
139
|
+
registry: ghcr.io
|
|
140
|
+
username: ${{ github.actor }}
|
|
141
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
142
|
+
|
|
143
|
+
# the platforms tested above, rebuilt from the build cache
|
|
144
|
+
- name: Push
|
|
145
|
+
if: ${{ env.RELEASE == 'true' }}
|
|
146
|
+
env:
|
|
147
|
+
VERSION: ${{ steps.v.outputs.version }}
|
|
148
|
+
run: |
|
|
149
|
+
docker buildx build --platform linux/amd64,linux/arm64 --push \
|
|
150
|
+
--build-arg VERSION="$VERSION" -f docker/Dockerfile \
|
|
151
|
+
-t "$IMAGE:$VERSION" -t "$IMAGE:latest" .
|
|
152
|
+
echo "Pushed $IMAGE:$VERSION and $IMAGE:latest" >> "$GITHUB_STEP_SUMMARY"
|
|
@@ -4,7 +4,8 @@ name: Publish to PyPI
|
|
|
4
4
|
#
|
|
5
5
|
# - Release (a pushed tag v*, or release.yml passing its tag): publishes
|
|
6
6
|
# smolpy and the smolpy-engine-rs wheels and sdist to PyPI with the tag's
|
|
7
|
-
# version, then the GitHub Release with every file
|
|
7
|
+
# version, then the GitHub Release with every file and the Docker image
|
|
8
|
+
# ghcr.io/jwszolek/smolpy:<version> (docker-image.yml).
|
|
8
9
|
# - Development build (dev-build.yml, dev: true, after a merge to main):
|
|
9
10
|
# publishes both to PyPI as X.Y.(Z+1).devN, N commits after the latest tag,
|
|
10
11
|
# a pre-release that pip installs only with --pre, and replaces the GitHub
|
|
@@ -192,6 +193,19 @@ jobs:
|
|
|
192
193
|
tag: ${{ needs.version.outputs.tag }}
|
|
193
194
|
engine: ${{ needs.publish-engine.result == 'success' }}
|
|
194
195
|
|
|
196
|
+
image:
|
|
197
|
+
name: Docker image
|
|
198
|
+
needs: [version, publish, publish-engine]
|
|
199
|
+
# from the files just published, so only once both packages are on PyPI
|
|
200
|
+
if: ${{ needs.version.outputs.mode == 'release' }}
|
|
201
|
+
permissions:
|
|
202
|
+
contents: read
|
|
203
|
+
packages: write # push to ghcr.io
|
|
204
|
+
uses: ./.github/workflows/docker-image.yml
|
|
205
|
+
with:
|
|
206
|
+
version: ${{ needs.version.outputs.version }}
|
|
207
|
+
ref: ${{ needs.version.outputs.tag }}
|
|
208
|
+
|
|
195
209
|
dev-release:
|
|
196
210
|
name: GitHub pre-release "Development build"
|
|
197
211
|
needs: [version, publish, publish-engine]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: smolpy
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.9.0
|
|
4
4
|
Summary: Network simulation DSL and discrete-event simulator
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -89,6 +89,16 @@ pip install --pre "smolpy[rust]" # the latest development build of main
|
|
|
89
89
|
- **Where it is on GitHub.** The [Development build](https://github.com/jwszolek/SMOLPy/releases/tag/dev) pre-release points to its commit.
|
|
90
90
|
- **Releases proper** are made by hand.
|
|
91
91
|
|
|
92
|
+
**Without Python,** from the Docker image of each release, which has SMOLPy and the Rust engine for `linux/amd64` and `linux/arm64`:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
docker run --rm -v "$PWD:/work" ghcr.io/jwszolek/smolpy run plant.smol --backend rust -o results.csv
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
- The image runs headless: the live dashboard needs a display, so a `.smol` file needs `mode=headless` or `mode=text`.
|
|
99
|
+
- It runs as uid 1000. To own the files it writes as yourself, add `--user "$(id -u):$(id -g)"`.
|
|
100
|
+
- A version is pinned as `ghcr.io/jwszolek/smolpy:<version>`; `latest` is the latest release.
|
|
101
|
+
|
|
92
102
|
From a clone, for development:
|
|
93
103
|
|
|
94
104
|
```bash
|
|
@@ -61,6 +61,16 @@ pip install --pre "smolpy[rust]" # the latest development build of main
|
|
|
61
61
|
- **Where it is on GitHub.** The [Development build](https://github.com/jwszolek/SMOLPy/releases/tag/dev) pre-release points to its commit.
|
|
62
62
|
- **Releases proper** are made by hand.
|
|
63
63
|
|
|
64
|
+
**Without Python,** from the Docker image of each release, which has SMOLPy and the Rust engine for `linux/amd64` and `linux/arm64`:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
docker run --rm -v "$PWD:/work" ghcr.io/jwszolek/smolpy run plant.smol --backend rust -o results.csv
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- The image runs headless: the live dashboard needs a display, so a `.smol` file needs `mode=headless` or `mode=text`.
|
|
71
|
+
- It runs as uid 1000. To own the files it writes as yourself, add `--user "$(id -u):$(id -g)"`.
|
|
72
|
+
- A version is pinned as `ghcr.io/jwszolek/smolpy:<version>`; `latest` is the latest release.
|
|
73
|
+
|
|
64
74
|
From a clone, for development:
|
|
65
75
|
|
|
66
76
|
```bash
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# SMOLPy with the Rust engine, without ns-3: ghcr.io/jwszolek/smolpy
|
|
2
|
+
# (ADR-0004, Container images). Built by .github/workflows/docker-image.yml.
|
|
3
|
+
#
|
|
4
|
+
# The build context holds only dist/, with the wheels of one version of
|
|
5
|
+
# smolpy and smolpy-engine-rs: a release's own files, or a pull request's.
|
|
6
|
+
# pip picks the engine wheel of the platform being built.
|
|
7
|
+
#
|
|
8
|
+
# docker run --rm -v "$PWD:/work" ghcr.io/jwszolek/smolpy run plant.smol --backend rust
|
|
9
|
+
|
|
10
|
+
FROM python:3.12-slim-bookworm
|
|
11
|
+
|
|
12
|
+
ARG VERSION
|
|
13
|
+
|
|
14
|
+
LABEL org.opencontainers.image.title="SMOLPy" \
|
|
15
|
+
org.opencontainers.image.description="Network simulation DSL and discrete-event simulator, with the Rust engine (without ns-3)" \
|
|
16
|
+
org.opencontainers.image.source="https://github.com/jwszolek/SMOLPy" \
|
|
17
|
+
org.opencontainers.image.documentation="https://jwszolek.github.io/SMOLPy/" \
|
|
18
|
+
org.opencontainers.image.licenses="MIT" \
|
|
19
|
+
org.opencontainers.image.version="${VERSION}"
|
|
20
|
+
|
|
21
|
+
# both packages pinned to the version, so pip takes them from dist/; their
|
|
22
|
+
# dependencies come from PyPI
|
|
23
|
+
RUN --mount=type=bind,source=dist,target=/dist \
|
|
24
|
+
test -n "${VERSION}" \
|
|
25
|
+
&& pip install --no-cache-dir --find-links /dist \
|
|
26
|
+
"smolpy[rust]==${VERSION}" "smolpy-engine-rs==${VERSION}" \
|
|
27
|
+
&& python -c "import smolpy_engine_rs; assert smolpy_engine_rs.__version__ == '${VERSION}'"
|
|
28
|
+
|
|
29
|
+
# not root: files written to the mounted directory belong to uid 1000, or to
|
|
30
|
+
# whoever `docker run --user` names
|
|
31
|
+
RUN useradd --create-home --uid 1000 smolpy
|
|
32
|
+
USER 1000
|
|
33
|
+
WORKDIR /work
|
|
34
|
+
|
|
35
|
+
ENTRYPOINT ["smolpy"]
|
|
36
|
+
CMD ["--help"]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Run by CI in every image it builds: the CLI, a .smol file and the Rust
|
|
2
|
+
# engine, with every protocol, writing its results to the mounted directory.
|
|
3
|
+
|
|
4
|
+
network "image-smoke" {
|
|
5
|
+
|
|
6
|
+
switch sw ports=6
|
|
7
|
+
adapter plc ip=10.0.0.1
|
|
8
|
+
adapter hmi ip=10.0.0.2
|
|
9
|
+
mqtt_broker broker ip=10.0.0.3
|
|
10
|
+
modbus_slave meter ip=10.0.0.4 unit_id=1
|
|
11
|
+
profinet_device io ip=10.0.0.5
|
|
12
|
+
|
|
13
|
+
link plc -- sw speed=100 length=10
|
|
14
|
+
link hmi -- sw speed=100 length=10
|
|
15
|
+
link broker -- sw speed=100 length=10
|
|
16
|
+
link meter -- sw speed=100 length=10
|
|
17
|
+
link io -- sw speed=100 length=10
|
|
18
|
+
|
|
19
|
+
flow plc -> hmi rate=2000 size=512
|
|
20
|
+
poll plc -> meter register=0 count=10 rate=100
|
|
21
|
+
route broker topic="plant/t" -> [hmi]
|
|
22
|
+
publish plc -> broker topic="plant/t" rate=100 qos=1
|
|
23
|
+
control plc -> io cycle=2 inputs=20 outputs=20
|
|
24
|
+
|
|
25
|
+
observe throughput on hmi every=10
|
|
26
|
+
observe modbus_latency on plc every=10
|
|
27
|
+
observe pn_latency on plc every=10
|
|
28
|
+
|
|
29
|
+
simulate duration=100 mode=headless
|
|
30
|
+
}
|
|
@@ -174,6 +174,8 @@ The ns-3 suite is skipped automatically when ns-3 is not available, and runs in
|
|
|
174
174
|
|
|
175
175
|
ns-3 is the one backend that cannot be installed with `pip`. It is a C++ code base that must be built from source with its own toolchain, which takes tens of minutes, and SMOLPy supports exactly one pinned release. The ns-3 backend is therefore shipped, run in CI and archived as a **container image**. A lighter image without ns-3 serves users who want SMOLPy without installing Python.
|
|
176
176
|
|
|
177
|
+
*As built (2026-11-16):* the image without ns-3 is `docker/Dockerfile`, built by `.github/workflows/docker-image.yml`. Each release, `publish.yml` calls it once both packages are on PyPI. It tests the image of each platform with the wheel smoke test and a `.smol` run through the CLI before it pushes `<version>` and `latest`. A pull request that changes the image builds and tests it for `linux/amd64` and pushes nothing. The image runs as uid 1000, not as root.
|
|
178
|
+
|
|
177
179
|
**Registry and images.** The images are published to the GitHub Container Registry, `ghcr.io/jwszolek/smolpy`, public, for `linux/amd64` and `linux/arm64`:
|
|
178
180
|
|
|
179
181
|
| Tag | Contents | Size | From |
|
|
@@ -172,6 +172,11 @@ 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:** step 1 of 3 done.
|
|
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.** It holds the pinned ns-3 release, built once.
|
|
178
|
+
3. **The ns-3 backend.** It generates the scenario, adds the SMOL C++ module and runs the equivalence suite in CI.
|
|
179
|
+
|
|
175
180
|
**Exit criteria:**
|
|
176
181
|
|
|
177
182
|
- Low-load scenarios agree with SimPy and Rust.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{smolpy-1.8.2.dev10 → smolpy-1.9.0}/docs/adr/0009-batch-execution-and-cross-backend-validation.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|