ohpc icon indicating copy to clipboard operation
ohpc copied to clipboard

Reinstall "intel-compilers-devel" cannot update modulefiles as RPMs were first installed then cleaned

Open aflyhorse opened this issue 3 years ago • 9 comments

According to the spec file, it generates the modulefiles after installation in %post, and remove the generated files when uninstalling in %preun.

The problem is that, reinstall / update the rpm, always do installation before uninstallation, eg.

Running transaction
  Preparing        :                                                                                                1/1
  Running scriptlet: intel-compilers-devel-ohpc-2021-15.1.ohpc.2.4.x86_64                                           1/2
  Reinstalling     : intel-compilers-devel-ohpc-2021-15.1.ohpc.2.4.x86_64                                           1/2
  Running scriptlet: intel-compilers-devel-ohpc-2021-15.1.ohpc.2.4.x86_64                                           1/2
Generating new oneAPI modulefiles
Creating OpenHPC-style modulefiles for local oneAPI compiler installation(s).
--> Installing modulefile for version=2022.0.2
--> Installing modulefile for version=2022.1.0
--> Installing modulefile for version=2022.2.0

  Running scriptlet: intel-compilers-devel-ohpc-2021-15.1.ohpc.2.4.x86_64                                           2/2
  Cleanup          : intel-compilers-devel-ohpc-2021-15.1.ohpc.2.4.x86_64                                           2/2
  Verifying        : intel-compilers-devel-ohpc-2021-15.1.ohpc.2.4.x86_64                                           1/2
  Verifying        : intel-compilers-devel-ohpc-2021-15.1.ohpc.2.4.x86_64                                           2/2

Reinstalled:
  intel-compilers-devel-ohpc-2021-15.1.ohpc.2.4.x86_64

Complete!

Which left a very weird folder, contains nothing but a manifest showing that the modulefiles were once there.

[root@sirius intel]# ls -lah
drwxr-xr-x  2 root root   68 Nov  2 22:08 .
drwxr-xr-x 14 root root  198 Nov  2 22:43 ..
-rw-r--r--  1 root root  726 Nov  2 22:08 .rpm-manifest
[root@sirius intel.bak]# cat .rpm-manifest
2215d360a271ba440a60926f7610d55d  /opt/ohpc/pub/modulefiles/intel/2022.0.2
0596d48b4528a680033db5f58f898835  /opt/ohpc/pub/modulefiles/intel/.version.2022.0.2
bc04d554f208ad3c264fcf52aa0b2a8a  /opt/ohpc/pub/moduledeps/gnu/mkl/2022.0.2
bd37743e11d7f39396157e236b1a608e  /opt/ohpc/pub/modulefiles/intel/2022.1.0
ed8c2d1716c180abddb36b09671ea818  /opt/ohpc/pub/modulefiles/intel/.version.2022.1.0
6c1498dc6e99feeacff89c91e3e07966  /opt/ohpc/pub/moduledeps/gnu/mkl/2022.1.0
43c20d4221878ec19921327d187ec7ab  /opt/ohpc/pub/modulefiles/intel/2022.2.0
670d776690c4c1ffee31ad4870bacab9  /opt/ohpc/pub/modulefiles/intel/.version.2022.2.0
3148f9239aa59917ad5c9911bf389a5c  /opt/ohpc/pub/moduledeps/gnu/mkl/2022.2.0

A current walkaround is to yumdownloader the rpm, then rpm -e --nodeps follows a rpm -i.

aflyhorse avatar Nov 02 '22 14:11 aflyhorse

The %preun script needs to be conditionalized with:

if [ $1 -eq 0 ]
then
...
fi

per https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/

It would also be good if the module update code got moved to a separate script that could be easily called when needed.

Also, .rpmnew files really should only be generated if the new file differs from the old.

opoplawski avatar Dec 01 '22 21:12 opoplawski

@jcsiadal does your PR #1595 handle this better?

I also like the idea of having a the script as a separate file to run it manually outside of the RPM if needed.

adrianreber avatar Dec 02 '22 07:12 adrianreber

That's one of the main points for my PR. I would like module updates to be independent of RPMs. Give me a few days to update it. Right now, there's too much code devoted to the manifest and I've thought of a cleaner method to track created files. Also, I need to test my colleague's code that organizes multiple oneAPI toolkit installs by version.

jcsiadal avatar Dec 05 '22 20:12 jcsiadal

@jcsiadal Any update on this? Thanks.

opoplawski avatar Jan 19 '23 22:01 opoplawski

Do you mind hotfix it before figuring out a better long-term improvement?

aflyhorse avatar Dec 18 '23 10:12 aflyhorse

Are there any plans to address this?

opoplawski avatar Apr 04 '24 20:04 opoplawski

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Aug 01 '24 00:08 github-actions[bot]