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

Update spack fork from spack develop 2022/12/22 #424

Conversation

climbfuji
Copy link
Collaborator

@climbfuji climbfuji commented Dec 22, 2022

#WIP

Description

Updates to documentation, CI builds and package configurations (in config/common/packages.yaml and in container configs) to work with the updated spack code from JCSDA/spack#210. Important updates are:

  • Update py-scipy from 1.8.0 to 1.9.3 to fix build errors and duplicate packages
  • Let spack build Python for Ubuntu Linux CI builds
  • Let spack build Python in macOS instructions for local systems.

Note: For now, keep the Homebrew Python for macOS CI runs. We should change this (and the Linux instructions for local systems) to spack-built python in the near future. And consider doing the same on HPCs.

Update .gitmodules and submodule pointer for spack for code review and testing

Issues

Working towards #394 and #376.

Dependencies

Testing

  • CI tests passed for 8ae66fb
  • Successfully installed on @climbfuji's macOS (skylab-dev template + jedi-tools-env)

@climbfuji
Copy link
Collaborator Author

@AlexanderRichert-NOAA Do you understand this error?

/Users/runner/work/spack-stack/spack-stack/spack/var/spack/repos/builtin/packages/bacio/package.py:44, in patch:
         43    def patch(self):
  >>     44        if self.spec.satisifes("@@2.4.1"):
         45            filter_file(".*", "2.4.1", "VERSION")

The code doesn't have two @@, only one: https://github.com/NOAA-EMC/spack/pull/210/files#diff-8112aa20228dc1ee61fe9020c28d297f7d62931810c3c2c27a86cdf17abc87ac

@AlexanderRichert-NOAA
Copy link
Collaborator

@AlexanderRichert-NOAA Do you understand this error?

/Users/runner/work/spack-stack/spack-stack/spack/var/spack/repos/builtin/packages/bacio/package.py:44, in patch:
         43    def patch(self):
  >>     44        if self.spec.satisifes("@@2.4.1"):
         45            filter_file(".*", "2.4.1", "VERSION")

The code doesn't have two @@, only one: https://github.com/NOAA-EMC/spack/pull/210/files#diff-8112aa20228dc1ee61fe9020c28d297f7d62931810c3c2c27a86cdf17abc87ac

No. I pushed a fix based on the function name typo, but I'm not sure what's going on with the double "@" in the output there. I'm hoping it's just a bug in the error output...

@climbfuji
Copy link
Collaborator Author

@AlexanderRichert-NOAA Do you understand this error?

/Users/runner/work/spack-stack/spack-stack/spack/var/spack/repos/builtin/packages/bacio/package.py:44, in patch:
         43    def patch(self):
  >>     44        if self.spec.satisifes("@@2.4.1"):
         45            filter_file(".*", "2.4.1", "VERSION")

The code doesn't have two @@, only one: https://github.com/NOAA-EMC/spack/pull/210/files#diff-8112aa20228dc1ee61fe9020c28d297f7d62931810c3c2c27a86cdf17abc87ac

No. I pushed a fix based on the function name typo, but I'm not sure what's going on with the double "@" in the output there. I'm hoping it's just a bug in the error output...

If I had read the error more carefully ... self.spec.satisifes should be self.spec.satisfies. I'll push an update.

There are new CI failures for Linux, apparently because apparenty something requires a Python newer than 3.9 and the external we have on Linux CI (3.8). I'll check and maybe switch to spack-built python, wanted to do that a while ago already.

@AlexanderRichert-NOAA
Copy link
Collaborator

If I had read the error more carefully ... self.spec.satisifes should be self.spec.satisfies. I'll push an update.

There are new CI failures for Linux, apparently because apparenty something requires a Python newer than 3.9 and the external we have on Linux CI (3.8). I'll check and maybe switch to spack-built python, wanted to do that a while ago already.

The "satisifes" typo is the one I was referring to-- the fix has already been merged.

Let me know if you want me to look at the Python/CI matter. Which images are using 3.8?

@climbfuji
Copy link
Collaborator Author

If I had read the error more carefully ... self.spec.satisifes should be self.spec.satisfies. I'll push an update.
There are new CI failures for Linux, apparently because apparenty something requires a Python newer than 3.9 and the external we have on Linux CI (3.8). I'll check and maybe switch to spack-built python, wanted to do that a while ago already.

The "satisifes" typo is the one I was referring to-- the fix has already been merged.

Let me know if you want me to look at the Python/CI matter. Which images are using 3.8?

I'm already testing the Linux build with internal Python. It's a ubuntu20 image I think. The update of the CI system to use AWS codebuild with more powerful, faster and better controllable images is long planned, just waiting for the spack repository move to happen.

@climbfuji
Copy link
Collaborator Author

But, fwiw, I pulled the spack develop branch this morning, and it didn't have the bacio fix?

@AlexanderRichert-NOAA
Copy link
Collaborator

But, fwiw, I pulled the spack develop branch this morning, and it didn't have the bacio fix?

https://github.com/spack/spack/tree/develop/var/spack/repos/builtin/packages/bacio/package.py
spack/spack#34663

@climbfuji
Copy link
Collaborator Author

climbfuji commented Dec 22, 2022 via email

@climbfuji
Copy link
Collaborator Author

