Files
documentation/docs/admin-guide/custom_repositories.md
2026-09-28 17:14:01 +02:00

163 lines
6.9 KiB
Markdown

# Custom RPM Repositories
It is possible to manage own RPM repositories which are accessible inside PSI.
If you need one please contact the Linux Core team (linux-eng@psi.ch).
To setup the your custom repository/ies we need following information:
- Name of the repository
- Do you want to have your repository available for __all__ RHEL major versions (i.e. all RHEL major versions will see the same packages) or do you need a repository for each RHEL major version (i.e. you can have different packages for each RHEL major version)?
## Usage
On `lxsup.psi.ch` you can easily access this data on `/packages_misc`.
The backend for these custom repos is on a NFS4 share. This share can be mounted from __lx-fs:/packages_misc__
On __Linux__ systems you should be able to mount the share like this
```bash
mount -t nfs4 -o sec=krb5 lx-fs.psi.ch:/packages_misc /mnt
```
On __MacOS__ you could mount and access the share like this:
```bash
mount_nfs -o sec=krb5,nfsvers=4 lx-fs.psi.ch:/packages_misc ~/some_directory
```
(on __Windows__ - it should be/is also possible with Windows >=10 to mount the NFS4 share- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mount - details to be added here)
Once your folder/folders is/are created and your are authorized to write into these folders you can place RPMs and files into that directory/directories
__Important__: Once mounted, to be able to change things on the filesystem you have to have a valid kerberosticket for your PSI user.
```
kinit <username>@D.PSI.CH
# or on standard PSI linux systems
kinit
```
```{note}
In case you are in a firewall protected zone, make sure that there is a rule to access lx-fs on TCP port 2049!
```
## Overview
Custom repositories are provided by the central repository server as all other repositories. They will be available on the URL
```
https://repos.psi.ch/<os>/latest/<repository_name>
```
The custom repositories are snapshotted and tagged as any other repository.
Inside __hiera__ please use the URL:
```
https://$lx_reposerver/<os>/$lx_repo_tag/<repository_name>
```
This ensures that the systems will always use the correct repository server url to access the repositories. (e.g. in the DMZ/extranet the DNS hostname of the repository is different ...)
The content of the custom repositories are managed on a dedicated NFS4 share. On this share groups can have different folders where they place/manage their rpms. These RPMs are periodically synced to the main repository share (i.e. every 15 minutes), so what you see on the `packages_misc` is not exactly what will end up on the repository server. Upon sync the repository will be automatically built via the create-repo command.
The structure of the share is usually as follows:
```
<base>/<repository name>
# content in the case of one repo for all major RHEL version
/rhel7
/rhel8
/rhle9 # in case of different repo for major RHEL version
```
The access control is done by a Unix group usually named `unx-<something>_adm` (most of the time this is a group that also gives access to hiera repos)
## Preparation for new Custom RPM Repository (by Linux Team)
The `packages_misc` share is only root writeable from lx-sync-01.psi.ch. Therefore the initial setup needs to be done there.
Creation of a new repo (on lx-sync-01 in `/packages_misc`):
```bash
cd /packages_misc
mkdir <reponame>
chgrp 35593 <reponame> ## We need to use the numeric group id here as lx-sync is not directly connected to AD
chmod g+w <reponame>
chmod g+s <reponame>
# set NFS4 ACL to ensure the group can always write
# ensure that you replace the id of the group !!!
nfs4_setfacl -a A:dfg:35593:RWX /modules/test
```
To sync the repo and make it available there needs to be a sync config added to https://gitea.psi.ch/lx/rpm-repo-utils
(inside the __*-misc__ directories)
After adding this config the changes need to be deployed on lx-sync-01.psi.ch.
(either bootstrap/ansible or a manual `git pull` in `/opt/rpm-repo-utils/`)
## DOCA repository (by DARI team)
The DOCA repositories are present in the `/packages_misc/infiniband` directory exported from `lx-sync-01`.
Please be aware that these repos provide the DOCA-OFED profile only,
not the full doca stack. So here DOCA is intended in the sense of DOCA-OFED profile. For more info:
https://docs.nvidia.com/doca/sdk/doca+profiles/index.html.
When you want to introduce a new DOCA version, you must include the following:
- the basic repo as synced from the mellanox repo server and named as the DOCA version (eg. `3.0.0`);
- one repository for each of the supported kernel versions named with the DOCA version followed by the kernel version (eg. `3.0.0-4.18.0-553.53.1.el8_10.x86_64`).
This means that, for each DOCA version there are at least two repositories, ie. the basic one plus at least one kernel.
### Adding a new DOCA version
#### Basic repo
To add a new DOCA version, proceed in the following way:
- create a repo file (eg. `/tmp/doca.repo`) containing the new version definition, using the following as template:
```
[doca]
name=DOCA Online Repo
baseurl=https://linux.mellanox.com/public/repo/doca/3.0.0/rhel8.10/x86_64/
enabled=1
gpgcheck=0
```
- reposync the new version to the NFS storage with the following command, paying attention to the download-path option. E.g. here we are assuming to start the command from the `packages_misc/infiniband` directory):
```
dnf reposync --repoid=doca --config=/tmp/doca.repo --norepopath --download-path=rhel8/doca/8.10/3.0.0
```
#### Kernel support
On a node that is running the kernel we want to build the support for,
make sure that the `doca-extra` package gets installed (this gets
installed automatically if the node is configured with
`infiniband::ofed_vendor: 'doca'` in hiera).
On that node you run the command `/opt/mellanox/doca/tools/doca-kernel-support`. It will take a while and at the end it will print a message like the following:
```
rpm -Uvh /tmp/DOCA.67ZfEDf8BO/doca-kernel-repo-25.04.0.6.1.0-1.kver.4.18.0.553.33.1.el8.10.x86.64.x86_64.rpm
```
Install the rpm, that will create a directory similar to the following (exact path depends on DOCA and kernel version):
```
/usr/share/doca-host-25.04-0.6.1.0/Modules/4.18.0-553.33.1.el8_10.x86_64/
```
The rpms from this directory must then be copied in a directory named
`<doca version>-<kernel version>` under the `/packages_misc/infiniband` directory. Also consider the correct RedHat release in the full path. E.g.:
```
[root@ra-c-054 ~]# scp
/usr/share/doca-host-25.04-0.6.1.0/Modules/4.18.0-553.33.1.el8_10.x86_64/*rpm
talamo_i@login:/psi.ch/project/linux/packages_misc/infiniband/rhel8/doca/8.10/3.0.0-4.18.0-553.33.1.el8_10.x86_64/
```
After the copy, the original rpm can be removed (`yum remove
doca-kernel-repo-25.04.0.6.1.0-1.kver.4.18.0.553.33.1.el8.10.x86.64.x86_64`).
And at this point the repo is fully ready for both the base software
and for the kernel support.