Help configuring a variant symlink

Hello,
I’m trying to configure a variant symlink Creating a Repository (Stratum 0) — CernVM-FS 2.9.4 documentation, but I must be doing something wrong as I cannot seem to get it working.

In the server, I have run the following during a transaction

ln -s '$(CVMFS_ML_ENV:-/cvmfs/sie_u22.iac.es/SIE/ML/modulefiles/ml_py310_nogpu)' /cvmfs/sie_u22.iac.es/SIE/ML/modulefiles/ml_py310_test

In a client I want to override the default link, so I put the following in a “.local” file:

# cat /etc/cvmfs/config.d/sie_u22.iac.es.local
CVMFS_ML_ENV="/cvmfs/sie_u22.iac.es/SIE/ML/modulefiles/ml_py310_cuda_11.4"

CVMFS is aware of this variable:

# cvmfs_config showconfig sie_u22.iac.es | grep -i ml_env
CVMFS_ML_ENV=/cvmfs/sie_u22.iac.es/SIE/ML/modulefiles/ml_py310_cuda_11.4    # from /etc/cvmfs/config.d/sie_u22.iac.es.local

But despite this, the symlink is always to the default value.

# ls -ltr /cvmfs/sie_u22.iac.es/SIE/ML/modulefiles/ml_py310_test 
lrwxrwxrwx 1 cvmfs cvmfs 55 May  6 12:09 /cvmfs/sie_u22.iac.es/SIE/ML/modulefiles/ml_py310_test -> /cvmfs/sie_u22.iac.es/SIE/ML/modulefiles/ml_py310_nogpu

Am I doing something wrong?

Hi Angel,

no this looks good. You might just need to do a cvmfs_config reload sie_u22.iac.es
It’s admittedly a bit confusing that showconfig shows the current state of the config files, not of the repository. You would need to look at the process environment in /proc for that.
Let me know if this was it!
Cheers,
Valentin

( Note that for this reason variant symlinks aren’t often used for configuring software stacks installed on CVMFS, this is usually done via module files or setup scripts. It’s mostly used for extended CVMFS configuration, as in the example in the docs)

Ah, perfect. Wtith the cvmfs_config reload sie_u22.iac.es all was good (I had thought that the configuration changes would be loaded automatically, as when I change the repository contents, but it is no issue to do the “reload”, since this will seldom change.

In my case I wanted to try the variant symlinks for the following scenario (let me know if you think another approach would be more suitable):

I have some software that depends on the GPU of the client (basically I have a version that is OK for almost all clients, but some older machines need another version), so I just prepared two versions, which are loaded in each client with the same module (for example, module load ml_py310). With the variant symlink I can make the modulefile for “ml_py310” point to the correct modulefile for the client.