feat(hpc): enhance Lmod with source install and cache rebuild (#634)#655
feat(hpc): enhance Lmod with source install and cache rebuild (#634)#655
Conversation
Add install_method param (package/source) for flexible Lmod deployment, rebuild_cache param for spider cache refresh, and unit tests. Closes #634 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a227a9611b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "cd /tmp && curl -sL https://github.com/TACC/Lmod/archive/{}.tar.gz | tar xz && cd Lmod-{} && ./configure --prefix=/usr/local && make install", | ||
| version, version |
There was a problem hiding this comment.
Source Lmod init from the source-install prefix
This branch installs Lmod with --prefix=/usr/local, but the profile script generated later in execute still only checks /usr/share/lmod/lmod/init/bash (lines 247-248), so install_method: source on a host without the package install leaves login shells without module initialization. In that scenario the module reports success, but users cannot actually use Lmod from their shell startup.
Useful? React with 👍 / 👎.
| let build_deps = match os_family { | ||
| "rhel" => "dnf install -y lua lua-posix lua-filesystem gcc make tcl", | ||
| _ => "DEBIAN_FRONTEND=noninteractive apt-get install -y lua5.3 liblua5.3-dev lua-posix lua-filesystem tcl make", |
There was a problem hiding this comment.
Install curl in source-install dependencies
The source-install path downloads the tarball with curl, but the dependency install commands here do not include curl; on minimal RHEL/Debian images where curl is not preinstalled, the next command fails before build/install begins. This makes install_method: source non-functional in common clean-node environments.
Useful? React with 👍 / 👎.
| if ok { | ||
| changed = true; | ||
| changes.push("Rebuilt Lmod spider cache".to_string()); | ||
| } |
There was a problem hiding this comment.
Fail when requested spider cache rebuild does not run
When rebuild_cache is true, failures of both cache-update commands are silently ignored because only the success path mutates state and there is no else error path. If the script is missing or not executable, the module still returns success with no indication that the requested cache rebuild was not performed.
Useful? React with 👍 / 👎.
Summary
install_methodparameter (package/source) for flexible Lmod deploymentrebuild_cacheparameter for spider cache refreshCloses #634
Test plan
cargo clippy --features full-hpcpassescargo test --features full-hpc --lib -- lmod::tests— 4 tests pass🤖 Generated with Claude Code