Kata Containers is an open source project and community working to build a standard implementation of lightweight Virtual Machines (VMs) that feel and perform like containers, but provide the workload isolation and security advantages of VMs. https://katacontainers.io/
Apache License 2.0
5.08k
stars
1k
forks
source link
osbuilder: allow rootfs builds w/o git or version file deps #9824
osbuilder's rootfs build process which depends on version information files versions.yaml, VERSION, and on git to work properly
How can it be improved?
Reduce the dependencies so that we can leverage the tooling in environments outside of git where we want to compose the rootfs with minimal dependencies. In these environments, the versioning files may not be present as well. Such environment may potentially be an isolated environment in which one attempts to build the UVM/rootfs in more production-grade scenarios. In these cases we:
want no dependency to git. All relevant files/components for composing the rootfs are already packaged (e.g. via RPMs).
do not always intend to build the agent as it may already be pre-built, coming from another package. Hence we do not need to determine any rust versions.
The changes in the pull request 9825 prevent various errors from surfacing:
fatal: not a git repository (or any of the parent directories): .git - this happens when determining the COMMIT variable which fails outside of a git repository
grep: ./VERSION: No such file or directory - this happens when the build environment does not contain the VERSION file. This file is not needed per se.
cat: /<path>/<to>/versions.yaml: No such file or directory ERROR: Could not detect the required rust version for AGENT_VERSION='main'. - this happens when versions.yaml is not present and is caused by detect_rust_version. This check should only be carried out if we actually intend to build the agent (note: imo this check can be removed. The same function is called later at the proper place anyways).
Creating rootfs for cbl-mariner /<path>/<to>/tools/osbuilder/rootfs-builder/rootfs.sh -o -r /<path>/<to>/tools/osbuilder/cbl-mariner_rootfs cbl-mariner - note, the -o paramter is empty in this call. This causes the parse_arguments function in rootfs.sh to fail processing the proper distro parameter. Distro is erroneously populated with /<path>/<to>/tools/osbuilder/cbl-mariner_rootfs instead. By setting "unknown" for the VERSION variable in Makefile, this ensures that the -o parameter is always passed. unknown was chosen because this is the default assignment in rootf.sh
Which feature do you think can be improved?
osbuilder's rootfs build process which depends on version information files
versions.yaml
,VERSION
, and ongit
to work properlyHow can it be improved?
Reduce the dependencies so that we can leverage the tooling in environments outside of git where we want to compose the rootfs with minimal dependencies. In these environments, the versioning files may not be present as well. Such environment may potentially be an isolated environment in which one attempts to build the UVM/rootfs in more production-grade scenarios. In these cases we:
The changes in the pull request 9825 prevent various errors from surfacing:
fatal: not a git repository (or any of the parent directories): .git
- this happens when determining theCOMMIT
variable which fails outside of a git repositorygrep: ./VERSION: No such file or directory
- this happens when the build environment does not contain theVERSION
file. This file is not needed per se.cat: /<path>/<to>/versions.yaml: No such file or directory ERROR: Could not detect the required rust version for AGENT_VERSION='main'.
- this happens whenversions.yaml
is not present and is caused bydetect_rust_version
. This check should only be carried out if we actually intend to build the agent (note: imo this check can be removed. The same function is called later at the proper place anyways).Creating rootfs for cbl-mariner /<path>/<to>/tools/osbuilder/rootfs-builder/rootfs.sh -o -r /<path>/<to>/tools/osbuilder/cbl-mariner_rootfs cbl-mariner
- note, the-o
paramter is empty in this call. This causes theparse_arguments
function in rootfs.sh to fail processing the properdistro
parameter. Distro is erroneously populated with/<path>/<to>/tools/osbuilder/cbl-mariner_rootfs
instead. By setting "unknown" for theVERSION
variable in Makefile, this ensures that the-o
parameter is always passed.unknown
was chosen because this is the default assignment inrootf.sh