Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fre-nctools package #188

Merged
merged 6 commits into from
Feb 6, 2025
Merged

Add fre-nctools package #188

merged 6 commits into from
Feb 6, 2025

Conversation

dougiesquire
Copy link
Contributor

This PR adds a package for FRE-NCtools. The initial implementation is taken and updated from COSIMA/spack_packages.

Closes #143

@dougiesquire dougiesquire marked this pull request as draft February 4, 2025 11:23
@harshula harshula self-requested a review February 4, 2025 23:09
@harshula harshula removed their assignment Feb 4, 2025
@dougiesquire dougiesquire marked this pull request as ready for review February 4, 2025 23:10
@dougiesquire
Copy link
Contributor Author

dougiesquire commented Feb 4, 2025

I've tested building all versions on Gadi. Note, a number of releases are broken (see my comments in the package). I've only included versions that aren't broken. Alternatively, we could easily patch the broken versions, but that doesn't seem worth it to me... Lemme know

@dougiesquire
Copy link
Contributor Author

dougiesquire commented Feb 4, 2025

Also, lol at the issue assignment chaos

@aidanheerdegen
Copy link
Member

Also, lol at the issue assignment chaos

Don't let an old man near a computer.

packages/fre-nctools/package.py Outdated Show resolved Hide resolved
packages/fre-nctools/package.py Show resolved Hide resolved
@anton-seaice
Copy link
Contributor

I'll defer to @harshula to approve unless im needed :-)

@harshula
Copy link
Collaborator

harshula commented Feb 6, 2025

Hi @dougiesquire ,

Slight complication:

[root@de168857d600 packages]# spack install fre-nctools %[email protected] target=x86_64
...
==> Installing fre-nctools-2024.05-2v2mri5qpx4pgmvjgj4y5tdy5xysp7kg [52/52]
==> No binary for fre-nctools-2024.05-2v2mri5qpx4pgmvjgj4y5tdy5xysp7kg found: installing from source
==> Fetching https://github.com/NOAA-GFDL/FRE-NCtools/tarball/2024.05
==> Error: ChecksumError: sha256 checksum failed for /tmp/root/spack-stage/spack-stage-fre-nctools-2024.05-2v2mri5qpx4pgmvjgj4y5tdy5xysp7kg/2024.05
    Expected 61cec52aa03e066b64bed794ef9dc3eb28654c3d1b872aef1b69ce99ef7a9c65 but got 94f15eb1561951c537ffe93677e29b8975a9b0d8f7335e0dea3dbf95c9b5203b. File size = 190825505 bytes. Contents = b'\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03\xec<kw\xdb6...~\xd6\xcf\xfa\xe1\xcf\xff\x07\x01\x8c\x06\xcc\x00\x88\x82,'

[root@de168857d600 packages]# spack install [email protected] %[email protected] target=x86_64
...
==> Installing fre-nctools-2024.05-2v2mri5qpx4pgmvjgj4y5tdy5xysp7kg [46/46]
==> No binary for fre-nctools-2024.05-2v2mri5qpx4pgmvjgj4y5tdy5xysp7kg found: installing from source
==> Fetching https://github.com/NOAA-GFDL/FRE-NCtools/tarball/2024.05
==> Error: ChecksumError: sha256 checksum failed for /tmp/root/spack-stage/spack-stage-fre-nctools-2024.05-2v2mri5qpx4pgmvjgj4y5tdy5xysp7kg/2024.05
    Expected 61cec52aa03e066b64bed794ef9dc3eb28654c3d1b872aef1b69ce99ef7a9c65 but got 94f15eb1561951c537ffe93677e29b8975a9b0d8f7335e0dea3dbf95c9b5203b. File size = 190825505 bytes. Contents = b'\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03\xec<kw\xdb6...~\xd6\xcf\xfa\xe1\xcf\xff\x07\x01\x8c\x06\xcc\x00\x88\x82,'

[root@de168857d600 packages]# spack install [email protected] %[email protected] target=x86_64
...
==> Installing fre-nctools-2024.04-7k5eni4m24uney43fxhiqmszq4lwfkoh [39/39]
==> No binary for fre-nctools-2024.04-7k5eni4m24uney43fxhiqmszq4lwfkoh found: installing from source
==> Fetching https://github.com/NOAA-GFDL/FRE-NCtools/tarball/2024.04
==> Error: ChecksumError: sha256 checksum failed for /tmp/root/spack-stage/spack-stage-fre-nctools-2024.04-7k5eni4m24uney43fxhiqmszq4lwfkoh/2024.04
    Expected e27346d7ade1b67af163bb7f327a47a288d5e475fe797323bd7cee3a46385de0 but got c2db3aee5d4a30b18010997a4b953ed04e3b8981b39471652d39d6ae37042c47. File size = 321029281 bytes. Contents = b'\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03\xec\\\xffw\xdb\xb8...\x0f\xbf\x87\xdf\xf2\xbf\xff\x1fX\xb4\xc3\x95\x00\x18\xd28'
$ wget https://github.com/NOAA-GFDL/FRE-NCtools/tarball/2024.04
--2025-02-06 13:29:04--  https://github.com/NOAA-GFDL/FRE-NCtools/tarball/2024.04
Resolving github.com (github.com)... 4.237.22.38
Connecting to github.com (github.com)|4.237.22.38|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/NOAA-GFDL/FRE-NCtools/legacy.tar.gz/refs/tags/2024.04 [following]
--2025-02-06 13:29:05--  https://codeload.github.com/NOAA-GFDL/FRE-NCtools/legacy.tar.gz/refs/tags/2024.04
Resolving codeload.github.com (codeload.github.com)... 4.237.22.35
Connecting to codeload.github.com (codeload.github.com)|4.237.22.35|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘2024.04’

