From 7934601fdfebd837a269d9d9be15430b5dcfd61d Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Wed, 12 Jul 2023 14:35:59 -0700 Subject: [PATCH] add sig for hpc --- iso/empanadas/empanadas/sig/hpc.yaml | 49 +++++++++++++++++++ mangle/generators/common | 1 + mangle/generators/common.py | 26 ++++++++++ mangle/generators/common_10 | 17 +++++++ .../generators/generate_prepopulate_from_epr | 43 ++++++++++++++++ 5 files changed, 136 insertions(+) create mode 100644 iso/empanadas/empanadas/sig/hpc.yaml create mode 100644 mangle/generators/common_10 create mode 100755 mangle/generators/generate_prepopulate_from_epr diff --git a/iso/empanadas/empanadas/sig/hpc.yaml b/iso/empanadas/empanadas/sig/hpc.yaml new file mode 100644 index 0000000..ecb1e8a --- /dev/null +++ b/iso/empanadas/empanadas/sig/hpc.yaml @@ -0,0 +1,49 @@ +--- +hpc: + '8': + profile: 'hpc' + project_id: '78a2db02-ebe5-4654-9a04-6482eb9c8b84' + addtional_dirs: [] + repo: + hpc-common: + allowed_arches: + - x86_64 + - aarch64 + hpc-core: + allowed_arches: + - x86_64 + - aarch64 + extra_files: + git_repo: 'https://git.rockylinux.org/staging/src/rocky-release-hpc.git' + git_raw_path: 'https://git.rockylinux.org/staging/src/rocky-release-hpc/-/raw/r8/' + branch: 'r8' + gpg: + stable: 'SOURCES/RPM-GPG-KEY-Rocky-SIG-HPC' + list: + - 'SOURCES/RPM-GPG-KEY-Rocky-SIG-HPC' + '9': + profile: 'hpc' + project_id: 'aee28795-e163-4a99-935d-f0a78cf33e75' + addtional_dirs: [] + repo: + hpc-common: + allowed_arches: + - x86_64 + - aarch64 + - ppc64le + - s390x + hpc-core: + allowed_arches: + - x86_64 + - aarch64 + - ppc64le + - s390x + extra_files: + git_repo: 'https://git.rockylinux.org/staging/src/rocky-release-hpc.git' + git_raw_path: 'https://git.rockylinux.org/staging/src/rocky-release-hpc/-/raw/r9/' + branch: 'r9' + gpg: + stable: 'SOURCES/RPM-GPG-KEY-Rocky-SIG-HPC' + list: + - 'SOURCES/RPM-GPG-KEY-Rocky-SIG-HPC' +... diff --git a/mangle/generators/common b/mangle/generators/common index e6be9bd..16081a9 100644 --- a/mangle/generators/common +++ b/mangle/generators/common @@ -18,5 +18,6 @@ fi STREAM_COMPOSE_BASEURL="https://composes.stream.centos.org/production" STREAM_KOJI_REPO="https://kojihub.stream.centos.org/kojifiles/repos" +ELN_KOJI_REPO="https://kojipkgs.fedoraproject.org/repos" PERIDOT_REPO="https://yumrepofs.build.resf.org/v1/projects" COMPOSE_BASEDIR="/mnt/compose" diff --git a/mangle/generators/common.py b/mangle/generators/common.py index f0a3d7f..34c8e6d 100644 --- a/mangle/generators/common.py +++ b/mangle/generators/common.py @@ -40,12 +40,32 @@ class common: } return REPOS + def rl10(self): + REPOS = { + 'AppStream': ['aarch64', 'ppc64le', 's390x', 'x86_64'], + 'BaseOS': ['aarch64', 'ppc64le', 's390x', 'x86_64'], + 'CRB': ['aarch64', 'ppc64le', 's390x', 'x86_64'], + 'HighAvailability': ['aarch64', 'ppc64le', 's390x', 'x86_64'], + 'NFV': ['x86_64'], + 'ResilientStorage': ['ppc64le', 's390x', 'x86_64'], + 'RT': ['x86_64'], + 'SAP': ['ppc64le', 's390x', 'x86_64'], + 'SAPHANA': ['ppc64le', 'x86_64'] + } + return REPOS + def rl9all(self): REPOS = { 'all': ['aarch64', 'ppc64le', 's390x', 'x86_64'], } return REPOS + def rl10all(self): + REPOS = { + 'all': ['aarch64', 'ppc64le', 's390x', 'x86_64'], + } + return REPOS + # Parse tags of koji def c8s(self): REPOS = { @@ -59,4 +79,10 @@ class common: } return REPOS + def c10s(self): + REPOS = { + 'c10s-build': ['aarch64', 'ppc64le', 's390x', 'x86_64'], + } + return REPOS + switcher = common() diff --git a/mangle/generators/common_10 b/mangle/generators/common_10 new file mode 100644 index 0000000..875d3cf --- /dev/null +++ b/mangle/generators/common_10 @@ -0,0 +1,17 @@ +# To be sourced by scripts to use + +REPO=("BaseOS" "AppStream" "CRB" "HighAvailability" "ResilientStorage" "NFV" "RT" "SAP" "SAPHANA") +ARCH=("aarch64" "ppc64le" "s390x" "x86_64") + +VER="r${MAJOR}${LH}" + +case "$VER" in + r10) + export PERIDOT_PROJECT_ID=474db218-5282-4ec7-8db2-4fb80a59c850 ;; + r10lh) + export PERIDOT_PROJECT_ID=474db218-5282-4ec7-8db2-4fb80a59c850 ;; + *) + echo "Not supported" + exit 1 + ;; +esac diff --git a/mangle/generators/generate_prepopulate_from_epr b/mangle/generators/generate_prepopulate_from_epr new file mode 100755 index 0000000..5e5f757 --- /dev/null +++ b/mangle/generators/generate_prepopulate_from_epr @@ -0,0 +1,43 @@ +#!/bin/bash +# Parses a koji tag for a branch out +#set -x + +if [ -n "$1" ]; then + MAJOR=$1 +else + echo "Major version not specified" + exit 1 +fi + +export RLVER=$MAJOR +source common + +drop="${PREPOPDROP}" +current=$(pwd) +tmpdir=$(mktemp -d) +tag_template="eln-build" +eln_repo_url="${ELN_KOJI_REPO}/${tag_template}/latest" + +pushd "${tmpdir}" || { echo "Could not change directory"; exit 1; } +for y in "${ARCH[@]}"; do + repodatas=( $(dnf reposync --repofrompath ${tag_template},${eln_repo_url}/${y} --download-metadata --repoid=${tag_template} -p ${tag_template}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) + mkdir -p "${tag_template}/${y}/repodata" + pushd "${tag_template}/${y}/repodata" || { echo "Could not change directory"; exit 1; } + for z in "${repodatas[@]}"; do + wget -q -nc "${z}" + done + wget -q -nc "${eln_repo_url}/${y}/repodata/repomd.xml" + popd || { echo "Could not change back..."; exit 1; } +done +mv eln-build "c${MAJOR}s-build" +/usr/bin/python3 "${current}/prepopulate_parser.py" --version $RLVER --stream +ret_val=$? +popd || { echo "Could not change back..."; exit 1; } + +if [ "$ret_val" -ne "0" ]; then + echo "There was an error running through the parser." + exit 1 +fi + +sed -i "s|${tag_template}|branched|g" $drop +echo "File located at: $drop"