From 816c861797ff0cbe90140b334bde5f863629773f Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Fri, 10 Oct 2025 14:04:45 -0600 Subject: [PATCH] ci: ostree wip Show how to configure package repos for use with ostree image building and https://github.com/linux-system-roles/tox-lsr/pull/213 Signed-off-by: Rich Megginson --- .ostree/get_ostree_data.sh | 84 +++++++++++++++++++++++++-- .ostree/packages-runtime-CentOS-9.txt | 3 + .ostree/repos-runtime-CentOS-9.repo | 33 +++++++++++ 3 files changed, 114 insertions(+), 6 deletions(-) create mode 100644 .ostree/packages-runtime-CentOS-9.txt create mode 100644 .ostree/repos-runtime-CentOS-9.repo diff --git a/.ostree/get_ostree_data.sh b/.ostree/get_ostree_data.sh index 65830d6..7ad0ab8 100755 --- a/.ostree/get_ostree_data.sh +++ b/.ostree/get_ostree_data.sh @@ -6,15 +6,16 @@ ostree_dir="${OSTREE_DIR:-"$(dirname "$(realpath "$0")")"}" if [ -z "${4:-}" ] || [ "${1:-}" = help ] || [ "${1:-}" = -h ]; then cat <&2 echo ERROR - could not find role "$role" - please use ANSIBLE_COLLECTIONS_PATH + exit 2 + fi + get_repos "$rolepath" + done + fi + done +} + +format_repos_json() { + python -c 'import sys; import json; import configparser +cp = configparser.ConfigParser() +cp.read_file(sys.stdin) +ret = [] +# supported is from osbuild-mpp +supported = ["baseurl", "metalink", "mirrorlist", + "enabled", "metadata_expire", "gpgcheck", "username", "password", "priority", + "sslverify", "sslcacert", "sslclientkey", "sslclientcert", + "skip_if_unavailable"] +for section in cp.sections(): + repo = {"id": section} + for option in supported: + if cp.has_option(section, option): + repo[option] = cp.get(section, option) + ret.append(repo) +repo_str = json.dumps(ret) +repo_str = repo_str.replace("$", "$$$$") +print(repo_str) +' +} + +format_repos_raw() { + cat +} + +format_repos_yaml() { + python -c 'import sys; import yaml; import configparser +cp = configparser.ConfigParser() +cp.read_file(sys.stdin) +ret = [] +for section in cp.sections(): + repo = {"id": section} + for option in cp.options(section): + repo[option] = cp.get(section, option) + ret.append(repo) +yaml.safe_dump(ret, sys.stdout) +' +} + distro="${distro_ver%%-*}" +suffix_list=("" "-$distro") ver="${distro_ver##*-}" if [[ "$ver" =~ ^([0-9]*) ]]; then major_ver="${BASH_REMATCH[1]}" + suffix_list+=("-${distro}-${major_ver}") + if [ "$ver" != "$major_ver" ]; then + suffix_list+=("-${distro}-${ver}") + fi else echo ERROR: cannot parse major version number from version "$ver" exit 1 diff --git a/.ostree/packages-runtime-CentOS-9.txt b/.ostree/packages-runtime-CentOS-9.txt new file mode 100644 index 0000000..04c2592 --- /dev/null +++ b/.ostree/packages-runtime-CentOS-9.txt @@ -0,0 +1,3 @@ +cuda-toolkit-12-9 +libnccl-2.27.5-1+cuda12.9 +libnccl-devel-2.27.5-1+cuda12.9 diff --git a/.ostree/repos-runtime-CentOS-9.repo b/.ostree/repos-runtime-CentOS-9.repo new file mode 100644 index 0000000..cffbc58 --- /dev/null +++ b/.ostree/repos-runtime-CentOS-9.repo @@ -0,0 +1,33 @@ +[epel] +name=Extra Packages for Enterprise Linux 9 +# It is much more secure to use the metalink, but if you wish to use a local mirror +# place its address here. +baseurl=https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64 +#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-9&arch=$basearch&infra=$infra&content=$contentdir +enabled=1 +gpgcheck=1 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-9 + +[epel-next] +name=Extra Packages for Enterprise Linux 9 - Next +# It is much more secure to use the metalink, but if you wish to use a local mirror +# place its address here. +baseurl=https://dl.fedoraproject.org/pub/epel/next/9/Everything/x86_64 +#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-next-9&arch=$basearch&infra=$infra&content=$contentdir +enabled=1 +gpgcheck=1 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-9 + +[nvidia-cuda] +name=NVIDIA CUDA repository +gpgkey=https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/D42D0685.pub +baseurl=https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64 +enabled=1 + +[microsoft-prod] +name=Microsoft Production repository +gpgkey=https://packages.microsoft.com/keys/microsoft.asc +baseurl=https://packages.microsoft.com/rhel/9/prod/ +enabled=1