From ef9b90b1ce0795060c96f4c44165e6d3b2206a1d Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Wed, 30 Sep 2020 20:37:33 +0200 Subject: [PATCH] ELN: Use the "global variable" feature to reduce config duplicities. This moves all the configuration variables from eln.conf to shared/*.conf files. The configuration itself remains the same, it is just stored differently. Signed-off-by: Jan Kaluza --- eln.conf | 51 +--------------------- lorax.conf => fedora/lorax.conf | 0 fedora/override.conf | 44 +------------------ fedora/variables.conf | 16 +++++-- shared/additional_and_filter_packages.conf | 18 ++++++++ shared/all.conf | 10 +++++ shared/buildinstall.conf | 12 +++-- shared/gather.conf | 8 ++++ shared/general.conf | 28 ++++++++++++ shared/pkgset.conf | 2 + shared/runroot.conf | 3 ++ shared/variables.conf | 31 +++++++++++++ 12 files changed, 126 insertions(+), 97 deletions(-) rename lorax.conf => fedora/lorax.conf (100%) create mode 100644 shared/all.conf create mode 100644 shared/variables.conf diff --git a/eln.conf b/eln.conf index e2379d0..ea39619 100644 --- a/eln.conf +++ b/eln.conf @@ -8,54 +8,7 @@ # For any change which should happen only for Fedora ELN, edit the # "fedora/override.conf" configuration file. -from shared/general import * -from shared/multilib import * -from shared/additional_and_filter_packages import * -from shared/runroot import * -from shared/pkgset import * -from shared/gather import * -from shared/createrepo import * -from shared/createiso import * -from shared/buildinstall import * -from shared/lookaside import * +from shared/variables import * from fedora/variables import * - -# PRODUCT INFO -release_name = RELEASE_NAME -release_short = RELEASE_SHORT -release_version = RELEASE_VERSION -release_is_layered = False - -# GENERAL SETTINGS -comps_file = { - 'scm': 'git', - 'repo': COMPS_REPO, - 'branch': COMPS_BRANCH, - 'file': COMPS_FILE, - 'command': COMPS_COMMAND -} - -module_defaults_dir = { - 'scm': 'git', - 'repo': MODULE_DEFAULTS_REPO, - 'branch': MODULE_DEFAULTS_BRANCH, - 'dir': '.' -} - -variants_file = { - "scm": "VARIANTS_SCM", - "repo": VARIANTS_REPO, - "branch": VARIANTS_BRANCH, - "file": VARIANTS_FILE, -} - -# RUNROOT -runroot_channel = RUNROOT_CHANNEL -runroot_tag = RUNROOT_TAG - -# PKGSET -pkgset_koji_tag = PKGSET_KOJI_TAG -pkgset_koji_module_tag = PKGSET_KOJI_MODULE_TAG - -# Allow overriding any option defined here if needed. +from shared/all import * from fedora/override import * diff --git a/lorax.conf b/fedora/lorax.conf similarity index 100% rename from lorax.conf rename to fedora/lorax.conf diff --git a/fedora/override.conf b/fedora/override.conf index 175a2cb..83ce86e 100644 --- a/fedora/override.conf +++ b/fedora/override.conf @@ -24,7 +24,7 @@ pkgset_koji_builds = [ # No jigdo needed in Fedora. create_jigdo = False -# We only build repositories and installer in Fedora so far. +# We only build repositories, installer and images in Fedora so far. skip_phases = [ "createiso", "live_media", @@ -32,35 +32,6 @@ skip_phases = [ "ostree", "osbs", "extra_isos", - #"image_build" -] - -# Build installer only from BaseOS x86_64. -buildinstall_skip = [ - ('^BaseOS$', { - 'i386': True, - 'aarch64': True, - 'ppc64le': True, - 's390x': True - }), - ('^Everything$', { - 'i386': True, - 'aarch64': True, - 'ppc64le': True, - 's390x': True - }), - ("^(AppStream|CRB|ResilientStorage|HighAvailability|SAP|SAPHANA|RT|NFV)$", { - '*': True - }), -] - -# Everything contains everything. -additional_packages = [ - ('^Everything$', { - '*': [ - '*', - ], - }), ] # Enables macboot on x86_64 for all variants and disables upgrade image building @@ -75,7 +46,7 @@ lorax_options = [ 'noupgrade': True, 'rootfs_size': 3, # This is used to use ELN lorax templates instead of Fedora ones. - 'configuration_file': 'lorax.conf' + 'configuration_file': 'fedora/lorax.conf' } }) ] @@ -92,13 +63,6 @@ variant_as_lookaside = [ # source and "deps" method. # Generate gather_source.json on-the-fly using the prepopulate scm dict, # store it into /srv/odcs and use it from there. -gather_prepopulate = { - 'scm': 'git', - 'repo': "https://pagure.io/pungi-fedora.git", - 'branch': "eln", - 'file': "prepopulate.json", - 'command': "echo {} > prepopulate.json; ./content-resolver-to-gather-source-json; cp gather_source.json /srv/odcs" -} gather_source_mapping = "/srv/odcs/gather_source.json" gather_method = { @@ -112,10 +76,6 @@ gather_method = { # No product_id for Fedora. product_id_allow_missing = False -variants_file = "variants.xml" - - - # These will be inherited by live_media, live_images and image_build global_ksurl = 'git+https://pagure.io/fedora-kickstarts.git?#HEAD' global_release = '!RELEASE_FROM_LABEL_DATE_TYPE_RESPIN' diff --git a/fedora/variables.conf b/fedora/variables.conf index 1cccad6..f4b5f7b 100644 --- a/fedora/variables.conf +++ b/fedora/variables.conf @@ -23,9 +23,12 @@ VARIANTS_BRANCH = "eln" VARIANTS_FILE = "variants.xml" -GATHER_PREPOPULATE_REPO = None -GATHER_PREPOPULATE_BRANCH = None -GATHER_PREPOPULATE_FILE = None +# Generate gather_source.json on-the-fly using the prepopulate scm dict, +# store it into /srv/odcs and use it from there. +GATHER_PREPOPULATE_REPO = "https://pagure.io/pungi-fedora.git" +GATHER_PREPOPULATE_BRANCH = "eln" +GATHER_PREPOPULATE_FILE = "prepopulate.json" +GATHER_PREPOPULATE_COMMAND = "echo {} > prepopulate.json; ./content-resolver-to-gather-source-json; cp gather_source.json /srv/odcs" RUNROOT_CHANNEL = "compose" @@ -34,3 +37,10 @@ RUNROOT_TAG = "eln-build" PKGSET_KOJI_TAG = "eln" PKGSET_KOJI_MODULE_TAG = "eln-modular" + +EXTRA_BUILDINSTALL_SKIP = ('^BaseOS$', { + 'i386': True, + 'aarch64': True, + 'ppc64le': True, + 's390x': True +}) diff --git a/shared/additional_and_filter_packages.conf b/shared/additional_and_filter_packages.conf index 7cf8781..995ff2d 100644 --- a/shared/additional_and_filter_packages.conf +++ b/shared/additional_and_filter_packages.conf @@ -8,6 +8,24 @@ filter_packages = [ }), ] + +additional_packages = [ + # Everything contains everything. + ('^Everything$', { + '*': [ + '*', + ], + }), + ("^AppStream$", { + "*": [ + "cloud-init", + "cloud-utils-growpart", + "dnf-utils", + ] + }), +] + + # # filter_packages = [ # ("^(BaseOS|AppStream|HighAvailability|NFV|RT|ResilientStorage)$", { diff --git a/shared/all.conf b/shared/all.conf new file mode 100644 index 0000000..0536d05 --- /dev/null +++ b/shared/all.conf @@ -0,0 +1,10 @@ +from general import * +from multilib import * +from additional_and_filter_packages import * +from runroot import * +from pkgset import * +from gather import * +from createrepo import * +from createiso import * +from buildinstall import * +from lookaside import * diff --git a/shared/buildinstall.conf b/shared/buildinstall.conf index ec744f3..137d42d 100644 --- a/shared/buildinstall.conf +++ b/shared/buildinstall.conf @@ -8,10 +8,16 @@ lorax_options = [ }) ] -# Skip buildinstall for AppStream for all architectures buildinstall_skip = [ - ("^(AppStream|HighAvailability|ResilientStorage|RT|NFV|CRB|SAP|SAPHANA)$", { - "*": True + EXTRA_BUILDINSTALL_SKIP, + ('^Everything$', { + 'i386': True, + 'aarch64': True, + 'ppc64le': True, + 's390x': True + }), + ("^(AppStream|CRB|ResilientStorage|HighAvailability|SAP|SAPHANA|RT|NFV)$", { + '*': True }), ] diff --git a/shared/gather.conf b/shared/gather.conf index a035fa6..3f1bff1 100644 --- a/shared/gather.conf +++ b/shared/gather.conf @@ -12,3 +12,11 @@ gather_method = { hashed_directories = False gather_allow_reuse = True repoclosure_backend = 'dnf' + +gather_prepopulate = { + 'scm': 'git', + 'repo': GATHER_PREPOPULATE_REPO, + 'branch': GATHER_PREPOPULATE_BRANCH, + 'file': GATHER_PREPOPULATE_FILE, + 'command': GATHER_PREPOPULATE_COMMAND +} diff --git a/shared/general.conf b/shared/general.conf index 29e2e7b..167e149 100644 --- a/shared/general.conf +++ b/shared/general.conf @@ -1,3 +1,31 @@ +release_name = RELEASE_NAME +release_short = RELEASE_SHORT +release_version = RELEASE_VERSION +release_is_layered = False + link_type = "abspath-symlink" product_id_allow_missing = True productimg = False + + +comps_file = { + 'scm': 'git', + 'repo': COMPS_REPO, + 'branch': COMPS_BRANCH, + 'file': COMPS_FILE, + 'command': COMPS_COMMAND +} + +module_defaults_dir = { + 'scm': 'git', + 'repo': MODULE_DEFAULTS_REPO, + 'branch': MODULE_DEFAULTS_BRANCH, + 'dir': '.' +} + +variants_file = { + "scm": "git", + "repo": VARIANTS_REPO, + "branch": VARIANTS_BRANCH, + "file": VARIANTS_FILE, +} diff --git a/shared/pkgset.conf b/shared/pkgset.conf index 53946df..122143c 100644 --- a/shared/pkgset.conf +++ b/shared/pkgset.conf @@ -1 +1,3 @@ pkgset_source = "koji" +pkgset_koji_tag = PKGSET_KOJI_TAG +pkgset_koji_module_tag = PKGSET_KOJI_MODULE_TAG diff --git a/shared/runroot.conf b/shared/runroot.conf index fa66646..0fd5a94 100644 --- a/shared/runroot.conf +++ b/shared/runroot.conf @@ -5,3 +5,6 @@ global_runroot_method = "koji" runroot_method = { "createiso": "local" } + +runroot_channel = RUNROOT_CHANNEL +runroot_tag = RUNROOT_TAG diff --git a/shared/variables.conf b/shared/variables.conf new file mode 100644 index 0000000..0b9664a --- /dev/null +++ b/shared/variables.conf @@ -0,0 +1,31 @@ +global RELEASE_NAME +global RELEASE_SHORT +global RELEASE_VERSION +global PKGSET_KOJI_TAG +global PKGSET_KOJI_MODULE_TAG +global RUNROOT_CHANNEL +global RUNROOT_TAG +global RELEASE_VERSION +global RELEASE_VERSION_X +global RELEASE_VERSION_Y +global RELEASE_VERSION_Z +global RELEASE_VERSION_XY +global RELEASE_VERSION_XYZ +global COMPS_REPO +global COMPS_BRANCH +global COMPS_FILE +global COMPS_COMMAND +global MODULE_DEFAULTS_REPO +global MODULE_DEFAULTS_BRANCH +global VARIANTS_REPO +global VARIANTS_BRANCH +global VARIANTS_FILE +global GATHER_PREPOPULATE_REPO +global GATHER_PREPOPULATE_BRANCH +global GATHER_PREPOPULATE_FILE +global EXTRA_BUILDINSTALL_SKIP +EXTRA_BUILDINSTALL_SKIP = ("^$", {"*": False}) +global GATHER_PREPOPULATE_REPO +global GATHER_PREPOPULATE_BRANCH +global GATHER_PREPOPULATE_FILE +global GATHER_PREPOPULATE_COMMAND