brainvisa / casa-distro

Unified development environment for BrainVISA projects.
2 stars 1 forks source link

Installation of SPM in user images fails #320

Closed ylep closed 1 year ago

ylep commented 1 year ago

The SPM Standalone installation in /i2bm/local now stores the MATLAB Compiler Runtime in a new location (/i2bm/local/matlab/MATLAB_Runtime/v97), so the default parameters (install_thirdparty=default) result in an exception during user image creation:

+ /casa/install/templates/brainvisa/spm.py
Traceback (most recent call last):
  File "/casa/install/templates/brainvisa/spm.py", line 17, in <module>
    neuroConfig.app.configuration.SPM.spm12_standalone_mcr_path =         glob.glob('/usr/local/spm12-standalone/mcr/v*')[0]
IndexError: list index out of range

We should maybe fix the default to search for the MCR in the new location, or maybe disable the incorporation of SPM Standalone by default... ?

denisri commented 1 year ago

Yes, I admit I have done a local copy of SPM standalone + MCR in order to have it work. The problem is that I don't know a way to guess which MCR is used by a given spm-standalone, so when the MCR is not inside the SPM insall directory, I don't know how to find it.

ylep commented 1 year ago

Yeah, even run_spm12.sh does not know how to find the MCR and you have to provide the path to it manually, which is really not user-friendly...

If a custom install is needed anyway, maybe we should just disable the default behaviour of copying SPM from /i2bm/local? Just so that the default actually works...

denisri commented 1 year ago

I vaguely remember I had disabled the option by default, maybe I have just done it in a dream... I'll check that.

denisri commented 1 year ago

The default value for install_thirdparty is none, so it should actually not try to copy SPM if no option is given. I have not tried right now.

ylep commented 1 year ago

Right, it does not happen by default with create_user_image but it is the default with bbi_daily, is it on purpose?

https://github.com/brainvisa/casa-distro/blob/66e2c106ed12d5277c38376304cd1617d898f5d8/python/casa_distro/admin_commands.py#L1005

I guess the more fundamental question behind that is: do we want to include SPM in our brainvisa and/or cea releases?

denisri commented 1 year ago

Yes it's enabled in bbi_daily, or more precisely in crontabs that run nightly. They are activated in order to test that SPM can actually be shipped and setup in distributions, and we have more or less agreed to ship it in brainvisa releases (Jeff's suggestion). For cea releases the question remains open. The other advantage to ship it is that brainvisa is also automatically setup because its path is known then, so it works out of the box, without any user setup.

denisri commented 1 year ago

Oh you're right the default in casa_distro_admin bbi_daily is still default, not the same as for casa_distro create_user_image. That's a mistake, I'm fixing it.

ylep commented 1 year ago

Okay, then I would propose that we also move the install that you did on your volatile to somewhere under /neurospin/brainvisa, so that all machines that run nightly builds can find an appropriate install, and modify the casa_distro.thirdparty module so that it looks in that new location, what do you think

That way we can stay unaffected by changes that are made to /i2bm/local/spm-standalone

denisri commented 1 year ago

OK. It's too bad we cannot use the "official" install in /i2bm but I could not find a way to detect which MCR was needed. I'm moving it there.

denisri commented 1 year ago

I'm not sure if we should modify the casa_distro.thirdparty module, because it would then contain a non-standard hard-coded path (in /neurospin), which is not very clean even if we test that this directory exists or look in a paths list...?

denisri commented 1 year ago

I have moved it to /neurospin/brainvisa/thirdparty/ there is a file thirdparty.json there which lists the software to be installed (only spm for now). SPM standalone + MCR v97 is 6 GB so the package will grow, and copying SPM from the network will be longer than from /volatile, but at least we have a single place for it now. I have modified crontabs on is234199 (my machine, cea tests) and is234203 (@sapetnioc's, brainvisa tests), @ylep I think you have another one setup ?

ylep commented 1 year ago

@denisri Actually is234203 is mine, so I think everything is covered (I have a nightly for the DISCO tests using MATLAB, but I have disabled installation of thirdparty dependencies there). So from my side we can close the issue. Thanks!