Skip to content

Create BINARY.md5 files for each binary created by spack#340

Open
CodeGat wants to merge 12 commits intov8from
336-md5-hash-for-bins
Open

Create BINARY.md5 files for each binary created by spack#340
CodeGat wants to merge 12 commits intov8from
336-md5-hash-for-bins

Conversation

@CodeGat
Copy link
Member

@CodeGat CodeGat commented Jan 9, 2026

Closes #336
References https://github.com/ACCESS-NRI/tracking-services/issues/84

Background

We need md5 hashes for all binaries created by spack for provenance purposes.

The PR

  • Create BINARY.md5 files for each executable BINARY file created by spack in the given environment
  • Also add this to a md5s list in the build-db-pkgs.json containing both a path to the binary and the md5 hash
  • Move the entire convoluted bash step into a nice python script

Testing

Tested in ghcr.io/access-nri/build-ci-upstream:rocky-v1.1-2025.12.001 image. Setup via:

. /opt/spack/share/spack/setup-env.sh
spack env activate --create e
spack install --add access-om2%access_intel
# After copying over the script to opt/get_data_from_deployment.py ...
chmod +x /opt/get_data_from_deployment.py

Basic Test

Using ./opt/get_data_from_deployment.py --environment /opt/environments/e --deployment-name access-om2 --packages mom5,cice5,oasis3-mct,libaccessom2 --output /opt/environments/e/, we get the following valid structure:

[
  {
    "name": "mom5",
    "version": "access-om2",
    "hash": "gxlviefvkxaevtoycgopnpoizjrwenk6",
    "location": "/opt/upstream/linux-x86_64_v3/mom5-access-om2-gxlviefvkxaevtoycgopnpoizjrwenk6",
    "url": "https://github.com/ACCESS-NRI/mom5.git",
    "md5s": [
      {
        "path": "/opt/upstream/linux-x86_64_v3/mom5-access-om2-gxlviefvkxaevtoycgopnpoizjrwenk6/bin/mom5_access_om",
        "md5": "f15ed6261ad84b8daa374004e44fabc8"
      }
    ]
  },
  {
    "name": "cice5",
    "version": "stable",
    "hash": "xa4tjrqubmohoky2vodrniqyq7cbvptd",
    "location": "/opt/upstream/linux-x86_64_v3/cice5-stable-xa4tjrqubmohoky2vodrniqyq7cbvptd",
    "url": "https://github.com/ACCESS-NRI/cice5.git",
    "md5s": [
      {
        "path": "/opt/upstream/linux-x86_64_v3/cice5-stable-xa4tjrqubmohoky2vodrniqyq7cbvptd/bin/cice_auscom_360x300_24x1_24p.exe",
        "md5": "d062bd84e414dfe616ea56924f913f45"
      },
      {
        "path": "/opt/upstream/linux-x86_64_v3/cice5-stable-xa4tjrqubmohoky2vodrniqyq7cbvptd/bin/cice_auscom_1440x1080_48x40_480p.exe",
        "md5": "d12aa29f0d6e84aae55fad36c7b4df2e"
      },
      {
        "path": "/opt/upstream/linux-x86_64_v3/cice5-stable-xa4tjrqubmohoky2vodrniqyq7cbvptd/bin/cice_auscom_3600x2700_90x90_722p.exe",
        "md5": "115c4f5b961ae96048d4aaa0a2760234"
      },
      {
        "path": "/opt/upstream/linux-x86_64_v3/cice5-stable-xa4tjrqubmohoky2vodrniqyq7cbvptd/bin/cice_auscom_3600x2700_200x180_1682p.exe",
        "md5": "f82334f1383c2b83c973ed736d23300c"
      }
    ]
  },
  {
    "name": "oasis3-mct",
    "version": "stable",
    "hash": "2h5cfux34noxfpvnn7ch6seurhvkwn4s",
    "location": "/opt/upstream/linux-x86_64_v3/oasis3-mct-stable-2h5cfux34noxfpvnn7ch6seurhvkwn4s",
    "url": "https://github.com/ACCESS-NRI/oasis3-mct.git",
    "md5s": []
  },
  {
    "name": "libaccessom2",
    "version": "access-om2",
    "hash": "af55aojgyzmw7mmvpivvcbflvnse7nfd",
    "location": "/opt/upstream/linux-x86_64_v3/libaccessom2-access-om2-af55aojgyzmw7mmvpivvcbflvnse7nfd",
    "url": "https://github.com/ACCESS-NRI/libaccessom2.git",
    "md5s": [
      {
        "path": "/opt/upstream/linux-x86_64_v3/libaccessom2-access-om2-af55aojgyzmw7mmvpivvcbflvnse7nfd/bin/yatm.exe",
        "md5": "02466d954f25ad0603828c6cdfc3414d"
      },
      {
        "path": "/opt/upstream/linux-x86_64_v3/libaccessom2-access-om2-af55aojgyzmw7mmvpivvcbflvnse7nfd/bin/ice_stub.exe",
        "md5": "734e43db8dbce2545f861ac5a1173922"
      },
      {
        "path": "/opt/upstream/linux-x86_64_v3/libaccessom2-access-om2-af55aojgyzmw7mmvpivvcbflvnse7nfd/bin/ocean_stub.exe",
        "md5": "47d8e49b77e980403755715f47dc61df"
      }
    ]
  }
]

