Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions containers/power_electronics_v1.NOTICES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# PowerElectronics v1 runtime notices

The PowerElectronics v1 SIF is a multi-license software aggregate. The
EngiBench repository license and the dataset license do not replace the
licenses of software installed in the image.

The image contains Debian 12 (bookworm) packages, Python packages installed
from PyPI, and ngspice 44.2. Copyright and license notices supplied by Debian
packages are available inside the image under
`/usr/share/doc/<package>/copyright`. Python package metadata and license files
are retained in their installed `.dist-info` directories. The accompanying
SPDX SBOM is an inventory aid; the installed notices remain authoritative.
The publication bundle preserves those notices and records the exact Debian
binary and source package versions in `debian-source-packages.tsv`. Debian
source packages remain available from
[`sources.debian.org`](https://sources.debian.org/) and
[`snapshot.debian.org`](https://snapshot.debian.org/).

The ngspice 44.2 `COPYING` file describes the main license as Modified BSD and
lists exceptions under LGPL, MPL, GPL, MIT-compatible, and public-domain
terms. The exact unmodified ngspice 44.2 source archive, including that
complete `COPYING` file, is distributed with the runtime publication bundle as
`ngspice-44.2.tar.gz`:

```text
e7dadfb7bd5474fd22409c1e5a67acdec19f77e597df68e17c5549bc1390d7fd ngspice-44.2.tar.gz
```

The SIF was used as a simulation runtime. EngiBench source code and the
generated PowerElectronics datasets are not copied into it; EngiBench was
mounted into the container when the dataset was generated.

The SIF is provided without warranty. Recipients remain responsible for
reviewing the license terms of the components they use or redistribute.
37 changes: 37 additions & 0 deletions containers/power_electronics_v1.PUBLICATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# PowerElectronics v1 runtime publication

The canonical Linux x86_64 runtime is published as a SIF artifact in GitHub
Container Registry:

```text
ghcr.io/ideallab/engibench-power-electronics-v1:v1.0.0
```

For an immutable pull, use its OCI manifest digest:

```bash
apptainer pull power-electronics-v1.sif \
oras://ghcr.io/ideallab/engibench-power-electronics-v1@sha256:3377ea0e2315e9e83a1f042df1a9f9852bf7098a404ed0adc85c8b01c9a3ca85
```

Verify the downloaded SIF itself before use:

```bash
echo "40816f203b7e1c68ae37f4d9353bd302486d77988b98733c021f1ff71f48ae02 power-electronics-v1.sif" \
| sha256sum --check
```

The OCI manifest digest identifies the registry manifest; the SIF SHA-256
identifies the exact file used to generate the dataset. The `v1.0.0` tag is a
convenience reference, while the digest-pinned form is the reproducible input.

The registry artifact has two OCI referrers: an SPDX SBOM and a provenance
bundle containing the definition file, checksums, package manifests, installed
license metadata, and the exact ngspice 44.2 source archive. See
[`power_electronics_v1.NOTICES.md`](power_electronics_v1.NOTICES.md) for the
mixed-license disclosure.

The corresponding dataset is
[`IDEALLab/power_electronics_v1`](https://huggingface.co/datasets/IDEALLab/power_electronics_v1)
at tag `v1.0.0` and commit
`eefad7d727ea1e5bef5e1b7088dea20a9b0cd67f`.
70 changes: 70 additions & 0 deletions containers/power_electronics_v1.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Bootstrap: docker
From: debian@sha256:f3034a6ec3c1205360777c4aae76234998866ad18806ae62b63a3f84ccad782b

%labels
org.opencontainers.image.title "EngiBench PowerElectronics v1 dataset backend"
org.opencontainers.image.base.digest "sha256:f3034a6ec3c1205360777c4aae76234998866ad18806ae62b63a3f84ccad782b"
org.opencontainers.image.ngspice.version "44.2"
org.opencontainers.image.ngspice.source.sha256 "e7dadfb7bd5474fd22409c1e5a67acdec19f77e597df68e17c5549bc1390d7fd"

%post
set -eu
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends \
bison \
build-essential \
ca-certificates \
curl \
flex \
git \
libtool \
python3 \
python3-venv

work_dir="$(mktemp -d)"
archive="$work_dir/ngspice-44.2.tar.gz"
curl --fail --location --retry 3 \
--output "$archive" \
"https://sourceforge.net/projects/ngspice/files/ng-spice-rework/old-releases/44.2/ngspice-44.2.tar.gz/download"
echo "e7dadfb7bd5474fd22409c1e5a67acdec19f77e597df68e17c5549bc1390d7fd $archive" | sha256sum --check
tar -xzf "$archive" -C "$work_dir"
cd "$work_dir/ngspice-44.2"
./configure \
--prefix=/opt/ngspice-44.2 \
--enable-relpath \
--without-x \
--with-readline=no \
--with-fftw3=no \
--disable-openmp
make -j2
make install
cd /
rm -rf "$work_dir"

python3 -m venv /opt/power-electronics-v1
/opt/power-electronics-v1/bin/pip install --no-cache-dir \
datasets==5.0.1 \
gymnasium==1.3.0 \
matplotlib==3.11.2 \
networkx==3.6.1 \
numpy==2.4.6 \
pandas==3.0.6 \
pyarrow==25.0.1
/opt/power-electronics-v1/bin/pip freeze | sort > /opt/power-electronics-v1-requirements.txt

apt-get clean
rm -rf /var/lib/apt/lists/*

%environment
export PATH=/opt/power-electronics-v1/bin:/opt/ngspice-44.2/bin:$PATH
export NGSPICE_PATH=/opt/ngspice-44.2/bin/ngspice
export PYTHONNOUSERSITE=1
export MPLBACKEND=Agg

%test
set -eu
test "$(uname -m)" = "x86_64"
/opt/ngspice-44.2/bin/ngspice --version 2>&1 | grep -q "ngspice-44.2"
/opt/power-electronics-v1/bin/python -c \
"import datasets, gymnasium, matplotlib, networkx, numpy, pandas, pyarrow"
Loading
Loading