|
|
|
@ -53,7 +53,7 @@ from . import util
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_jigdo_needed(conf):
|
|
|
|
|
return conf.get("create_jigdo", True)
|
|
|
|
|
return conf.get("create_jigdo")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_isohybrid_needed(conf):
|
|
|
|
@ -75,8 +75,7 @@ def is_isohybrid_needed(conf):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_genisoimage_needed(conf):
|
|
|
|
|
"""This is only needed locally for createiso without runroot.
|
|
|
|
|
"""
|
|
|
|
|
"""This is only needed locally for createiso without runroot."""
|
|
|
|
|
runroot_tag = conf.get("runroot_tag", "")
|
|
|
|
|
if runroot_tag or conf.get("createiso_use_xorrisofs"):
|
|
|
|
|
return False
|
|
|
|
@ -94,7 +93,7 @@ def is_xorrisofs_needed(conf):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_createrepo_c_needed(conf):
|
|
|
|
|
return conf.get("createrepo_c", True)
|
|
|
|
|
return conf.get("createrepo_c")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# The first element in the tuple is package name expected to have the
|
|
|
|
@ -230,7 +229,6 @@ def validate(config, offline=False, schema=None):
|
|
|
|
|
)
|
|
|
|
|
validator = DefaultValidator(
|
|
|
|
|
schema,
|
|
|
|
|
{"array": (tuple, list), "regex": six.string_types, "url": six.string_types},
|
|
|
|
|
)
|
|
|
|
|
errors = []
|
|
|
|
|
warnings = []
|
|
|
|
@ -446,6 +444,16 @@ def _extend_with_default_and_alias(validator_class, offline=False):
|
|
|
|
|
context=all_errors,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
def is_array(checker, instance):
|
|
|
|
|
return isinstance(instance, (tuple, list))
|
|
|
|
|
|
|
|
|
|
def is_string_type(checker, instance):
|
|
|
|
|
return isinstance(instance, six.string_types)
|
|
|
|
|
|
|
|
|
|
type_checker = validator_class.TYPE_CHECKER.redefine_many(
|
|
|
|
|
{"array": is_array, "regex": is_string_type, "url": is_string_type}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return jsonschema.validators.extend(
|
|
|
|
|
validator_class,
|
|
|
|
|
{
|
|
|
|
@ -456,6 +464,7 @@ def _extend_with_default_and_alias(validator_class, offline=False):
|
|
|
|
|
"additionalProperties": _validate_additional_properties,
|
|
|
|
|
"anyOf": _validate_any_of,
|
|
|
|
|
},
|
|
|
|
|
type_checker=type_checker,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -610,7 +619,7 @@ def make_schema():
|
|
|
|
|
"runroot_ssh_init_template": {"type": "string"},
|
|
|
|
|
"runroot_ssh_install_packages_template": {"type": "string"},
|
|
|
|
|
"runroot_ssh_run_template": {"type": "string"},
|
|
|
|
|
"create_jigdo": {"type": "boolean", "default": True},
|
|
|
|
|
"create_jigdo": {"type": "boolean", "default": False},
|
|
|
|
|
"check_deps": {"type": "boolean", "default": True},
|
|
|
|
|
"require_all_comps_packages": {"type": "boolean", "default": False},
|
|
|
|
|
"bootable": {
|
|
|
|
@ -654,6 +663,8 @@ def make_schema():
|
|
|
|
|
"gather_profiler": {"type": "boolean", "default": False},
|
|
|
|
|
"gather_allow_reuse": {"type": "boolean", "default": False},
|
|
|
|
|
"pkgset_allow_reuse": {"type": "boolean", "default": True},
|
|
|
|
|
"createiso_allow_reuse": {"type": "boolean", "default": True},
|
|
|
|
|
"extraiso_allow_reuse": {"type": "boolean", "default": True},
|
|
|
|
|
"pkgset_source": {"type": "string", "enum": ["koji", "repos"]},
|
|
|
|
|
"createrepo_c": {"type": "boolean", "default": True},
|
|
|
|
|
"createrepo_checksum": {
|
|
|
|
@ -661,6 +672,7 @@ def make_schema():
|
|
|
|
|
"default": "sha256",
|
|
|
|
|
"enum": ["sha1", "sha256", "sha512"],
|
|
|
|
|
},
|
|
|
|
|
"createrepo_enable_cache": {"type": "boolean", "default": True},
|
|
|
|
|
"createrepo_use_xz": {"type": "boolean", "default": False},
|
|
|
|
|
"createrepo_num_threads": {"type": "number", "default": get_num_cpus()},
|
|
|
|
|
"createrepo_num_workers": {"type": "number", "default": 3},
|
|
|
|
@ -722,6 +734,8 @@ def make_schema():
|
|
|
|
|
"minItems": 1,
|
|
|
|
|
"default": [None],
|
|
|
|
|
},
|
|
|
|
|
"signed_packages_retries": {"type": "number", "default": 0},
|
|
|
|
|
"signed_packages_wait": {"type": "number", "default": 30},
|
|
|
|
|
"variants_file": {"$ref": "#/definitions/str_or_scm_dict"},
|
|
|
|
|
"comps_file": {"$ref": "#/definitions/str_or_scm_dict"},
|
|
|
|
|
"comps_filter_environments": {"type": "boolean", "default": True},
|
|
|
|
@ -732,6 +746,7 @@ def make_schema():
|
|
|
|
|
"patternProperties": {".+": {"$ref": "#/definitions/strings"}},
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
},
|
|
|
|
|
"module_obsoletes_dir": {"$ref": "#/definitions/str_or_scm_dict"},
|
|
|
|
|
"create_optional_isos": {"type": "boolean", "default": False},
|
|
|
|
|
"symlink_isos_to": {"type": "string"},
|
|
|
|
|
"dogpile_cache_backend": {"type": "string"},
|
|
|
|
@ -744,6 +759,12 @@ def make_schema():
|
|
|
|
|
),
|
|
|
|
|
"createiso_break_hardlinks": {"type": "boolean", "default": False},
|
|
|
|
|
"createiso_use_xorrisofs": {"type": "boolean", "default": False},
|
|
|
|
|
"iso_level": {
|
|
|
|
|
"anyOf": [
|
|
|
|
|
{"type": "number", "enum": [1, 2, 3, 4]},
|
|
|
|
|
_variant_arch_mapping({"type": "number", "enum": [1, 2, 3, 4]}),
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
"iso_hfs_ppc64le_compatible": {"type": "boolean", "default": True},
|
|
|
|
|
"multilib": _variant_arch_mapping(
|
|
|
|
|
{"$ref": "#/definitions/list_of_strings"}
|
|
|
|
@ -785,6 +806,10 @@ def make_schema():
|
|
|
|
|
"buildinstall_kickstart": {"$ref": "#/definitions/str_or_scm_dict"},
|
|
|
|
|
"buildinstall_use_guestmount": {"type": "boolean", "default": True},
|
|
|
|
|
"buildinstall_skip": _variant_arch_mapping({"type": "boolean"}),
|
|
|
|
|
"buildinstall_packages": {
|
|
|
|
|
"$ref": "#/definitions/package_mapping",
|
|
|
|
|
"default": [],
|
|
|
|
|
},
|
|
|
|
|
"global_ksurl": {"type": "url"},
|
|
|
|
|
"global_version": {"type": "string"},
|
|
|
|
|
"global_target": {"type": "string"},
|
|
|
|
@ -976,6 +1001,7 @@ def make_schema():
|
|
|
|
|
"arches": {"$ref": "#/definitions/list_of_strings"},
|
|
|
|
|
"failable": {"$ref": "#/definitions/list_of_strings"},
|
|
|
|
|
"release": {"$ref": "#/definitions/optional_string"},
|
|
|
|
|
"nomacboot": {"type": "boolean"},
|
|
|
|
|
},
|
|
|
|
|
"required": ["name", "kickstart"],
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
@ -1009,6 +1035,7 @@ def make_schema():
|
|
|
|
|
},
|
|
|
|
|
"update_summary": {"type": "boolean"},
|
|
|
|
|
"force_new_commit": {"type": "boolean"},
|
|
|
|
|
"unified_core": {"type": "boolean"},
|
|
|
|
|
"version": {"type": "string"},
|
|
|
|
|
"config_branch": {"type": "string"},
|
|
|
|
|
"tag_ref": {"type": "boolean"},
|
|
|
|
@ -1043,6 +1070,7 @@ def make_schema():
|
|
|
|
|
"failable": {"$ref": "#/definitions/list_of_strings"},
|
|
|
|
|
"update_summary": {"type": "boolean"},
|
|
|
|
|
"force_new_commit": {"type": "boolean"},
|
|
|
|
|
"unified_core": {"type": "boolean"},
|
|
|
|
|
"version": {"type": "string"},
|
|
|
|
|
"config_branch": {"type": "string"},
|
|
|
|
|
"tag_ref": {"type": "boolean"},
|
|
|
|
@ -1072,6 +1100,7 @@ def make_schema():
|
|
|
|
|
"template_repo": {"type": "string"},
|
|
|
|
|
"template_branch": {"type": "string"},
|
|
|
|
|
"extra_runroot_pkgs": {"$ref": "#/definitions/list_of_strings"},
|
|
|
|
|
"skip_branding": {"type": "boolean"},
|
|
|
|
|
},
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
}
|
|
|
|
@ -1082,6 +1111,7 @@ def make_schema():
|
|
|
|
|
"live_images": _variant_arch_mapping(
|
|
|
|
|
_one_or_list({"$ref": "#/definitions/live_image_config"})
|
|
|
|
|
),
|
|
|
|
|
"image_build_allow_reuse": {"type": "boolean", "default": False},
|
|
|
|
|
"image_build": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"patternProperties": {
|
|
|
|
@ -1149,12 +1179,109 @@ def make_schema():
|
|
|
|
|
"version": {"type": "string"},
|
|
|
|
|
"distro": {"type": "string"},
|
|
|
|
|
"target": {"type": "string"},
|
|
|
|
|
"image_types": {"$ref": "#/definitions/strings"},
|
|
|
|
|
# Only a single image_type can be specified
|
|
|
|
|
# https://github.com/osbuild/koji-osbuild/commit/c7252650814f82281ee57b598cb2ad970b580451
|
|
|
|
|
# https://github.com/osbuild/koji-osbuild/commit/f21a2de39b145eb94f3d49cb4d8775a33ba56752
|
|
|
|
|
"image_types": {
|
|
|
|
|
"oneOf": [
|
|
|
|
|
{
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {"type": "string"},
|
|
|
|
|
"description": "Deprecated variant",
|
|
|
|
|
"minItems": 1,
|
|
|
|
|
"maxItems": 1,
|
|
|
|
|
},
|
|
|
|
|
{"type": "string"},
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"arches": {"$ref": "#/definitions/list_of_strings"},
|
|
|
|
|
"release": {"type": "string"},
|
|
|
|
|
"repo": {"$ref": "#/definitions/list_of_strings"},
|
|
|
|
|
"failable": {"$ref": "#/definitions/list_of_strings"},
|
|
|
|
|
"subvariant": {"type": "string"},
|
|
|
|
|
"ostree_url": {"type": "string"},
|
|
|
|
|
"ostree_ref": {"type": "string"},
|
|
|
|
|
"ostree_parent": {"type": "string"},
|
|
|
|
|
"upload_options": {
|
|
|
|
|
"oneOf": [
|
|
|
|
|
# AWSEC2UploadOptions
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
"required": [
|
|
|
|
|
"region",
|
|
|
|
|
"share_with_accounts",
|
|
|
|
|
],
|
|
|
|
|
"properties": {
|
|
|
|
|
"region": {
|
|
|
|
|
"type": "string",
|
|
|
|
|
},
|
|
|
|
|
"snapshot_name": {
|
|
|
|
|
"type": "string",
|
|
|
|
|
},
|
|
|
|
|
"share_with_accounts": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {"type": "string"},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
# AWSS3UploadOptions
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
"required": ["region"],
|
|
|
|
|
"properties": {
|
|
|
|
|
"region": {"type": "string"}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
# AzureUploadOptions
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
"required": [
|
|
|
|
|
"tenant_id",
|
|
|
|
|
"subscription_id",
|
|
|
|
|
"resource_group",
|
|
|
|
|
"location",
|
|
|
|
|
],
|
|
|
|
|
"properties": {
|
|
|
|
|
"tenant_id": {"type": "string"},
|
|
|
|
|
"subscription_id": {"type": "string"},
|
|
|
|
|
"resource_group": {"type": "string"},
|
|
|
|
|
"location": {"type": "string"},
|
|
|
|
|
"image_name": {
|
|
|
|
|
"type": "string",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
# GCPUploadOptions
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
"required": ["region", "bucket"],
|
|
|
|
|
"properties": {
|
|
|
|
|
"region": {"type": "string"},
|
|
|
|
|
"bucket": {"type": "string"},
|
|
|
|
|
"image_name": {
|
|
|
|
|
"type": "string",
|
|
|
|
|
},
|
|
|
|
|
"share_with_accounts": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {"type": "string"},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
# ContainerUploadOptions
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
"properties": {
|
|
|
|
|
"name": {"type": "string"},
|
|
|
|
|
"tag": {"type": "string"},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
"required": ["name", "distro", "image_types"],
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
@ -1203,6 +1330,7 @@ def make_schema():
|
|
|
|
|
"anyOf": [{"type": "string"}, {"type": "number"}],
|
|
|
|
|
"default": 10 * 1024 * 1024,
|
|
|
|
|
},
|
|
|
|
|
"osbs_allow_reuse": {"type": "boolean", "default": False},
|
|
|
|
|
"osbs": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"patternProperties": {
|
|
|
|
@ -1221,6 +1349,26 @@ def make_schema():
|
|
|
|
|
},
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
},
|
|
|
|
|
"image_container": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"patternProperties": {
|
|
|
|
|
".+": _one_or_list(
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"url": {"type": "url"},
|
|
|
|
|
"target": {"type": "string"},
|
|
|
|
|
"priority": {"type": "number"},
|
|
|
|
|
"failable": {"type": "boolean"},
|
|
|
|
|
"git_branch": {"type": "string"},
|
|
|
|
|
"image_spec": {"type": "object"},
|
|
|
|
|
},
|
|
|
|
|
"required": ["url", "target", "git_branch", "image_spec"],
|
|
|
|
|
}
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
"additionalProperties": False,
|
|
|
|
|
},
|
|
|
|
|
"extra_files": _variant_arch_mapping(
|
|
|
|
|
{
|
|
|
|
|
"type": "array",
|
|
|
|
@ -1325,6 +1473,7 @@ CONFIG_DEPS = {
|
|
|
|
|
"requires": ((lambda x: x, ["base_product_name", "base_product_short"]),),
|
|
|
|
|
"conflicts": ((lambda x: not x, ["base_product_name", "base_product_short"]),),
|
|
|
|
|
},
|
|
|
|
|
"cts_url": {"requires": ((lambda x: x, ["translate_paths"]),)},
|
|
|
|
|
"product_id": {"conflicts": [(lambda x: not x, ["product_id_allow_missing"])]},
|
|
|
|
|
"pkgset_scratch_modules": {"requires": ((lambda x: x, ["mbs_api_url"]),)},
|
|
|
|
|
"pkgset_source": {
|
|
|
|
|