Minus the new md5s property, this is identical in structure to the original:

Original Structure of the file
[
  {
    "name": "mom5",
    "version": "git.2025.08.000=access-om2",
    "hash": "tu35goxkxunzvq2t2nqtlyatcxnghswl",
    "location": "/g/data/vk83/prerelease/apps/spack/0.22/release/linux-rocky8-x86_64_v4/oneapi-2025.2.0/mom5-git.2025.08.000_access-om2-tu35goxkxunzvq2t2nqtlyatcxnghswl",
    "url": "https://github.com/ACCESS-NRI/mom5.git"
  },
  {
    "name": "cice5",
    "version": "2026.01.000",
    "hash": "heh64yb27rg7tbd4j7nt2pgxcri7iimx",
    "location": "/g/data/vk83/prerelease/apps/spack/0.22/release/linux-rocky8-x86_64_v4/oneapi-2025.2.0/cice5-2026.01.000-heh64yb27rg7tbd4j7nt2pgxcri7iimx",
    "url": "https://github.com/ACCESS-NRI/cice5.git"
  },
  {
    "name": "oasis3-mct",
    "version": "git.2025.03.001=2025.03.001",
    "hash": "6cnslupvzbaf3ke3vpyrdcogwnp4jbjg",
    "location": "/g/data/vk83/prerelease/apps/spack/0.22/release/linux-rocky8-x86_64_v4/oneapi-2025.2.0/oasis3-mct-git.2025.03.001_2025.03.001-6cnslupvzbaf3ke3vpyrdcogwnp4jbjg",
    "url": "https://github.com/ACCESS-NRI/oasis3-mct.git"
  },
  {
    "name": "libaccessom2",
    "version": "git.2025.05.001=access-om2",
    "hash": "uyobp5g7wtkyw5qai2ojkyo24nf63tev",
    "location": "/g/data/vk83/prerelease/apps/spack/0.22/release/linux-rocky8-x86_64_v4/oneapi-2025.2.0/libaccessom2-git.2025.05.001_access-om2-uyobp5g7wtkyw5qai2ojkyo24nf63tev",
    "url": "https://github.com/ACCESS-NRI/libaccessom2.git"
  }
]

@CodeGat CodeGat added type:enhancement Improvements to existing features priority:medium version:MINOR Doesn't require update to Model Deployment Repositories for:v8 Applies to v8 labels Jan 9, 2026
@CodeGat CodeGat self-assigned this Jan 9, 2026
@CodeGat CodeGat changed the base branch from v7 to v8 January 9, 2026 01:25
@CodeGat CodeGat force-pushed the 336-md5-hash-for-bins branch 2 times, most recently from ae1d3ef to 9f4869b Compare January 18, 2026 22:25
@CodeGat CodeGat force-pushed the 336-md5-hash-for-bins branch from 2be49a4 to 7ca8a2f Compare February 6, 2026 04:42
@CodeGat CodeGat marked this pull request as ready for review February 6, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

for:v8 Applies to v8 priority:medium type:enhancement Improvements to existing features version:MINOR Doesn't require update to Model Deployment Repositories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add MD5 hash information for executables

1 participant