Request a Package Build¶
At this point the Cloud Builder backend is running and uses
https://github.com/OSInside/cloud-builder-packages
as the package source Git repository.
As a first example let’s build the xclock
package from
the MS
project as follows:
Login to the control plane
See Create and Install the Control Plane for details
Create a package build request via
cb-ctl
cb-ctl --build-package xclock --project-path MS \ --arch x86_64 --dist TW --runner-group suse
This will return with an information like the following:
[ INFO ]: 09:31:15 | Message successfully sent to: suse { "action": "package rebuild requested", "package": { "arch": "x86_64", "dist": "TW" }, "project": "projects/MS/xclock", "request_id": "e0adf9c6-1224-11ec-bdbe-06be1098538e", "runner_group": "suse", "schema_version": 0.2 }
Note
Any request to Cloud Builder services are identified through a reques_id in UUID format. It is recommended to filter output by that id. Otherwise all information available according to the configured retention time of the desired topic in Kafka will be returned.
Watch how the request runs through the Cloud Builder services
Each Cloud Builder service logs information into the global response queue. For reading the contents of this queue the
--watch
option is used as follows:cb-ctl --watch \ --filter-request-id b88becf6-f04f-11eb-8cff-06be1098538e \ --timeout 5
Note
Please be aware that any conversation with the Cloud Builder services are based on sending a message to the message broker followed by a subsequent lookup of information from the message broker. This polling of information always ends after a configurable timeout of inactivity. By default the timeout value is set to a safe long delay. Usually you set the timeout to a much smaller value to avoid boring wait periods.
A typical output from the above command could look like this
{ "identity": "CBScheduler:18.193.45.127:20028:xclock", "message": "Accept package build request", "project": "projects/MS/xclock", "request_id": "e0adf9c6-1224-11ec-bdbe-06be1098538e", "response_code": "package request accepted", "schema_version": 0.2, "target": { "arch": "x86_64", "dist": "TW" } } { "identity": "CBPrepare:18.193.45.127:25128:xclock", "message": "Buildroot ready for package build", "package_prepare": { "build_root": "/var/tmp/CB/projects/MS/xclock@TW.x86_64", "exit_code": 0, "prepare_log_file": "/var/tmp/CB/projects/MS/xclock@TW.x86_64.prepare.log", "solver_file": "/var/tmp/CB/projects/MS/xclock@TW.x86_64.solver.json" }, "project": "projects/MS/xclock", "request_id": "e0adf9c6-1224-11ec-bdbe-06be1098538e", "response_code": "build root setup succeeded", "schema_version": 0.2 } { "identity": "CBRun:18.193.45.127:25226:projects/MS/xclock", "message": "Package build finished", "package": { "binary_packages": [ "/var/tmp/CB/projects/MS/xclock@TW.x86_64/home/abuild/rpmbuild/RPMS/x86_64/xclock-1.0.9-0.x86_64.rpm", "/var/tmp/CB/projects/MS/xclock@TW.x86_64/home/abuild/rpmbuild/SRPMS/xclock-1.0.9-0.src.rpm" ], "exit_code": 0, "log_file": "/var/tmp/CB/projects/MS/xclock@TW.x86_64.build.log", "prepare_log_file": "/var/tmp/CB/projects/MS/xclock@TW.x86_64.prepare.log", "solver_file": "/var/tmp/CB/projects/MS/xclock@TW.x86_64.solver.json" }, "project": "projects/MS/xclock", "request_id": "e0adf9c6-1224-11ec-bdbe-06be1098538e", "response_code": "package build succeeded", "schema_version": 0.2 }
As you can see from this information there are the three Cloud Builder services
cb-scheduler
,cb-prepare
andcb-run
that worked on your package and built it.Fetch package binaries
For fetching the built binaries
cb-ctl
needs to be called as follows:cb-ctl --get-binaries xclock --project-path MS \ --arch x86_64 --dist TW --timeout 5 \ --target-dir my-xclock
Note
The above call actually created a request to the info request queue which will be read by any runner. It can happen that different runners has built the same package. The current implementation fetches the latest built binaries available in the backend.
This behavior is intentional and applies to all
cb-ctl
commands which fetches information from the system that are not connected to a specificrequest_id
Congrats, you should have picked out the first useful data from Cloud Builder. Learn how to automate certain parts of the system like it is explained in Auto Rebuild on Package Source Change or Auto Rebuild on Package Build Dependency Changes