Skip to content

Commit

Permalink
Merge branch 'uenv_ci' of github.com:C2SM/spack-c2sm into uenv_ci_nvm…
Browse files Browse the repository at this point in the history
…alloc
  • Loading branch information
leclairm committed Aug 5, 2024
2 parents 121ad2a + b5ddb2a commit 9dba9b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
3 changes: 2 additions & 1 deletion setup-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ fi
if [[ ${machine:0:1} == "/" ]]; then
export SPACK_SYSTEM_CONFIG_PATH="$machine"/config
export SPACK_USER_CONFIG_PATH="$parent_dir"/sysconfigs/uenv
export SPACK_USER_CACHE_PATH="$parent_dir"/user-cache/uenv
else
export SPACK_SYSTEM_CONFIG_PATH="$parent_dir"/sysconfigs/"$machine"
export SPACK_USER_CONFIG_PATH="$parent_dir"/user-config
export SPACK_USER_CACHE_PATH="$parent_dir"/user-cache/"$machine"
fi

export SPACK_USER_CACHE_PATH="$parent_dir"/user-cache

. "$parent_dir"/spack/share/spack/setup-env.sh

Expand Down
5 changes: 2 additions & 3 deletions src/spack_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def log_with_spack(command: str,
if uenv:
spack_env += ' /user-environment'

# Only use srun as Jenkins user and not on balfrin
# Only use srun as Jenkins user and on machines where it is available
use_srun = allow_srun and getpass.getuser() == 'jenkins' and machine_name(
) != 'balfrin'
) in ['daint', 'tsa']

uenv_args = ''
if uenv:
Expand All @@ -48,7 +48,6 @@ def log_with_spack(command: str,
# The '-c' argument should be in sync with
# sysconfig/<machine>/config.yaml config:build_jobs for max efficiency

# No entry for balfrin, trigger and error instead if requested to run with srun
srun = {
'daint': 'srun -t 02:00:00 -C gpu -A g110 -c 12 -n 1',
'tsa': 'srun -t 02:00:00 -c 6',
Expand Down
12 changes: 4 additions & 8 deletions test/system_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def test_install_libfyaml_default():

@pytest.mark.no_tsa # No uenv on Tsa
@pytest.mark.no_daint # No uenv on Daint
@pytest.mark.no_balfrin # Does not work as expected
@pytest.mark.libfyaml
def test_install_libfyaml_default_uenv():
spack_install('libfyaml', test_root=False, uenv=PREPOST)
Expand Down Expand Up @@ -181,14 +182,16 @@ def icon_env_test(spack_env: str, out_of_source: bool = False):
check=True,
shell=True)

log_filename = sanitized_filename(spack_env)

if out_of_source:
build_dir = os.path.join(unique_folder, 'build')
os.makedirs(build_dir, exist_ok=True)
shutil.copytree(os.path.join(unique_folder, 'config'),
os.path.join(build_dir, 'config'))
unique_folder = build_dir
log_filename += '_out_of_source'

log_filename = sanitized_filename(spack_env) + '_out_of_source'
log_with_spack('spack install -n -v',
'system_test',
log_filename,
Expand Down Expand Up @@ -328,13 +331,6 @@ def test_py_black_install_default(devirt_env):
spack_install('py-black')


@pytest.mark.no_tsa # No uenv on Tsa
@pytest.mark.no_daint # No uenv on Daint
@pytest.mark.py_black
def test_install_py_black_default_uenv(devirt_env):
spack_install('py-black', uenv=PREPOST)


@pytest.mark.py_boltons
def test_py_boltons_install_default(devirt_env):
spack_install('py-boltons')
Expand Down

0 comments on commit 9dba9b3

Please sign in to comment.