@AlexanderRichert-NOAA - I guess the new logic in bacio isn't working as expected. I'll go back to what we had in our spack fork until there is a proper fix in the authoritative repo?

    '/usr/local/bin/cmake' '-G' 'Unix Makefiles' '-DCMAKE_INSTALL_PREFIX:STRING=/home/runner/work/spack-stack/spack-stack/envs/default/install/intel/2021.8.0/bacio-2.4.1-pjld7qk' '-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo' '-DBUILD_TESTING:BOOL=OFF' '-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF' '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON' '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON' '-DCMAKE_INSTALL_RPATH:STRING=/home/runner/work/spack-stack/spack-stack/envs/default/install/intel/2021.8.0/bacio-2.4.1-pjld7qk/lib;/home/runner/work/spack-stack/spack-stack/envs/default/install/intel/2021.8.0/bacio-2.4.1-pjld7qk/lib64' '-DCMAKE_PREFIX_PATH:STRING=' '-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON' '/home/runner/work/spack-stack/spack-stack/cache/build_stage/spack-stage-bacio-2.4.1-pjld7qkpid7oxovqaxhbi7auxsip6gd5/spack-src'

1 error found in build log:
  >> 3    CMake Error at CMakeLists.txt:5 (project):
     4      VERSION "2.4.12.4.1" format invalid.
     5    
     6    
     7    -- Configuring incomplete, errors occurred!

@AlexanderRichert-NOAA
Copy link
Collaborator

@AlexanderRichert-NOAA - I guess the new logic in bacio isn't working as expected. I'll go back to what we had in our spack fork until there is a proper fix in the authoritative repo?

    '/usr/local/bin/cmake' '-G' 'Unix Makefiles' '-DCMAKE_INSTALL_PREFIX:STRING=/home/runner/work/spack-stack/spack-stack/envs/default/install/intel/2021.8.0/bacio-2.4.1-pjld7qk' '-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo' '-DBUILD_TESTING:BOOL=OFF' '-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF' '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON' '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON' '-DCMAKE_INSTALL_RPATH:STRING=/home/runner/work/spack-stack/spack-stack/envs/default/install/intel/2021.8.0/bacio-2.4.1-pjld7qk/lib;/home/runner/work/spack-stack/spack-stack/envs/default/install/intel/2021.8.0/bacio-2.4.1-pjld7qk/lib64' '-DCMAKE_PREFIX_PATH:STRING=' '-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON' '/home/runner/work/spack-stack/spack-stack/cache/build_stage/spack-stage-bacio-2.4.1-pjld7qkpid7oxovqaxhbi7auxsip6gd5/spack-src'

1 error found in build log:
  >> 3    CMake Error at CMakeLists.txt:5 (project):
     4      VERSION "2.4.12.4.1" format invalid.
     5    
     6    
     7    -- Configuring incomplete, errors occurred!

Oof. Looks like a Python bug. Depending on the Python version, the code

import re
print(re.sub(".*","2.4.1","2.4.1"))

gives different results. 3.6.8 gives "2.4.1", 3.8.12 and 3.10.5 give "2.4.12.4.1". Must be matching a beginning or end of line. I think the fix will be to change "*" to "+".

@climbfuji
Copy link
Collaborator Author

climbfuji commented Dec 22, 2022 via email

@climbfuji
Copy link
Collaborator Author

If that works, you can cherry-pick 36caf0a390557a49073097b40486b243e422b7e2 and update bacio in the authoritative repo. This way we won't have merge conflicts down the road.

@climbfuji climbfuji force-pushed the feature/update_spack_from_authoritative_20221222 branch from 517ee99 to 3421fe7 Compare December 23, 2022 03:42
@climbfuji climbfuji changed the title DRAFT: Update spack fork from spack develop 2022/12/22 Update spack fork from spack develop 2022/12/22 Dec 27, 2022
@climbfuji climbfuji self-assigned this Dec 27, 2022
@climbfuji climbfuji marked this pull request as ready for review December 27, 2022 23:55
.gitmodules Outdated
##branch = develop
#url = https://github.com/NOAA-EMC/spack
#branch = jcsda_emc_spack_stack
url = https://github.com/climbfuji/spack
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this intentional? Seems like you are switching to your fork here?

Copy link
Collaborator Author

@climbfuji climbfuji Dec 28, 2022

Choose a reason for hiding this comment

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

That's needed for the CI tests to work properly. Until the spack PR is merged, the spack submodule pointer in spack-stack must point to the branch and fork to find the updated code. Procedure is: CI tests need to complete, then we merge the spack PR (pending approval, of course), then update the spack submodule pointer in spack-stack and revert .gitmodules. Then CI runs again, but can be bypassed if the code in the spack PR is identical with the final code in our (EMC) spack fork/branch - this is normally the case and can be assessed quickly (I do that after merging the spack PR).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

BTW, the ufs-weather-model is using the same for its code commit procedures.

Copy link
Collaborator

@AlexanderRichert-NOAA AlexanderRichert-NOAA left a comment

Choose a reason for hiding this comment

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

cool

@climbfuji climbfuji merged commit 19ff826 into JCSDA:develop Dec 28, 2022
@climbfuji climbfuji deleted the feature/update_spack_from_authoritative_20221222 branch December 28, 2022 20:57
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.

4 participants