diff --git a/build-args-c10s.conf b/build-args-c10s.conf index f09457c..39705a8 100644 --- a/build-args-c10s.conf +++ b/build-args-c10s.conf @@ -1,10 +1,15 @@ # Variant-specific build arguments. # Pass to buildah/podman using `--build-arg-file`. +ID=centos NAME=scos -VERSION="10.0" +STREAM=c10s +DESCRIPTION=CentOS Stream CoreOS 10 +VERSION=10.0 +MUTATE_OS_RELEASE=10 BUILDER_IMG=quay.io/centos-bootc/centos-bootc:stream10 MANIFEST=manifest-c10s.yaml +IMAGE_CONFIG=image-c10s.yaml +BUILD_ARGS=build-args-c10s.conf # XXX: see inject_passwd_group() in build-rootfs PASSWD_GROUP_DIR=. -STREAM=c10s diff --git a/build-args-c9s.conf b/build-args-c9s.conf index 69c11bf..3bc703f 100644 --- a/build-args-c9s.conf +++ b/build-args-c9s.conf @@ -1,10 +1,15 @@ # Variant-specific build arguments. # Pass to buildah/podman using `--build-arg-file`. +ID=centos NAME=scos -VERSION="9.0" +STREAM=c9s +DESCRIPTION=CentOS Stream CoreOS 9 +VERSION=9.0 +MUTATE_OS_RELEASE=9 BUILDER_IMG=quay.io/centos-bootc/centos-bootc:stream9 MANIFEST=manifest-c9s.yaml +IMAGE_CONFIG=image-c9s.yaml +BUILD_ARGS=build-args-c9s.conf # XXX: see inject_passwd_group() in build-rootfs PASSWD_GROUP_DIR=. -STREAM=c9s diff --git a/build-args-rhel-10.1.conf b/build-args-rhel-10.1.conf index 69884e8..38463d7 100644 --- a/build-args-rhel-10.1.conf +++ b/build-args-rhel-10.1.conf @@ -1,10 +1,15 @@ # Variant-specific build arguments. # Pass to buildah/podman using `--build-arg-file`. +ID=rhel NAME=rhcos -VERSION="10.1" +STREAM=rhel-10.1 +DESCRIPTION=RHEL CoreOS 10.1 +VERSION=10.1 +MUTATE_OS_RELEASE=10.1 BUILDER_IMG=registry.redhat.io/rhel10/rhel-bootc:10.1 MANIFEST=manifest-rhel-10.1.yaml +IMAGE_CONFIG=image-rhel-10.1.yaml +BUILD_ARGS=build-args-rhel-10.1.conf # XXX: see inject_passwd_group() in build-rootfs PASSWD_GROUP_DIR=. -STREAM=rhel-10.1 diff --git a/build-args-rhel-9.8.conf b/build-args-rhel-9.8.conf index c998252..73882b8 100644 --- a/build-args-rhel-9.8.conf +++ b/build-args-rhel-9.8.conf @@ -1,10 +1,15 @@ # Variant-specific build arguments. # Pass to buildah/podman using `--build-arg-file`. +ID=rhel NAME=rhcos -VERSION="9.8" +STREAM=rhel-9.8 +DESCRIPTION=RHEL CoreOS 9.8 +VERSION=9.8 +MUTATE_OS_RELEASE=9.8 BUILDER_IMG=registry.stage.redhat.io/rhel9/rhel-bootc:9.8 MANIFEST=manifest-rhel-9.8.yaml +IMAGE_CONFIG=image-rhel-9.8.yaml +BUILD_ARGS=build-args-rhel-9.8.conf # XXX: see inject_passwd_group() in build-rootfs PASSWD_GROUP_DIR=. -STREAM=rhel-9.8 diff --git a/common.yaml b/common.yaml index f0fb2c5..9a569cf 100644 --- a/common.yaml +++ b/common.yaml @@ -359,7 +359,3 @@ packages-aarch64: packages-s390x: # Required genprotimg for IBM Secure Execution - s390utils-base - -remove-from-packages: - - - filesystem - - "/usr/share/backgrounds" diff --git a/manifest-c9s.yaml b/manifest-c9s.yaml index a9e553a..f852489 100644 --- a/manifest-c9s.yaml +++ b/manifest-c9s.yaml @@ -1,13 +1,8 @@ # Manifest for CentOS Stream CoreOS 9 metadata: - license: MIT - name: scos - summary: CentOS Stream CoreOS 9 - -variables: - id: "centos" - osversion: "centos-9" + # tell `cosa build` to default to buildah path + build_with_buildah: true # Include manifests common to all RHEL and CentOS Stream versions include: @@ -18,12 +13,6 @@ repos: - c9s-appstream - c9s-extras-common -automatic-version-prefix: "9.0." -# This ensures we're semver-compatible which OpenShift wants -automatic-version-suffix: "-" - -mutate-os-release: "9" - packages: - centos-stream-release - centos-release-cloud-common diff --git a/versionary b/versionary deleted file mode 100755 index 9c74b6a..0000000 --- a/versionary +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/python3 -u - -''' - Implements versioning for RHEL CoreOS and CentOS Stream CoreOS. Initially based - on the Fedora CoreOS versionary script. -''' - -import argparse -import json -import os -import re -import subprocess -import sys -import time -import yaml - -from datetime import datetime - - -def main(): - args = parse_args() - if args.workdir is not None: - os.chdir(args.workdir) - assert os.path.isdir('builds'), 'Missing builds/ dir' - - manifest = get_flattened_manifest() - - # we'll want to move the source of truth for this somewhere else in the future but for now... - prefix = manifest['automatic-version-prefix'] - placeholder = '' - assert placeholder in prefix - dt = datetime.now() - xyz = prefix.replace(placeholder, dt.strftime('%Y%m%d')) - x, y, z = map(int, xyz.split('.')) - n = get_next_iteration(x, y, z, args.last_version) - dev = '.dev' if args.dev else '' - - print(f'{xyz}-{n}{dev}') - - -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument('--workdir', help="path to cosa workdir") - parser.add_argument('--last-version', help="override last version (for testing)") - parser.add_argument('--dev', action='store_true', help="generate a developer version") - return parser.parse_args() - - -def get_next_iteration(x, y, z, last_version_override): - try: - with open('builds/builds.json') as f: - builds = json.load(f) - except FileNotFoundError: - builds = {'builds': []} - - if last_version_override is not None: - last_version = last_version_override - else: - if len(builds['builds']) == 0: - eprint("n: 0 (no previous builds)") - return 0 - - last_version = builds['builds'][0]['id'] - - last_version_tuple = parse_version(last_version) - - if not last_version_tuple: - eprint(f"n: 0 (previous version {last_version} does not match scheme)") - return 0 - - if (x, y, z) != last_version_tuple[:3]: - eprint(f"n: 0 (previous version {last_version} x.y.z does not match)") - return 0 - - n = last_version_tuple[3] + 1 - eprint(f"n: {n} (incremented from previous version {last_version})") - return n - - -def get_flattened_manifest(): - try: - with open('src/config.json') as f: - j = json.load(f) - variant = j["coreos-assembler.config-variant"] - manifest = f'src/config/manifest-{variant}.yaml' - except FileNotFoundError: - manifest = 'src/config/manifest.yaml' - return yaml.safe_load( - subprocess.check_output(['rpm-ostree', 'compose', 'tree', - '--print-only', manifest])) - - -def parse_version(version): - # since RHCOS/SCOS follows semver, we could actually instead use a library - # for this, but we do actually only expect a particular subset in our case - m = re.match(r'^([0-9]+)\.([0-9]+)\.([0-9]{8})-([0-9]+)(\.dev)?$', version) - if m is None: - return None - # sanity-check date - try: - time.strptime(m.group(3), '%Y%m%d') - except ValueError: - return None - return tuple(map(int, m.groups()[:4])) - - -def eprint(*args): - print(*args, file=sys.stderr) - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/versionary b/versionary new file mode 120000 index 0000000..ac7a956 --- /dev/null +++ b/versionary @@ -0,0 +1 @@ +fedora-coreos-config/versionary \ No newline at end of file