Hello,
bitbake-setup currently doesn't support describing build pipelines: a
sequence of commands that actually produce something useful. For a
true end-to-end solution this gap should be filled.
Here's my proposal, which probably has obvious shortcomings, that I
would like to hear about :)
0. Design goals:
- something suitable for most situations, including newcomers running
a local build, and CI doing a nightly job
- avoid custom scripts in most situations
- self-documented; everything must be described
- extensible; if there's something missing that no one thought about,
it can be added later in a way that supplements existing features
without replacing them.
1. Specification in a build configuration would look like this:
"build-targets": {
"steps" : [
{ "name": "build-apple", "description": "Build an apple for
the purpose of making apple pie", "command": "bitbake apple-image"},
{ "name": "build-orange", "description": "Build an orange for
the purpose of making orange juice", "command": "bitbake
orange-image"},
{ "name": "test-apple", "description": "Test an apple using
testimage class", "command": "bitbake -c testimage apple-image"},
{ "name": "test-orange", "description": "Test an orange using
testimage class", "command": "bitbake -c testimage orange-image"},
{ "name": "qemu-console", "description": "Start the last built
image in qemu with console UI", "command": "runqemu kvm snapshot
nographic"},
{ "name": "publish", "description":"Copy build artefacts to a
public download server", "command":
"path/to/publish-image-executable"}
],
"pipelines": [
{"name": "publish-apple", "description": "Build, test, and
publish apple (requires publishing rights on the download server)",
"steps": ["build-apple", "test-apple", "publish"]},
{"name": "publish-orange", "description": "Build, test, and
publish orange (requires publishing rights on the download server)",
"steps": ["build-orange", "test-orange", "publish"]},
{"name": "qemu-apple", "description": "Build and start apple
in qemu with console UI", "steps": ["build-apple", "qemu-console"]},
{"name": "qemu-orange", "description": "Build and start orange
in qemu with console UI", "steps": ["build-orange", "qemu-console"]}
]
}
Configurations would include a list of possible pipelines:
"configurations": [
{
"name": "fruitgarden",
"description": "Alex's fruit garden",
"bb-layers": ["meta-fruit"],
"oe-fragments": [ "distro/fruit-garden", "machine/earth" ],
"pipelines": ["qemu-apple", "qemu-orange",
"publish-apple", "publish-orange"]
}
2. Nomenclature:
- "step" is a single command that is also given a short name and a
longer description. Steps are building blocks for pipelines and can't
be individually executed.
- "pipeline" is a sequence of steps, that is also given a short name
and a longer description. Pipelines can mix and match defined steps as
they please.
- each configuration includes a list of possible targets, and once it
is set up, any of them can be executed (see below for the UI).
3. User Interface to pipelines
Once there is a setup, there are two ways to execute a pipeline:
a) For each pipeline there is a shell script that can be run directly:
/path/to/bitbake-builds/fruitgarden/qemu-apple
/path/to/bitbake-builds/fruitgarden/publish-apple
etc.
qemu-apple script would look something like:
#!/bin/sh
# Build and start apple in qemu with console UI
. init-build-env
# Build an apple for the purpose of making apple pie
bitbake apple-image
# Start the last built image in qemu with console UI
runqemu kvm snapshot nographic
e.g. assembled from pipeline steps and their descriptions.
b) Interactive UI :'bitbake-setup build'
This would present an interactive UI similar to 'bitbake-setup init', e.g:
$ bitbake-setup build
Available build pipelines:
1. qemu-apple Build and start apple in qemu with console UI
2. qemu-orange Build and start orange in qemu with console UI
... etc
Please choose one of the above: 1
The following commands will be executed:
# Build an apple for the purpose of making apple pie
bitbake apple-image
# Start the last built image in qemu with console UI
runqemu kvm snapshot nographic
Proceed? [y/N]
etc.
4. Implementation
This should actually be fairly straightforward. There's no need to add
new features to bitbake (e.g. 'standard target definitions' in layers
was considered at some point, but after more consideration I think it
can be postponed or perhaps altogether avoided), or modify oe-core.
Alex
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#2324):
https://lists.openembedded.org/g/openembedded-architecture/message/2324
Mute This Topic: https://lists.openembedded.org/mt/119158252/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-architecture/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-