From a7053728922194f0393f04204b2ae31573e935fc Mon Sep 17 00:00:00 2001 From: Shivam Mehta Date: Fri, 7 Nov 2025 22:49:31 -0700 Subject: [PATCH 1/3] Allow multi-arch builds Signed-off-by: Shivam Mehta --- src/arguments.py | 32 +++++++++++++++++--- src/image-build | 2 +- src/layer.py | 79 ++++++++++++++++++++++++++++-------------------- src/publish.py | 46 ++++++++++++++++++++-------- 4 files changed, 108 insertions(+), 51 deletions(-) diff --git a/src/arguments.py b/src/arguments.py index 82e23ae..a8f6273 100644 --- a/src/arguments.py +++ b/src/arguments.py @@ -1,12 +1,13 @@ import os import logging +import platform def process_args(terminal_args, config_options): """ - Processes command line arguements and configuration options to generate a processed arguement dictionary + Processes command line arguments and configuration options to generate a processed argument dictionary Returns: - dict: Processed arguements dictionary + dict: Processed arguments dictionary """ processed_args = {} @@ -16,7 +17,7 @@ def process_args(terminal_args, config_options): processed_args['layer_type'] = terminal_args.layer_type or config_options.get('layer_type') if not processed_args['layer_type']: - raise ValueError("'layer_type' required in config file or as an arguement") + raise ValueError("'layer_type' required in config file or as an argument") if processed_args['layer_type'] == "base": processed_args['pkg_man'] = terminal_args.pkg_man or config_options.get('pkg_manager') @@ -69,6 +70,27 @@ def process_args(terminal_args, config_options): processed_args['scap_benchmark'] = terminal_args.scap_benchmark or config_options.get('scap_benchmark', False) processed_args['oval_eval'] = terminal_args.oval_eval or config_options.get('oval_eval', False) processed_args['install_scap'] = terminal_args.install_scap or config_options.get('install_scap', False) + + # If no architecture is passed, use "host" arch. + processed_args['architectures'] = terminal_args.arch or config_options.get('architectures', ['host']) + + # Map architectures to remove duplicates + if 'host' in processed_args['architectures']: + ind = processed_args['architectures'].index('host') + processed_args['architectures'][ind] = platform.machine().lower() + + arch_map = { + 'amd64': 'amd64', + 'x86_64': 'amd64', + 'arm64': 'arm64', + 'aarch64': 'arm64' + } + + mapped_archs = set(map(lambda x: arch_map.get(x), processed_args['architectures'])) + if None in mapped_archs: + raise ValueError("Only the following architectures are supported: x86_64/amd64, aarch64/arm64") + + processed_args['architectures'] = list(mapped_archs) # If no publish options were passed in either the CLI or the config file, store locally. if not (processed_args['publish_s3'] @@ -83,10 +105,10 @@ def process_args(terminal_args, config_options): def print_args(args): """ - Takes in a dictionary of arguements and prints them out + Takes in a dictionary of arguments and prints them out """ print() - logging.info("ARGUEMENTS".center(50, '-')) + logging.info("ARGUMENTS".center(50, '-')) for key, value in args.items(): # do not print credentials to output diff --git a/src/image-build b/src/image-build index da50852..e711168 100755 --- a/src/image-build +++ b/src/image-build @@ -43,7 +43,7 @@ def main(): parser.add_argument('--scap-benchmark', dest="scap_benchmark", action='store_true', required=False) parser.add_argument('--oval-eval', dest="oval_eval", action='store_true', required=False) parser.add_argument('--install-scap', dest="install_scap", action='store_true', required=False) - + parser.add_argument('--architectures', dest="arch", action='store', nargs='+', type=str, default=[], help='List of architectures, defaults to host architecture') try: terminal_args = parser.parse_args() diff --git a/src/layer.py b/src/layer.py index df02c14..da63f1c 100644 --- a/src/layer.py +++ b/src/layer.py @@ -17,7 +17,7 @@ def __init__(self, args, image_config): self.image_config = image_config self.logger = logging.getLogger(__name__) - def _build_base(self, repos, modules, packages, package_groups, remove_packages, commands, copyfiles, oscap_options): + def _build_base(self, repos, modules, packages, package_groups, remove_packages, commands, copyfiles, oscap_options, arch): # Set local variables dt_string = datetime.now().strftime("%Y%m%d%H%M%S") parent = self.args['parent'] @@ -39,7 +39,9 @@ def buildah_handler(line): # Create a new container from parent out = [] - cmd(["buildah", "from"] + registry_opts_pull + ["--name", container + dt_string, parent], stdout_handler = buildah_handler) + cmd(["buildah", "from"] + registry_opts_pull + + [f"--arch={arch}", "--name", container + dt_string, parent], + stdout_handler = buildah_handler) cname = out[0] # Only mount when doing a scratch install @@ -179,13 +181,15 @@ def buildah_handler(line): return cname - def _build_ansible(self, target, parent, ansible_groups, ansible_pb, ansible_inv, ansible_vars, ansible_verbosity): + def _build_ansible(self, target, parent, ansible_groups, ansible_pb, ansible_inv, ansible_vars, ansible_verbosity, arch): cnames = {} def buildah_handler(line): out.append(line) out = [] - cmd(["buildah","from"] + self.args['registry_opts_pull'] + ["--name", target, parent], stdout_handler = buildah_handler) + cmd(["buildah","from"] + self.args['registry_opts_pull'] + + [f"--arch={arch}","--name", target, parent], + stdout_handler = buildah_handler) container_name = out[0] cnames[container_name] = { @@ -206,33 +210,42 @@ def buildah_handler(line): def build_layer(self): print("BUILD LAYER".center(50, '-')) - if self.args['layer_type'] == "base": + for arch in self.args['architectures']: + if self.args['layer_type'] == "base": + + repos = self.image_config.get_repos() + modules = self.image_config.get_modules() + packages = self.image_config.get_packages() + package_groups = self.image_config.get_package_groups() + remove_packages = self.image_config.get_remove_packages() + commands = self.image_config.get_commands() + copyfiles = self.image_config.get_copy_files() + oscap_options = self.image_config.get_oscap_options() + + cname = self._build_base(repos, modules, packages, package_groups, remove_packages, commands, copyfiles, oscap_options, arch) + elif self.args['layer_type'] == "ansible": + layer_name = self.args['name'] + print("Layer_Name =", layer_name) + parent = self.args['parent'] + ansible_groups = self.args['ansible_groups'] + ansible_pb = self.args['ansible_pb'] + ansible_inv = self.args['ansible_inv'] + ansible_vars = self.args['ansible_vars'] + ansible_verbosity = self.args['ansible_verbosity'] + + cname = self._build_ansible(layer_name, parent, ansible_groups, ansible_pb, ansible_inv, ansible_vars, ansible_verbosity, arch) + else: + self.logger.error("Unrecognized layer type") + sys.exit("Exiting now ...") - repos = self.image_config.get_repos() - modules = self.image_config.get_modules() - packages = self.image_config.get_packages() - package_groups = self.image_config.get_package_groups() - remove_packages = self.image_config.get_remove_packages() - commands = self.image_config.get_commands() - copyfiles = self.image_config.get_copy_files() - oscap_options = self.image_config.get_oscap_options() - - cname = self._build_base(repos, modules, packages, package_groups, remove_packages, commands, copyfiles, oscap_options) - elif self.args['layer_type'] == "ansible": - layer_name = self.args['name'] - print("Layer_Name =", layer_name) - parent = self.args['parent'] - ansible_groups = self.args['ansible_groups'] - ansible_pb = self.args['ansible_pb'] - ansible_inv = self.args['ansible_inv'] - ansible_vars = self.args['ansible_vars'] - ansible_verbosity = self.args['ansible_verbosity'] - - cname = self._build_ansible(layer_name, parent, ansible_groups, ansible_pb, ansible_inv, ansible_vars, ansible_verbosity) - else: - self.logger.error("Unrecognized layer type") - sys.exit("Exiting now ...") - - # Publish the layer - self.logger.info("Publishing Layer") - publish(cname, self.args) + # Publish the layer + self.logger.info("Publishing Layer") + publish(cname, self.args, arch) + + # Manifest Push + publish_tags = self.args['publish_tags'] + tags = publish_tags if isinstance(publish_tags, list) else [publish_tags] + for tag in tags: + manifest_name = f"{self.args['publish_registry']}/{self.args['name']}:{tag}" + print("pushing manifest " + manifest_name) + cmd(["buildah", "manifest", "push", "--all"] + self.args['registry_opts_push'] + [manifest_name, f"docker://{manifest_name}"]) diff --git a/src/publish.py b/src/publish.py index ffff8ee..d055f46 100644 --- a/src/publish.py +++ b/src/publish.py @@ -7,7 +7,7 @@ from utils import cmd, get_os import logging -def _generate_labels(args): +def _generate_labels(args, arch): """Generate standard labels from configuration data""" labels = {} @@ -19,6 +19,7 @@ def _generate_labels(args): labels['org.openchami.image.name'] = args['name'] labels['org.openchami.image.type'] = args['layer_type'] labels['org.openchami.image.parent'] = args['parent'] + labels['org.openchami.image.arch'] = arch if 'pkg_man' in args: labels['org.openchami.image.package-manager'] = args['pkg_man'] @@ -45,7 +46,7 @@ def _generate_labels(args): return labels -def publish(cname, args): +def publish(cname, args, arch): layer_name = args['name'] publish_tags = args['publish_tags'] @@ -57,7 +58,7 @@ def publish(cname, args): # Generate standard labels print("Generating labels") - labels = _generate_labels(args) + labels = _generate_labels(args, arch) print("Labels: " + str(labels)) if args['publish_local']: @@ -69,36 +70,38 @@ def publish(cname, args): for key, value in labels.items(): label_args.extend(['--label', f'{key}={value}']) cmd(["buildah", "config"] + label_args + [cname], stderr_handler=logging.warn) - cmd(["buildah","commit", cname, layer_name+':'+tag], stderr_handler=logging.warn) + cmd(["buildah","commit", cname, layer_name+':'+tag+'-'+arch], stderr_handler=logging.warn) if args['publish_s3']: s3_prefix = args['s3_prefix'] s3_bucket = args['s3_bucket'] print("Publishing to S3 at " + s3_bucket) for tag in publish_tags: - s3_push(cname, layer_name, credentials, tag, s3_prefix, s3_bucket) + updated_tag = f'{tag}-{arch}' + s3_push(cname, layer_name, credentials, updated_tag, s3_prefix, s3_bucket) if args['publish_registry']: registry_opts = args['registry_opts_push'] publish_dest = args['publish_registry'] print("Publishing to registry at " + publish_dest) image_name = layer_name+':'+publish_tags[0] + # Add labels if they exist if labels: label_args = [] for key, value in labels.items(): label_args.extend(['--label', f'{key}={value}']) cmd(["buildah", "config"] + label_args + [cname], stderr_handler=logging.warn) - cmd(["buildah", "commit", cname, image_name], stderr_handler=logging.warn) + cmd(["buildah", "commit", cname, f'{image_name}-{arch}'], stderr_handler=logging.warn) for tag in publish_tags: - cmd(["buildah", "tag", image_name, layer_name+':'+tag], stderr_handler=logging.warn) - registry_push(layer_name, registry_opts, tag, publish_dest) + cmd(["buildah", "tag", f'{image_name}-{arch}', layer_name+':'+f'{tag}-{arch}'], stderr_handler=logging.warn) + registry_push(layer_name, registry_opts, tag, publish_dest, arch) # Clean up cmd(["buildah", "rm", cname], stderr_handler=logging.warn) if not args['publish_local'] and args['publish_registry']: for tag in publish_tags: - cmd(["buildah","rmi", layer_name+':'+tag], stderr_handler=logging.warn) + cmd(["buildah","rmi", layer_name+':'+f'{tag}-{arch}'], stderr_handler=logging.warn) if not parent == "scratch": cmd(["buildah", "rmi", parent], stderr_handler=logging.warn) @@ -175,8 +178,27 @@ def buildah_handler(line): push_file(mdir+'/boot/'+vmlinuz, 'efi-images/' + s3_prefix + vmlinuz, s3, s3_bucket) push_file(tmpdir + '/rootfs', image_name, s3, s3_bucket) -def registry_push(layer_name, registry_opts, publish_tags, registry_endpoint): +def registry_push(layer_name, registry_opts, publish_tags, registry_endpoint, arch): image_name = layer_name+':'+publish_tags - print("pushing layer " + layer_name + " to " + registry_endpoint +'/'+image_name) - args = registry_opts + [image_name, registry_endpoint +'/'+image_name] + print("pushing layer " + layer_name + " to " + registry_endpoint +'/'+f'{image_name}-{arch}') + args = registry_opts + [f'{image_name}-{arch}', registry_endpoint +'/'+f'{image_name}-{arch}'] cmd(["buildah", "push"] + args, stderr_handler=logging.warn) + + + # Create a manifest if it does not exist + manifest_name = f"{registry_endpoint}/{image_name}" + + inspect_cmd = ["buildah", "manifest", "exists", manifest_name] + if not manifest_check(inspect_cmd): + cmd(["buildah", "manifest", "create"] + registry_opts + [manifest_name], stderr_handler=logging.warn) + + # Update manifest and push + manifest_add_args = registry_opts + [manifest_name, f"docker://{manifest_name}-{arch}"] + cmd(["buildah", "manifest", "add"] + manifest_add_args, stderr_handler=logging.warn) + +def manifest_check(inspect_cmd): + try: + cmd(inspect_cmd) + return True + except Exception: + return False \ No newline at end of file From 55b2551e5e58e2c02cc6aac6e8d7d8ea210dafac Mon Sep 17 00:00:00 2001 From: Shivam Mehta Date: Mon, 10 Nov 2025 13:48:52 -0700 Subject: [PATCH 2/3] Remove multi-arch args and setup for S3 and local repos Signed-off-by: Shivam Mehta --- src/arguments.py | 21 +------------ src/image-build | 1 - src/layer.py | 79 ++++++++++++++++++++---------------------------- src/publish.py | 35 ++++++++++++--------- 4 files changed, 55 insertions(+), 81 deletions(-) diff --git a/src/arguments.py b/src/arguments.py index a8f6273..63e5213 100644 --- a/src/arguments.py +++ b/src/arguments.py @@ -70,27 +70,8 @@ def process_args(terminal_args, config_options): processed_args['scap_benchmark'] = terminal_args.scap_benchmark or config_options.get('scap_benchmark', False) processed_args['oval_eval'] = terminal_args.oval_eval or config_options.get('oval_eval', False) processed_args['install_scap'] = terminal_args.install_scap or config_options.get('install_scap', False) - - # If no architecture is passed, use "host" arch. - processed_args['architectures'] = terminal_args.arch or config_options.get('architectures', ['host']) - # Map architectures to remove duplicates - if 'host' in processed_args['architectures']: - ind = processed_args['architectures'].index('host') - processed_args['architectures'][ind] = platform.machine().lower() - - arch_map = { - 'amd64': 'amd64', - 'x86_64': 'amd64', - 'arm64': 'arm64', - 'aarch64': 'arm64' - } - - mapped_archs = set(map(lambda x: arch_map.get(x), processed_args['architectures'])) - if None in mapped_archs: - raise ValueError("Only the following architectures are supported: x86_64/amd64, aarch64/arm64") - - processed_args['architectures'] = list(mapped_archs) + processed_args['architecture'] = platform.machine().lower() # If no publish options were passed in either the CLI or the config file, store locally. if not (processed_args['publish_s3'] diff --git a/src/image-build b/src/image-build index e711168..a763434 100755 --- a/src/image-build +++ b/src/image-build @@ -43,7 +43,6 @@ def main(): parser.add_argument('--scap-benchmark', dest="scap_benchmark", action='store_true', required=False) parser.add_argument('--oval-eval', dest="oval_eval", action='store_true', required=False) parser.add_argument('--install-scap', dest="install_scap", action='store_true', required=False) - parser.add_argument('--architectures', dest="arch", action='store', nargs='+', type=str, default=[], help='List of architectures, defaults to host architecture') try: terminal_args = parser.parse_args() diff --git a/src/layer.py b/src/layer.py index da63f1c..df02c14 100644 --- a/src/layer.py +++ b/src/layer.py @@ -17,7 +17,7 @@ def __init__(self, args, image_config): self.image_config = image_config self.logger = logging.getLogger(__name__) - def _build_base(self, repos, modules, packages, package_groups, remove_packages, commands, copyfiles, oscap_options, arch): + def _build_base(self, repos, modules, packages, package_groups, remove_packages, commands, copyfiles, oscap_options): # Set local variables dt_string = datetime.now().strftime("%Y%m%d%H%M%S") parent = self.args['parent'] @@ -39,9 +39,7 @@ def buildah_handler(line): # Create a new container from parent out = [] - cmd(["buildah", "from"] + registry_opts_pull + - [f"--arch={arch}", "--name", container + dt_string, parent], - stdout_handler = buildah_handler) + cmd(["buildah", "from"] + registry_opts_pull + ["--name", container + dt_string, parent], stdout_handler = buildah_handler) cname = out[0] # Only mount when doing a scratch install @@ -181,15 +179,13 @@ def buildah_handler(line): return cname - def _build_ansible(self, target, parent, ansible_groups, ansible_pb, ansible_inv, ansible_vars, ansible_verbosity, arch): + def _build_ansible(self, target, parent, ansible_groups, ansible_pb, ansible_inv, ansible_vars, ansible_verbosity): cnames = {} def buildah_handler(line): out.append(line) out = [] - cmd(["buildah","from"] + self.args['registry_opts_pull'] + - [f"--arch={arch}","--name", target, parent], - stdout_handler = buildah_handler) + cmd(["buildah","from"] + self.args['registry_opts_pull'] + ["--name", target, parent], stdout_handler = buildah_handler) container_name = out[0] cnames[container_name] = { @@ -210,42 +206,33 @@ def buildah_handler(line): def build_layer(self): print("BUILD LAYER".center(50, '-')) - for arch in self.args['architectures']: - if self.args['layer_type'] == "base": - - repos = self.image_config.get_repos() - modules = self.image_config.get_modules() - packages = self.image_config.get_packages() - package_groups = self.image_config.get_package_groups() - remove_packages = self.image_config.get_remove_packages() - commands = self.image_config.get_commands() - copyfiles = self.image_config.get_copy_files() - oscap_options = self.image_config.get_oscap_options() - - cname = self._build_base(repos, modules, packages, package_groups, remove_packages, commands, copyfiles, oscap_options, arch) - elif self.args['layer_type'] == "ansible": - layer_name = self.args['name'] - print("Layer_Name =", layer_name) - parent = self.args['parent'] - ansible_groups = self.args['ansible_groups'] - ansible_pb = self.args['ansible_pb'] - ansible_inv = self.args['ansible_inv'] - ansible_vars = self.args['ansible_vars'] - ansible_verbosity = self.args['ansible_verbosity'] - - cname = self._build_ansible(layer_name, parent, ansible_groups, ansible_pb, ansible_inv, ansible_vars, ansible_verbosity, arch) - else: - self.logger.error("Unrecognized layer type") - sys.exit("Exiting now ...") + if self.args['layer_type'] == "base": - # Publish the layer - self.logger.info("Publishing Layer") - publish(cname, self.args, arch) - - # Manifest Push - publish_tags = self.args['publish_tags'] - tags = publish_tags if isinstance(publish_tags, list) else [publish_tags] - for tag in tags: - manifest_name = f"{self.args['publish_registry']}/{self.args['name']}:{tag}" - print("pushing manifest " + manifest_name) - cmd(["buildah", "manifest", "push", "--all"] + self.args['registry_opts_push'] + [manifest_name, f"docker://{manifest_name}"]) + repos = self.image_config.get_repos() + modules = self.image_config.get_modules() + packages = self.image_config.get_packages() + package_groups = self.image_config.get_package_groups() + remove_packages = self.image_config.get_remove_packages() + commands = self.image_config.get_commands() + copyfiles = self.image_config.get_copy_files() + oscap_options = self.image_config.get_oscap_options() + + cname = self._build_base(repos, modules, packages, package_groups, remove_packages, commands, copyfiles, oscap_options) + elif self.args['layer_type'] == "ansible": + layer_name = self.args['name'] + print("Layer_Name =", layer_name) + parent = self.args['parent'] + ansible_groups = self.args['ansible_groups'] + ansible_pb = self.args['ansible_pb'] + ansible_inv = self.args['ansible_inv'] + ansible_vars = self.args['ansible_vars'] + ansible_verbosity = self.args['ansible_verbosity'] + + cname = self._build_ansible(layer_name, parent, ansible_groups, ansible_pb, ansible_inv, ansible_vars, ansible_verbosity) + else: + self.logger.error("Unrecognized layer type") + sys.exit("Exiting now ...") + + # Publish the layer + self.logger.info("Publishing Layer") + publish(cname, self.args) diff --git a/src/publish.py b/src/publish.py index d055f46..851f3c2 100644 --- a/src/publish.py +++ b/src/publish.py @@ -7,7 +7,7 @@ from utils import cmd, get_os import logging -def _generate_labels(args, arch): +def _generate_labels(args): """Generate standard labels from configuration data""" labels = {} @@ -19,7 +19,7 @@ def _generate_labels(args, arch): labels['org.openchami.image.name'] = args['name'] labels['org.openchami.image.type'] = args['layer_type'] labels['org.openchami.image.parent'] = args['parent'] - labels['org.openchami.image.arch'] = arch + labels['org.openchami.image.arch'] = args['architecture'] if 'pkg_man' in args: labels['org.openchami.image.package-manager'] = args['pkg_man'] @@ -46,7 +46,7 @@ def _generate_labels(args, arch): return labels -def publish(cname, args, arch): +def publish(cname, args): layer_name = args['name'] publish_tags = args['publish_tags'] @@ -58,7 +58,7 @@ def publish(cname, args, arch): # Generate standard labels print("Generating labels") - labels = _generate_labels(args, arch) + labels = _generate_labels(args) print("Labels: " + str(labels)) if args['publish_local']: @@ -70,19 +70,22 @@ def publish(cname, args, arch): for key, value in labels.items(): label_args.extend(['--label', f'{key}={value}']) cmd(["buildah", "config"] + label_args + [cname], stderr_handler=logging.warn) - cmd(["buildah","commit", cname, layer_name+':'+tag+'-'+arch], stderr_handler=logging.warn) + cmd(["buildah","commit", cname, layer_name+':'+tag], stderr_handler=logging.warn) + + image_name = layer_name+':'+tag + if args['publish_s3']: s3_prefix = args['s3_prefix'] s3_bucket = args['s3_bucket'] print("Publishing to S3 at " + s3_bucket) for tag in publish_tags: - updated_tag = f'{tag}-{arch}' - s3_push(cname, layer_name, credentials, updated_tag, s3_prefix, s3_bucket) + s3_push(cname, layer_name, credentials, tag, s3_prefix, s3_bucket) if args['publish_registry']: registry_opts = args['registry_opts_push'] publish_dest = args['publish_registry'] + arch = args['architecture'] print("Publishing to registry at " + publish_dest) image_name = layer_name+':'+publish_tags[0] @@ -179,22 +182,26 @@ def buildah_handler(line): push_file(tmpdir + '/rootfs', image_name, s3, s3_bucket) def registry_push(layer_name, registry_opts, publish_tags, registry_endpoint, arch): + + # Push boot image to registry image_name = layer_name+':'+publish_tags - print("pushing layer " + layer_name + " to " + registry_endpoint +'/'+f'{image_name}-{arch}') + print("Pushing layer " + layer_name + " to " + registry_endpoint +'/'+f'{image_name}-{arch}') args = registry_opts + [f'{image_name}-{arch}', registry_endpoint +'/'+f'{image_name}-{arch}'] cmd(["buildah", "push"] + args, stderr_handler=logging.warn) - - # Create a manifest if it does not exist + # Create a tmp manifest manifest_name = f"{registry_endpoint}/{image_name}" - - inspect_cmd = ["buildah", "manifest", "exists", manifest_name] - if not manifest_check(inspect_cmd): - cmd(["buildah", "manifest", "create"] + registry_opts + [manifest_name], stderr_handler=logging.warn) + cmd(["buildah", "manifest", "create"] + registry_opts + [manifest_name], stderr_handler=logging.warn) # Update manifest and push manifest_add_args = registry_opts + [manifest_name, f"docker://{manifest_name}-{arch}"] cmd(["buildah", "manifest", "add"] + manifest_add_args, stderr_handler=logging.warn) + + print(f"Pushing manifest {manifest_name}") + cmd(["buildah", "manifest", "push", "--all"] + registry_opts + [manifest_name, f"docker://{manifest_name}"]) + + print(f"Manifest pushed. Removing local manifest {manifest_name}") + cmd(["buildah", "manifest", "rm", manifest_name]) def manifest_check(inspect_cmd): try: From 1175ffd8f814e6b372e39221a59fdcfa9fb2873a Mon Sep 17 00:00:00 2001 From: Shivam Mehta Date: Mon, 24 Nov 2025 16:20:52 -0700 Subject: [PATCH 3/3] Remove redundant function Signed-off-by: Shivam Mehta --- src/publish.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/publish.py b/src/publish.py index 851f3c2..9a17d14 100644 --- a/src/publish.py +++ b/src/publish.py @@ -201,11 +201,4 @@ def registry_push(layer_name, registry_opts, publish_tags, registry_endpoint, ar cmd(["buildah", "manifest", "push", "--all"] + registry_opts + [manifest_name, f"docker://{manifest_name}"]) print(f"Manifest pushed. Removing local manifest {manifest_name}") - cmd(["buildah", "manifest", "rm", manifest_name]) - -def manifest_check(inspect_cmd): - try: - cmd(inspect_cmd) - return True - except Exception: - return False \ No newline at end of file + cmd(["buildah", "manifest", "rm", manifest_name]) \ No newline at end of file