While storing diagrams as .py files and their rendered .png representations in version control and using CI workflow to check that the png version is up to date, I noticed some diagrams don't produce the same png image on consecutive renderings.
To reproduce, example.py:
#!/usr/bin/env python
from diagrams import Cluster, Diagram
from diagrams.aws.compute import ECS
from diagrams.aws.database import RDS, ElastiCache
from diagrams.aws.network import ELB, Route53
with Diagram("Example", show=False):
dns = Route53("dns")
lb = ELB("lb")
with Cluster("Services"):
svc_group = [ECS("web1"), ECS("web2"), ECS("web3")]
with Cluster("DB Cluster"):
db_primary = RDS("userdb")
db_primary - [RDS("userdb ro")]
memcached = ElastiCache("memcached")
dns >> lb >> svc_group
svc_group >> db_primary
svc_group >> memcached
If I now render this via
docker run --rm -i -v "$(pwd):/mnt" continuumio/miniconda3 /bin/bash -ic "set -eu; conda create --name testenv -c conda-forge diagrams==0.23.3 --yes; cd /mnt/; conda run --name testenv ./example.py" (linux via Docker)
then the results are 1. different on macOS compared to Linux in Docker... and 2. also change if I redo the macOS/Linux rendering after some time and compare to the previous rendering.
Why is that? Is 1. due to some dependencies different on macOS vs Linux and 2. due to some transitive dependencies changing over time?
How can I make the rendering 100% bit-identical reproducible on different operating systems and also stable over time? What transitive dependencies require version pinnings?
Here one diff as example to what changes between renderings:
While storing diagrams as .py files and their rendered .png representations in version control and using CI workflow to check that the png version is up to date, I noticed some diagrams don't produce the same png image on consecutive renderings.
To reproduce, example.py:
If I now render this via
docker run --rm -i -v "$(pwd):/mnt" continuumio/miniconda3 /bin/bash -ic "set -eu; conda create --name testenv -c conda-forge diagrams==0.23.3 --yes; cd /mnt/; conda run --name testenv ./example.py"
(linux via Docker)conda create --name testenv -c conda-forge diagrams==0.23.3 --yes; conda run --name testenv ./example.py
(macOS)then the results are 1. different on macOS compared to Linux in Docker... and 2. also change if I redo the macOS/Linux rendering after some time and compare to the previous rendering.
Why is that? Is 1. due to some dependencies different on macOS vs Linux and 2. due to some transitive dependencies changing over time?
How can I make the rendering 100% bit-identical reproducible on different operating systems and also stable over time? What transitive dependencies require version pinnings?
Here one diff as example to what changes between renderings:
Thanks!