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

Extended dry-run broken in 5.0.x #4713

Closed
VRehnberg opened this issue Dec 4, 2024 · 2 comments
Closed

Extended dry-run broken in 5.0.x #4713

VRehnberg opened this issue Dec 4, 2024 · 2 comments
Labels
Milestone

Comments

@VRehnberg
Copy link

Example error message

$ eb -x CUDA-12.1.1.eb 
== Temporary log file in case of crash /dev/shm/eb-fzxu3mgy/easybuild-1uvmjeo1.log
file /dev/shm/eb-fzxu3mgy/fake_vsc_iax5y02_ removed
ERROR: pattern '.*(lmod|LMOD_CMD)' (Lmod) not found in defined 'module' function.
Specify the correct modules tool to avoid weird problems due to this mismatch, see the --modules-tool and --avail-modules-tools command line options.
Or alternatively, use --allow-modules-tool-mismatch to stop treating this as an error. Obtained definition of 'module' function: 

Set-up

Module set-up:

$ echo $LMOD_CMD
/usr/share/lmod/lmod/libexec/lmod
$ declare -f module
module () 
{ 
    if [ -z "${LMOD_SH_DBG_ON+x}" ]; then
        case "$-" in 
            *v*x*)
                __lmod_sh_dbg='vx'
            ;;
            *v*)
                __lmod_sh_dbg='v'
            ;;
            *x*)
                __lmod_sh_dbg='x'
            ;;
        esac;
    fi;
    if [ -n "${__lmod_sh_dbg:-}" ]; then
        set +$__lmod_sh_dbg;
        echo "Shell debugging temporarily silenced: export LMOD_SH_DBG_ON=1 for Lmod's output" 1>&2;
    fi;
    eval "$($LMOD_CMD shell "$@")" && eval "$(${LMOD_SETTARG_CMD:-:} -s sh)";
    __lmod_my_status=$?;
    if [ -n "${__lmod_sh_dbg:-}" ]; then
        echo "Shell debugging restarted" 1>&2;
        set -$__lmod_sh_dbg;
    fi;
    unset __lmod_sh_dbg;
    return $__lmod_my_status
}

Using 5.0.x stuff, did a pull on 5.0.x branches for blocks, configs and framework while writing this.

unset EASYBUILD_SOURCEPATH;
module purge;
module unuse $MODULEPATH;
module use /apps/Test/fmodules/all;
module use /apps/Common/fmodules/all;
local devpath=$HOME/vikren/easybuild/;
cd "$devpath";
export PATH="${devpath}/framework:$PATH";
export PYTHONPATH="${devpath}/framework:${devpath}/blocks:${devpath}/configs";
export EASYBUILD_ROBOT_PATHS="${devpath}/configs/easybuild/easyconfigs";
export EASYBUILD_INSTALLPATH=/apps/Test/;
export EASYBUILD_REPOSITORYPATH=/apps/Test/ebfiles_repo;
@jfgrimm
Copy link
Member

jfgrimm commented Dec 4, 2024

I can reproduce this
It looks like it's not ending up with any output from type module, probably because dry run is causing it to not actually be run:

> /users/jfg508/eb/eb5/easybuild-framework/easybuild/tools/modules.py(313)check_module_function()
-> res = run_shell_cmd(cmd, fail_on_error=False, in_dry_run=False, hidden=True, output_file=False)
(Pdb) n
> /users/jfg508/eb/eb5/easybuild-framework/easybuild/tools/modules.py(314)check_module_function()
-> output, exit_code = res.output, res.exit_code
(Pdb) res
RunShellCmdResult(cmd='type module', exit_code=0, output='', stderr=None, work_dir='/users/jfg508', out_file=None, err_file=None, cmd_sh=None, thread_id=None, task_id=None)

we'll need to ensure that type module is actually run

@boegel
Copy link
Member

boegel commented Dec 11, 2024

fixed with #4721

@boegel boegel closed this as completed Dec 11, 2024
@boegel boegel removed this from EasyBuild v5.0 Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants