Introduce runners
We've been using a generic `osbuild-run`, which sets up the build environment (and works around bugs) for all build roots. It is already getting unwieldy, because it tries to detect the OS for some things it configures. It's also about to cause problems for RHEL, which doesn't currently support a python3 shebang without having /etc around. This patch changes the `build` key in a pipeline to not be a pipeline itself, but an object with `runner` and `pipeline` keys. `pipeline` is the build pipeline, as before. `runner` is the name of the runner to use. Runners are programs in the `runners` subdirectory. Three runners are included in this patch. They're copies of osbuild-run for now (except some additions for rhel82). The idea is that each of them only contains the minimal setup code necessary for an OS, and that we can review what's needed when updating a build root. Also modify the `--build-pipeline` command line switch to accept such a build object (instead of a pipeline) and rename it accordingly, to `--build-env`. Correspondingly, `OSBUILD_TEST_BUILD_PIPELINE` → `OSBUILD_TEST_BUILD_ENV`.
This commit is contained in:
parent
616e1ecbba
commit
64713449ce
38 changed files with 969 additions and 498 deletions
|
|
@ -14,8 +14,8 @@ def main():
|
|||
parser = argparse.ArgumentParser(description="Build operating system images")
|
||||
parser.add_argument("pipeline_path", metavar="PIPELINE",
|
||||
help="json file containing the pipeline that should be built, or a '-' to read from stdin")
|
||||
parser.add_argument("--build-pipeline", metavar="PIPELINE", type=os.path.abspath,
|
||||
help="json file containing the pipeline to create a build environment")
|
||||
parser.add_argument("--build-env", metavar="ENV", type=os.path.abspath,
|
||||
help="json file containing a description of the build environment")
|
||||
parser.add_argument("--store", metavar="DIRECTORY", type=os.path.abspath,
|
||||
default=".osbuild",
|
||||
help="the directory where intermediary os trees are stored")
|
||||
|
|
@ -32,10 +32,10 @@ def main():
|
|||
pipeline = osbuild.load(json.load(f))
|
||||
f.close()
|
||||
|
||||
if args.build_pipeline:
|
||||
with open(args.build_pipeline) as f:
|
||||
build = osbuild.load(json.load(f))
|
||||
pipeline.prepend_build_pipeline(build)
|
||||
if args.build_env:
|
||||
with open(args.build_env) as f:
|
||||
build_pipeline, runner = osbuild.load_build(json.load(f))
|
||||
pipeline.prepend_build_env(build_pipeline, runner)
|
||||
|
||||
try:
|
||||
pipeline.run(args.store, interactive=not args.json, libdir=args.libdir)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue