On Mon, Sep 21, 2026 at 11:14:54PM +0000, Pierrick Bouvier wrote: > We'll use this in next patch to switch FROM docker.io/library to > docker.io/amd64. It would not make sense to add a new target to > libvirt-ci for this, since it's just a variant of an existing target. > Simply replace container registry with arch specific one.
We shouldn't need to add new targets to lcitool for this, rather it would be enhanced to include a list of arch specific container images. eg in https://gitlab.com/libvirt/libvirt-ci/-/blob/master/lcitool/facts/targets/debian-13.yml?ref_type=heads We would extend: containers: base: docker.io/library/debian:13-slim to allow for containers: base: docker.io/library/debian:13-slim aarch64: docker.io/amd64/debian:13-slim ...more... such that we default to the 'base' image name, unless there is an arch specific name defined. That would be a fairly quick extension to impl in lcitool. > > Signed-off-by: Pierrick Bouvier <[email protected]> > --- > tests/lcitool/refresh | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) > > diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh > index 9a71af0e41d..4e3cbb81acf 100755 > --- a/tests/lcitool/refresh > +++ b/tests/lcitool/refresh > @@ -12,6 +12,7 @@ > # or (at your option) any later version. See the COPYING file in > # the top-level directory. > > +import re > import sys > import subprocess > > @@ -41,7 +42,7 @@ def atomic_write(filename, content): > raise > > > -def generate(filename, cmd, trailer): > +def generate(filename, cmd, trailer, registry_path): > print("Generate %s" % filename) > lcitool = subprocess.run(cmd, capture_output=True, encoding='utf8') > > @@ -49,6 +50,10 @@ def generate(filename, cmd, trailer): > raise Exception("Failed to generate %s: %s" % (filename, > lcitool.stderr)) > > content = lcitool.stdout > + > + if registry_path is not None: > + content = re.sub("FROM.*/", "FROM " + registry_path + '/', content) > + > if trailer is not None: > content += trailer > atomic_write(filename, content) > @@ -64,7 +69,7 @@ add_user_mapping = [ > ] > > def generate_dockerfile(host, target, project="qemu", cross=None, > trailer=None, > - enable_rust=True): > + enable_rust=True, registry_path=None): > filename = Path(src_dir, "tests", "docker", "dockerfiles", host + > ".docker") > cmd = lcitool_cmd + ["dockerfile"] > if cross is not None: > @@ -79,26 +84,26 @@ def generate_dockerfile(host, target, project="qemu", > cross=None, trailer=None, > > if enable_rust: > trailer += "\nENV ENABLE_RUST=1\n" > - generate(filename, cmd, trailer) > + generate(filename, cmd, trailer, registry_path) > > > def generate_vars(target, trailer=None): > filename = Path(src_dir, ".gitlab-ci.d", target + ".vars") > cmd = lcitool_cmd + ["variables", "--format", "shell", target, "qemu"] > - generate(filename, cmd, trailer) > + generate(filename, cmd, trailer, None) > > > def generate_pkglist(vm, target, project="qemu"): > filename = Path(src_dir, "tests", "vm", "generated", vm + ".json") > cmd = lcitool_cmd + ["variables", "--format", "json", target, project] > - generate(filename, cmd, None) > + generate(filename, cmd, None, None) > > > def generate_yaml(os, target, arch, trailer=None): > filename = Path(src_dir, "scripts", "ci", "setup", os, > f"{target}-{arch}.yaml") > cmd = lcitool_cmd + ["variables", "--format", "yaml", "-a", > arch, target, "qemu"] > - generate(filename, cmd, trailer) > + generate(filename, cmd, trailer, None) > > > alpine_extras = r""" > -- > 2.43.0 > > With regards, Daniel -- |: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