$ wget https://github.com/NOAA-GFDL/FRE-NCtools/archive/2024.04.tar.gz
--2025-02-06 13:36:11--  https://github.com/NOAA-GFDL/FRE-NCtools/archive/2024.04.tar.gz
Resolving github.com (github.com)... 4.237.22.38
Connecting to github.com (github.com)|4.237.22.38|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/NOAA-GFDL/FRE-NCtools/tar.gz/refs/tags/2024.04 [following]
--2025-02-06 13:36:12--  https://codeload.github.com/NOAA-GFDL/FRE-NCtools/tar.gz/refs/tags/2024.04
Resolving codeload.github.com (codeload.github.com)... 4.237.22.35
Connecting to codeload.github.com (codeload.github.com)|4.237.22.35|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘2024.04.tar.gz’

$ ls -l 2024.04*
-rw-rw-r-- 1 [...] [...] 321029281 Feb  6 13:29 2024.04
-rw-rw-r-- 1 [...] [...] 321031930 Feb  6 13:36 2024.04.tar.gz

$ sha256sum 2024.04*
c2db3aee5d4a30b18010997a4b953ed04e3b8981b39471652d39d6ae37042c47  2024.04
e27346d7ade1b67af163bb7f327a47a288d5e475fe797323bd7cee3a46385de0  2024.04.tar.gz

It appears that the URL format we have adopted in our SPRs result in the downloaded tarball not matching the released tarball. Looking at the Spack Packaging document (https://spack.readthedocs.io/en/latest/packaging_guide.html#writing-a-package-recipe) they seem to use url_fmt = "https://github.com/uclouvain/openjpeg/archive/version.{0}.tar.gz" whereas we have used https://github.com/ISSMteam/ISSM/tarball/v{0}. For this SPR, please use the URL format that is used in the Spack Packaging Document. Hopefully, that will result in checksums matching with the released tarball checksums.

@harshula
Copy link
Collaborator

harshula commented Feb 6, 2025

i.e. https://github.com/NOAA-GFDL/FRE-NCtools/archive/{0}.tar.gz

@dougiesquire
Copy link
Contributor Author

@harshula, weird... Both formats seem to work for me? I've just updated the format. Does it work for you now?

@harshula
Copy link
Collaborator

harshula commented Feb 6, 2025

Works for me now:

[root@de168857d600 packages]# git show
commit 6fa22d3d83f6ecb3fad5d6a61d984cf2320ab77d (HEAD -> 143-add-frenctools, origin/143-add-frenctools)
Author: dougiesquire <[email protected]>
Date:   Thu Feb 6 15:05:29 2025 +1100

    fre-nctools: change url format for tarballs

diff --git a/packages/fre-nctools/package.py b/packages/fre-nctools/package.py
index 415a65e..43d640f 100644
--- a/packages/fre-nctools/package.py
+++ b/packages/fre-nctools/package.py
@@ -47,7 +47,7 @@ class FreNctools(AutotoolsPackage):
     depends_on("nco", when="@2024.05:")
 
     def url_for_version(self, version):
-        return "https://github.com/NOAA-GFDL/FRE-NCtools/tarball/{0}".format(version)
+        return "https://github.com/NOAA-GFDL/FRE-NCtools/archive/{0}.tar.gz".format(version)
 
     def configure_args(self):
         spec = self.spec
[root@de168857d600 packages]# spack install [email protected] %[email protected] target=x86_64
...
==> Installing fre-nctools-2024.04-qjsaep5rk3zdxr2wt2ntxp7e4jpobtrh [39/39]
==> No binary for fre-nctools-2024.04-qjsaep5rk3zdxr2wt2ntxp7e4jpobtrh found: installing from source
==> Fetching https://github.com/NOAA-GFDL/FRE-NCtools/archive/2024.04.tar.gz
==> No patches needed for fre-nctools
==> fre-nctools: Executing phase: 'autoreconf'
==> fre-nctools: Executing phase: 'configure'
==> fre-nctools: Executing phase: 'build'
==> fre-nctools: Executing phase: 'install'
==> fre-nctools: Successfully installed fre-nctools-2024.04-qjsaep5rk3zdxr2wt2ntxp7e4jpobtrh
  Stage: 47.35s.  Autoreconf: 3.15s.  Configure: 5.43s.  Build: 37.15s.  Install: 0.58s.  Post-install: 0.12s.  Total: 1m 33.92s
[+] /opt/release/linux-rocky8-x86_64/intel-2021.2.0/fre-nctools-2024.04-qjsaep5rk3zdxr2wt2ntxp7e4jpobtrh

Copy link
Collaborator

@harshula harshula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dougiesquire
Copy link
Contributor Author

@harshula would you like me to tidy up the commit history before merging?

@dougiesquire
Copy link
Contributor Author

Oh wait, I see the default merge is "Squash and merge". Is that the preference?

@harshula
Copy link
Collaborator

harshula commented Feb 6, 2025

Hi @dougiesquire , Yes, please "Squash and merge" and clean up the commit message.

@dougiesquire dougiesquire merged commit 0330062 into main Feb 6, 2025
1 check passed
@dougiesquire dougiesquire deleted the 143-add-frenctools branch February 6, 2025 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add FRE-NCtools SPD
5 participants