xcat2 / xcat-core

Code repo for xCAT core packages
Eclipse Public License 1.0
372 stars 173 forks source link

otherpkgs postscript not adapted to CentOS 8.x #6577

Closed conxuro closed 3 years ago

conxuro commented 4 years ago

Since CentOS 8.x ISOs doesn't have the same directory structure as 7.x, the otherpkgs poscripts have some issues.

When it's executed manually the command updatenode node -P otherpkgs it generates several xCAT-centos8.0-path*.repo files in the node.

If linuximage tab's pkgdir value is only the root of ISO (e.g. /install/centos8.0/x86_64), then a repo file with a wrong base URL is generated (e.g. baseurl=http://172.17.0.2:80/install/centos8.0/x86_64) because there is no repodata in that directory but in AppStream and BaseOS subdirectories.

$ ls -la /install/centos7.6/x86_64/
total 336
drwxr-xr-x 8 root root   4096 Aug  5  2019 .
drwxr-xr-x 3 root root   4096 Aug  5  2019 ..
-rw-rw-r-- 1 root root     14 Nov 25  2018 CentOS_BuildTag
-rw-r--r-- 1 root root     29 Nov 25  2018 .discinfo
drwxr-xr-x 3 root root   4096 Aug  5  2019 EFI
-rw-rw-r-- 1 root root    227 Aug 30  2017 EULA
-rw-r--r-- 1 root root     33 Aug  5  2019 .fingerprint
-rw-rw-r-- 1 root root  18009 Dec  9  2015 GPL
drwxr-xr-x 3 root root   4096 Aug  5  2019 images
drwxr-xr-x 2 root root   4096 Aug  5  2019 isolinux
drwxr-xr-x 2 root root   4096 Aug  5  2019 LiveOS
drwxrwxr-x 2 root root 262144 Aug  5  2019 Packages
drwxrwxr-x 2 root root   4096 Aug  5  2019 repodata
-rw-rw-r-- 1 root root   1690 Dec  9  2015 RPM-GPG-KEY-CentOS-7
-rw-rw-r-- 1 root root   1690 Dec  9  2015 RPM-GPG-KEY-CentOS-Testing-7
-r--r--r-- 1 root root   2883 Nov 26  2018 TRANS.TBL
-rw-r--r-- 1 root root    354 Nov 25  2018 .treeinfo
$ ls -la /install/centos8.0/x86_64/
total 48
drwxr-xr-x 7 root root 4096 Feb 18 11:14 .
drwxr-xr-x 3 root root 4096 Feb 18 11:12 ..
dr-xr-xr-x 4 root root 4096 Aug 15  2019 AppStream
dr-xr-xr-x 4 root root 4096 Aug 15  2019 BaseOS
-r--r--r-- 1 root root   44 Aug 15  2019 .discinfo
dr-xr-xr-x 3 root root 4096 Aug 15  2019 EFI
-rw-r--r-- 1 root root   33 Feb 18 11:14 .fingerprint
dr-xr-xr-x 3 root root 4096 Aug 15  2019 images
dr-xr-xr-x 2 root root 4096 Aug 15  2019 isolinux
-r--r--r-- 1 root root   87 Aug 15  2019 media.repo
-r--r--r-- 1 root root  664 Aug 15  2019 TRANS.TBL
-r--r--r-- 1 root root 1520 Aug 15  2019 .treeinfo

Then any yum command in node results in error:

$ yum repolist
xCAT-centos8.0-path0                                                                                                                             233 kB/s | 242  B     00:00    
Error: Failed to synchronize cache for repo 'xCAT-centos8.0-path0'

Maybe other related issues are present with 8.x releases with otherpkgs or related to the ISO image structure.


Tested with: $ cat /etc/redhat-release CentOS Linux release 7.7.1908 (Core)

$ xcatconfig -v Version 2.15 (git commit 218c6d3acc8bdbd7f72115e48cda2b1a3613d18a, built Mon Nov 4 15:17:59 EST 2019)

conxuro commented 4 years ago

Workaround: do not add an ospkgdir as a repo if doesn't contains repodata.

diff otherpkgs otherpkgs.orig
565,567c565
<            result=$(curl -s --fail --retry 20 --max-time 60 http://${OSPKGDIR}/ | grep repodata 2>&1)
<            if [ $? -eq 0 ]
<            then
---
> 
578d575
<            fi
nicolas-tallet commented 3 years ago

One comment on this issue that we are experiencing on our side as well with RHELS 8.2: when the otherpkgs Postscript gets executed after reboot during provisioning, it is unclear to me why the script tries to generate repository files for the OS packages... because the repository file used during the first stage of the install is actually already present.

Illustration, in our case:

[local-rhels8.2.0-ppc64le--install-rhels8.2.0-ppc64le-BaseOS] name=xCAT configured yum repository for /install/rhels8.2.0/ppc64le/BaseOS baseurl=http://p3svc03-adm:80//install/rhels8.2.0/ppc64le/BaseOS enabled=1 gpgcheck=0

[local-rhels8.2.0-ppc64le--install-rhels8.2.0-ppc64le-CRB] name=xCAT configured yum repository for /install/rhels8.2.0/ppc64le/CRB baseurl=http://p3svc03-adm:80//install/rhels8.2.0/ppc64le/CRB enabled=1 gpgcheck=0


* `xCAT-otherpkgs[0-2].repo`: Repository files for the Other Packages (as specified in the `otherpkgdir` attribute of the OS Image)

* `xCAT-rhels8.2.0-path0.repo`: Repository file the the OS Packages generated by the `otherpkgs` Postscript, with an invalid content as it only contains the top directory of the distribution which doesn't contain any `repodata` folder:

[xCAT-rhels8.2.0-path0] name=xCAT-rhels8.2.0-path0 baseurl=http://p3svc03-adm:80/install/rhels8.2.0/ppc64le enabled=1 gpgcheck=0 skip_if_unavailable=True


-> This one is both wrong and redundant. What is the point of this file?
gurevichmark commented 3 years ago

@conxuro Have you tried xCAT 2.16 ? It might have some fixed to deal with CentOS 8.x better.

gurevichmark commented 3 years ago

@nicolas-tallet The local-repository-0.repo gets generated during node install from kickstart file. The xCAT-rhels8.2.0-path0.repo gets generated by oskpgs and otherpkgs postscripts. Those postscripts get executed when running updatenode, in case pkgdir and otherpkgdir were changed. But I do not quite understand why a new .repo file needs to be created instead of reusing the local-repository-0.repo

TheWitness commented 3 years ago

I'm experiencing this on a new install as well. Seems the xCAT-rhels8.2.0-path0.repo is created in error as it does not point to anything.

gurevichmark commented 3 years ago

Fixed by #7016