From a1999f0fc7ffdf59d61da3d1d4a9b01fd653bc50 Mon Sep 17 00:00:00 2001 From: Luke Hackwell Date: Thu, 22 Aug 2024 17:13:32 +0100 Subject: [PATCH 1/9] test(qemu): Provide example QEMU runner --- e2e/qemu/BUILD.bazel | 112 ++++++++++++++++++++++ e2e/qemu/data/install_debian.sh | 63 +++++++++++++ e2e/qemu/data/preseed.cfg | 162 ++++++++++++++++++++++++++++++++ e2e/qemu/manager.py | 18 ++++ e2e/qemu/ssh.py | 107 +++++++++++++++++++++ e2e/qemu/version.txt | 9 ++ e2e/qemu/x86-ubuntu-24.04.yaml | 15 +++ 7 files changed, 486 insertions(+) create mode 100644 e2e/qemu/BUILD.bazel create mode 100755 e2e/qemu/data/install_debian.sh create mode 100755 e2e/qemu/data/preseed.cfg create mode 100644 e2e/qemu/manager.py create mode 100755 e2e/qemu/ssh.py create mode 100644 e2e/qemu/version.txt create mode 100644 e2e/qemu/x86-ubuntu-24.04.yaml diff --git a/e2e/qemu/BUILD.bazel b/e2e/qemu/BUILD.bazel new file mode 100644 index 00000000..c9ab7dc6 --- /dev/null +++ b/e2e/qemu/BUILD.bazel @@ -0,0 +1,112 @@ +load("@rules_python//python:defs.bzl", "py_binary", "py_library") +load("@rules_labgrid//labgrid/genrule:defs.bzl", "labgrid_genrule") +load("@rules_labgrid//labgrid/executor:defs.bzl", "labgrid_executor") +load("@rules_labgrid//labgrid/transition:defs.bzl", "labgrid_transition") +load("@rules_diff//diff/file/test:defs.bzl", "diff_file_test") +load("@toolchain_utils//toolchain/info:defs.bzl", "toolchain_info") + +genrule( + name = "install_debian", + srcs = ["data/preseed.cfg"], + outs = ["debian.qcow2"], + cmd_bash = "./qemu/data/install_debian.sh $@ $(location data/preseed.cfg)", + tools = ["data/install_debian.sh"], +) + +py_binary( + name = "ssh", + srcs = ["ssh.py"], + args = [ + "--lg-env=$(location x86-ubuntu-24.04.yaml)", + "--lg-qemu-hda=$(location debian.qcow2)", + ], + data = [ + "x86-ubuntu-24.04.yaml", + "debian.qcow2", + ], + tags = ["manual"], + deps = [ + "@rules_labgrid//labgrid/python", + "@rules_python//python/runfiles", + ], +) + +# An execution manager that is responsible for setting up the LabGrid environment +py_library( + name = "manager", + srcs = ["manager.py"], + data = ["x86-ubuntu-24.04.yaml"], + deps = ["@rules_labgrid//labgrid/executor:manager"], +) + +# Create the LabGrid executor binary using our manager +labgrid_executor( + name = "executor", + deps = [":manager"], +) + +# Create toolchain information around the executor +toolchain_info( + name = "info", + target = ":executor", +) + +# A constraint to register the toolchain to +constraint_setting(name = "device") + +# This value would usually be shared in a common definitions module +constraint_value( + name = "constraint", + constraint_setting = ":device", +) + +# A platform that describes the Docker "platform" +platform( + name = "platform", + constraint_values = [ + ":constraint", + "@toolchain_utils//toolchain/constraint/os:linux", + ], +) + +# Provide the toolchain with Bazel +toolchain( + name = "toolchain", + target_compatible_with = [ + ":constraint", + "@toolchain_utils//toolchain/constraint/os:linux", + ], + toolchain = ":info", + toolchain_type = "@rules_labgrid//labgrid/toolchain/executor:type", +) + +# Run within the LabGrid environment +# This shows a few things: +# - It resolves the executor registered above to set up the `LG_ENV` enviroment variable +# - `:ssh` target uses `LG_ENV` to start the Docker container +# - `@ape//:cat` is provided to +labgrid_genrule( + name = "echo", + srcs = ["@ape//:cat"], + outs = ["stdout.log"], + cmd = "$(location :ssh) $(location @ape//:cat) /etc/os-release > $@", + tags = ["manual"], + tools = [":ssh"], +) + +# Transition the above `genrule` to the Docker platform +labgrid_transition( + name = "transition", + srcs = [":stdout.log"], + platforms = [":platform"], + tags = ["manual"], +) + +# Check that the output of `/proc/version` from within the container is what we expect +diff_file_test( + name = "test", + size = "small", + a = ":version.txt", + b = ":transition", + tags = ["manual"], +) diff --git a/e2e/qemu/data/install_debian.sh b/e2e/qemu/data/install_debian.sh new file mode 100755 index 00000000..cf485777 --- /dev/null +++ b/e2e/qemu/data/install_debian.sh @@ -0,0 +1,63 @@ +#!/bin/bash -e + +rm -rf +BUILD_DIR=build_dir +rm -rf $BUILD_DIR +mkdir $BUILD_DIR +cp $2 $BUILD_DIR +pushd $BUILD_DIR + +eval `ssh-agent` +ssh-add +AUTHORIZED_KEYS="$(ssh-add -L)" +echo $AUTHORIZED_KEYS +if [ -n "$AUTHORIZED_KEYS" ] +then + echo "Pre-populating authorized_keys for image" + echo "$AUTHORIZED_KEYS" > authorized_keys +fi + +PASS="asdf" + +echo "Running simple webserver on port 4321 for host files..." +PYTHON_PID=$(sh -c 'echo $$ ; exec >/dev/null 2>&1 ; exec python3 -m http.server 4321' &) + +echo "Downloading Debian Buster x86_64 netboot installer..." +curl --location --output netboot.tar.gz https://deb.debian.org/debian/dists/buster/main/installer-amd64/current/images/netboot/netboot.tar.gz +mkdir -p tftpserver +pushd tftpserver +tar xzvf ../netboot.tar.gz + +echo "Customising network boot parameters..." +cat > debian-installer/amd64/pxelinux.cfg/default < Iterator[Run]: + runfiles = Runfiles.Create() + config = runfiles.Rlocation("_main/qemu/x86-ubuntu-24.04.yaml") + env = { + "LG_ENV": config, + } + yield Data(env=env) diff --git a/e2e/qemu/ssh.py b/e2e/qemu/ssh.py new file mode 100755 index 00000000..f57ecc6a --- /dev/null +++ b/e2e/qemu/ssh.py @@ -0,0 +1,107 @@ +#! /usr/bin/env python3 + +from argparse import ArgumentParser +from os import environ, linesep +import os +from pathlib import Path, PurePath +from shlex import join +from sys import argv, stderr, stdout +from typing import Collection, Protocol, Tuple +import logging +import time +import shutil + +from labgrid import Environment + + +class Shell(Protocol): + def run(cmd: str) -> Tuple[Collection[str], Collection[str], int]: ... + + +def arguments(prsr: ArgumentParser) -> None: + prsr.add_argument( + "program", + metavar="PROG", + help="The program to run on the device.", + type=Path, + ) + prsr.add_argument( + "arguments", metavar="ARG", nargs="*", help="Command to run over SSH." + ) + prsr.add_argument( + "--lg-env", + help="The LabGrid environment configuration.", + dest="config", + default=PurePath(environ.get("LG_ENV", "config.yaml")), + type=PurePath, + ) + prsr.add_argument( + "--lg-qemu-hda", + help="The QEMU hard drive file", + dest="qemu_hda", + type=PurePath, + ) + + +def main(exe: Path, *args: str) -> int: + prsr = ArgumentParser( + prog=str(exe), description="TODO" + ) + arguments(prsr) + parsed = prsr.parse_args(args) + + if parsed.qemu_hda: + hda = parsed.qemu_hda + else: + hda = str(PurePath(os.environ["RUNFILES_DIR"]) / PurePath("_main/qemu/debian.qcow2")) + + # Set the hard drive that the QEMU will read + os.environ['LG_QEMU_HDA'] = 'debian.qcow2' + + env = Environment(str(parsed.config)) + target = env.get_target() + + # Copy the hard drive. This makes it read-writable + shutil.copyfile(hda, 'debian.qcow2') + + # Start the QEMU instance + qemu_driver = target.get_driver("QEMUDriver") + qemu_driver.on() + + # Wait until the VM has booted + console = target.get_driver("ConsoleProtocol") + for _ in range(300): + time.sleep(1) + try: + msg = console.read(timeout=0.1).decode('utf-8') + except: + pass + logging.error(msg) + if "login:" in msg: + break + + # Copy the program to run onto VM + program = "/tmp/{}".format(parsed.program.name) + transfer = target.get_driver("FileTransferProtocol") + transfer.put(parsed.program, program) + + # Run the transferred program + shell = target.get_driver("CommandProtocol") + out, err, code = shell.run(join((program, *parsed.arguments))) + for line in out: + logging.error(f"{line}{linesep}") + stdout.write(f"{line}{linesep}") + for line in err: + stderr.write(f"{line}{linesep}") + + qemu_driver.off() + + return code + + +def entry(): + exit(main(Path(argv[0]), *argv[1:])) + + +if __name__ == "__main__": + entry() diff --git a/e2e/qemu/version.txt b/e2e/qemu/version.txt new file mode 100644 index 00000000..9b5419df --- /dev/null +++ b/e2e/qemu/version.txt @@ -0,0 +1,9 @@ +PRETTY_NAME="Debian GNU/Linux 10 (buster)" +NAME="Debian GNU/Linux" +VERSION_ID="10" +VERSION="10 (buster)" +VERSION_CODENAME=buster +ID=debian +HOME_URL="https://www.debian.org/" +SUPPORT_URL="https://www.debian.org/support" +BUG_REPORT_URL="https://bugs.debian.org/" diff --git a/e2e/qemu/x86-ubuntu-24.04.yaml b/e2e/qemu/x86-ubuntu-24.04.yaml new file mode 100644 index 00000000..2a4286e3 --- /dev/null +++ b/e2e/qemu/x86-ubuntu-24.04.yaml @@ -0,0 +1,15 @@ +targets: + main: + resources: + NetworkService: + address: 'localhost' + port: 2222 + username: 'root' + drivers: + QEMUDriver: + qemu_bin: 'qemu-system-x86_64' + machine: 'pc' + cpu: 'max' + memory: '12G' + extra_args: !template '-hda $LG_QEMU_HDA -net nic -net user,hostfwd=tcp::2222-:22' + SSHDriver: {} -- GitLab From 70b1adefca847cd8bbd7dc4d362d7b7c85357946 Mon Sep 17 00:00:00 2001 From: Jordan Bonser Date: Tue, 17 Sep 2024 14:29:10 +0100 Subject: [PATCH 2/9] feat: add debian cloud download --- .bazelrc | 4 ++++ e2e/MODULE.bazel | 16 ++++++++++++++++ e2e/qemu/debian/BUILD.bazel | 14 ++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 e2e/qemu/debian/BUILD.bazel diff --git a/.bazelrc b/.bazelrc index 1eb348b6..a2a173d4 100644 --- a/.bazelrc +++ b/.bazelrc @@ -25,5 +25,9 @@ common --@rules_labgrid//python:bootstrap=script # Enable built Zstandard toolchain common --extra_toolchains=@rules_zstd//zstd/toolchain/zstd:built +# Download utils +common --registry https://bcr.bazel.build +common --registry=https://gitlab.arm.com/bazel/download_utils/-/releases/v1.0.0-alpha.1/downloads + # User-specific .bazelrc try-import %workspace%/.bazelrc.user diff --git a/e2e/MODULE.bazel b/e2e/MODULE.bazel index a90786bb..9575bbc4 100644 --- a/e2e/MODULE.bazel +++ b/e2e/MODULE.bazel @@ -5,6 +5,7 @@ module( ], ) +bazel_dep(name = "download_utils", version = "1.0.0-beta.2") bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.14") bazel_dep(name = "rules_python", version = "0.33.2") @@ -44,3 +45,18 @@ pip.parse( requirements_lock = "//python:requirements.txt", ) use_repo(pip, "pip") + +# Download QEMU images +download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "download_file") +[ + download_file( + name = "{}-debian.12-gnu-qemu".format(cpu), + output = "image.qcow2", + executable = False, + urls = ["https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-{}.qcow2".format(cpu)], + ) + for cpu, integrity in ( + ("amd64", ""), + ("arm64", ""), + ) +] diff --git a/e2e/qemu/debian/BUILD.bazel b/e2e/qemu/debian/BUILD.bazel new file mode 100644 index 00000000..9b4ddc86 --- /dev/null +++ b/e2e/qemu/debian/BUILD.bazel @@ -0,0 +1,14 @@ +load("@bazel_skylib//rules:build_test.bzl", "build_test") + +alias( + name = "image", + actual = select({ + "@platforms//cpu:aarch64": "@arm64-debian.12-gnu-qemu//:image.qcow2", + "@platforms//cpu:x86_64": "@amd64-debian.12-gnu-qemu//:image.qcow2", + }, no_match_error = "No QEMU Debian image for platform.") +) + +build_test( + name = "download", + targets = [":image"], +) \ No newline at end of file -- GitLab From 20d2e5cc6dbe24241b5c7773b941e5dae75234f4 Mon Sep 17 00:00:00 2001 From: Jordan Bonser Date: Tue, 17 Sep 2024 15:40:05 +0100 Subject: [PATCH 3/9] fix: add integrity shas for debian images --- e2e/MODULE.bazel | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/MODULE.bazel b/e2e/MODULE.bazel index 9575bbc4..5bf59a1a 100644 --- a/e2e/MODULE.bazel +++ b/e2e/MODULE.bazel @@ -56,7 +56,7 @@ download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "downlo urls = ["https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-{}.qcow2".format(cpu)], ) for cpu, integrity in ( - ("amd64", ""), - ("arm64", ""), + ("amd64", "sha256-p9rCK1tT7V/uDBI70LR3UoT8vK1aaJ9rWpL0jgXp+1I="), + ("arm64", "sha256-gxjqgasbjKLrLUtVJYz/MTiPbttisBz3Y4HglSRRspo="), ) -] +] \ No newline at end of file -- GitLab From 77a1e1ac94b6a14d470c06519014ac966deda718 Mon Sep 17 00:00:00 2001 From: Jordan Bonser Date: Tue, 17 Sep 2024 16:34:37 +0100 Subject: [PATCH 4/9] fix: remove unnecessary registry override --- .bazelrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index a2a173d4..73a93c5b 100644 --- a/.bazelrc +++ b/.bazelrc @@ -27,7 +27,6 @@ common --extra_toolchains=@rules_zstd//zstd/toolchain/zstd:built # Download utils common --registry https://bcr.bazel.build -common --registry=https://gitlab.arm.com/bazel/download_utils/-/releases/v1.0.0-alpha.1/downloads # User-specific .bazelrc try-import %workspace%/.bazelrc.user -- GitLab From 99e6023b4b1f4d38deb556360eaa7cd0b3eae09d Mon Sep 17 00:00:00 2001 From: Jordan Bonser Date: Tue, 17 Sep 2024 16:36:27 +0100 Subject: [PATCH 5/9] fix: move debian cloud download to top level --- e2e/qemu/BUILD.bazel | 112 ------------------ e2e/qemu/data/install_debian.sh | 63 ---------- e2e/qemu/data/preseed.cfg | 162 -------------------------- e2e/qemu/manager.py | 18 --- e2e/qemu/ssh.py | 107 ----------------- e2e/qemu/version.txt | 9 -- e2e/qemu/x86-ubuntu-24.04.yaml | 15 --- {e2e/qemu => qemu}/debian/BUILD.bazel | 1 + qemu/debian/MODULE.bazel | 23 ++++ qemu/debian/MODULE.bazel.lock | 84 +++++++++++++ qemu/debian/bazel-bin | 1 + qemu/debian/bazel-debian | 1 + qemu/debian/bazel-out | 1 + qemu/debian/bazel-testlogs | 1 + 14 files changed, 112 insertions(+), 486 deletions(-) delete mode 100644 e2e/qemu/BUILD.bazel delete mode 100755 e2e/qemu/data/install_debian.sh delete mode 100755 e2e/qemu/data/preseed.cfg delete mode 100644 e2e/qemu/manager.py delete mode 100755 e2e/qemu/ssh.py delete mode 100644 e2e/qemu/version.txt delete mode 100644 e2e/qemu/x86-ubuntu-24.04.yaml rename {e2e/qemu => qemu}/debian/BUILD.bazel (99%) create mode 100644 qemu/debian/MODULE.bazel create mode 100644 qemu/debian/MODULE.bazel.lock create mode 120000 qemu/debian/bazel-bin create mode 120000 qemu/debian/bazel-debian create mode 120000 qemu/debian/bazel-out create mode 120000 qemu/debian/bazel-testlogs diff --git a/e2e/qemu/BUILD.bazel b/e2e/qemu/BUILD.bazel deleted file mode 100644 index c9ab7dc6..00000000 --- a/e2e/qemu/BUILD.bazel +++ /dev/null @@ -1,112 +0,0 @@ -load("@rules_python//python:defs.bzl", "py_binary", "py_library") -load("@rules_labgrid//labgrid/genrule:defs.bzl", "labgrid_genrule") -load("@rules_labgrid//labgrid/executor:defs.bzl", "labgrid_executor") -load("@rules_labgrid//labgrid/transition:defs.bzl", "labgrid_transition") -load("@rules_diff//diff/file/test:defs.bzl", "diff_file_test") -load("@toolchain_utils//toolchain/info:defs.bzl", "toolchain_info") - -genrule( - name = "install_debian", - srcs = ["data/preseed.cfg"], - outs = ["debian.qcow2"], - cmd_bash = "./qemu/data/install_debian.sh $@ $(location data/preseed.cfg)", - tools = ["data/install_debian.sh"], -) - -py_binary( - name = "ssh", - srcs = ["ssh.py"], - args = [ - "--lg-env=$(location x86-ubuntu-24.04.yaml)", - "--lg-qemu-hda=$(location debian.qcow2)", - ], - data = [ - "x86-ubuntu-24.04.yaml", - "debian.qcow2", - ], - tags = ["manual"], - deps = [ - "@rules_labgrid//labgrid/python", - "@rules_python//python/runfiles", - ], -) - -# An execution manager that is responsible for setting up the LabGrid environment -py_library( - name = "manager", - srcs = ["manager.py"], - data = ["x86-ubuntu-24.04.yaml"], - deps = ["@rules_labgrid//labgrid/executor:manager"], -) - -# Create the LabGrid executor binary using our manager -labgrid_executor( - name = "executor", - deps = [":manager"], -) - -# Create toolchain information around the executor -toolchain_info( - name = "info", - target = ":executor", -) - -# A constraint to register the toolchain to -constraint_setting(name = "device") - -# This value would usually be shared in a common definitions module -constraint_value( - name = "constraint", - constraint_setting = ":device", -) - -# A platform that describes the Docker "platform" -platform( - name = "platform", - constraint_values = [ - ":constraint", - "@toolchain_utils//toolchain/constraint/os:linux", - ], -) - -# Provide the toolchain with Bazel -toolchain( - name = "toolchain", - target_compatible_with = [ - ":constraint", - "@toolchain_utils//toolchain/constraint/os:linux", - ], - toolchain = ":info", - toolchain_type = "@rules_labgrid//labgrid/toolchain/executor:type", -) - -# Run within the LabGrid environment -# This shows a few things: -# - It resolves the executor registered above to set up the `LG_ENV` enviroment variable -# - `:ssh` target uses `LG_ENV` to start the Docker container -# - `@ape//:cat` is provided to -labgrid_genrule( - name = "echo", - srcs = ["@ape//:cat"], - outs = ["stdout.log"], - cmd = "$(location :ssh) $(location @ape//:cat) /etc/os-release > $@", - tags = ["manual"], - tools = [":ssh"], -) - -# Transition the above `genrule` to the Docker platform -labgrid_transition( - name = "transition", - srcs = [":stdout.log"], - platforms = [":platform"], - tags = ["manual"], -) - -# Check that the output of `/proc/version` from within the container is what we expect -diff_file_test( - name = "test", - size = "small", - a = ":version.txt", - b = ":transition", - tags = ["manual"], -) diff --git a/e2e/qemu/data/install_debian.sh b/e2e/qemu/data/install_debian.sh deleted file mode 100755 index cf485777..00000000 --- a/e2e/qemu/data/install_debian.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -e - -rm -rf -BUILD_DIR=build_dir -rm -rf $BUILD_DIR -mkdir $BUILD_DIR -cp $2 $BUILD_DIR -pushd $BUILD_DIR - -eval `ssh-agent` -ssh-add -AUTHORIZED_KEYS="$(ssh-add -L)" -echo $AUTHORIZED_KEYS -if [ -n "$AUTHORIZED_KEYS" ] -then - echo "Pre-populating authorized_keys for image" - echo "$AUTHORIZED_KEYS" > authorized_keys -fi - -PASS="asdf" - -echo "Running simple webserver on port 4321 for host files..." -PYTHON_PID=$(sh -c 'echo $$ ; exec >/dev/null 2>&1 ; exec python3 -m http.server 4321' &) - -echo "Downloading Debian Buster x86_64 netboot installer..." -curl --location --output netboot.tar.gz https://deb.debian.org/debian/dists/buster/main/installer-amd64/current/images/netboot/netboot.tar.gz -mkdir -p tftpserver -pushd tftpserver -tar xzvf ../netboot.tar.gz - -echo "Customising network boot parameters..." -cat > debian-installer/amd64/pxelinux.cfg/default < Iterator[Run]: - runfiles = Runfiles.Create() - config = runfiles.Rlocation("_main/qemu/x86-ubuntu-24.04.yaml") - env = { - "LG_ENV": config, - } - yield Data(env=env) diff --git a/e2e/qemu/ssh.py b/e2e/qemu/ssh.py deleted file mode 100755 index f57ecc6a..00000000 --- a/e2e/qemu/ssh.py +++ /dev/null @@ -1,107 +0,0 @@ -#! /usr/bin/env python3 - -from argparse import ArgumentParser -from os import environ, linesep -import os -from pathlib import Path, PurePath -from shlex import join -from sys import argv, stderr, stdout -from typing import Collection, Protocol, Tuple -import logging -import time -import shutil - -from labgrid import Environment - - -class Shell(Protocol): - def run(cmd: str) -> Tuple[Collection[str], Collection[str], int]: ... - - -def arguments(prsr: ArgumentParser) -> None: - prsr.add_argument( - "program", - metavar="PROG", - help="The program to run on the device.", - type=Path, - ) - prsr.add_argument( - "arguments", metavar="ARG", nargs="*", help="Command to run over SSH." - ) - prsr.add_argument( - "--lg-env", - help="The LabGrid environment configuration.", - dest="config", - default=PurePath(environ.get("LG_ENV", "config.yaml")), - type=PurePath, - ) - prsr.add_argument( - "--lg-qemu-hda", - help="The QEMU hard drive file", - dest="qemu_hda", - type=PurePath, - ) - - -def main(exe: Path, *args: str) -> int: - prsr = ArgumentParser( - prog=str(exe), description="TODO" - ) - arguments(prsr) - parsed = prsr.parse_args(args) - - if parsed.qemu_hda: - hda = parsed.qemu_hda - else: - hda = str(PurePath(os.environ["RUNFILES_DIR"]) / PurePath("_main/qemu/debian.qcow2")) - - # Set the hard drive that the QEMU will read - os.environ['LG_QEMU_HDA'] = 'debian.qcow2' - - env = Environment(str(parsed.config)) - target = env.get_target() - - # Copy the hard drive. This makes it read-writable - shutil.copyfile(hda, 'debian.qcow2') - - # Start the QEMU instance - qemu_driver = target.get_driver("QEMUDriver") - qemu_driver.on() - - # Wait until the VM has booted - console = target.get_driver("ConsoleProtocol") - for _ in range(300): - time.sleep(1) - try: - msg = console.read(timeout=0.1).decode('utf-8') - except: - pass - logging.error(msg) - if "login:" in msg: - break - - # Copy the program to run onto VM - program = "/tmp/{}".format(parsed.program.name) - transfer = target.get_driver("FileTransferProtocol") - transfer.put(parsed.program, program) - - # Run the transferred program - shell = target.get_driver("CommandProtocol") - out, err, code = shell.run(join((program, *parsed.arguments))) - for line in out: - logging.error(f"{line}{linesep}") - stdout.write(f"{line}{linesep}") - for line in err: - stderr.write(f"{line}{linesep}") - - qemu_driver.off() - - return code - - -def entry(): - exit(main(Path(argv[0]), *argv[1:])) - - -if __name__ == "__main__": - entry() diff --git a/e2e/qemu/version.txt b/e2e/qemu/version.txt deleted file mode 100644 index 9b5419df..00000000 --- a/e2e/qemu/version.txt +++ /dev/null @@ -1,9 +0,0 @@ -PRETTY_NAME="Debian GNU/Linux 10 (buster)" -NAME="Debian GNU/Linux" -VERSION_ID="10" -VERSION="10 (buster)" -VERSION_CODENAME=buster -ID=debian -HOME_URL="https://www.debian.org/" -SUPPORT_URL="https://www.debian.org/support" -BUG_REPORT_URL="https://bugs.debian.org/" diff --git a/e2e/qemu/x86-ubuntu-24.04.yaml b/e2e/qemu/x86-ubuntu-24.04.yaml deleted file mode 100644 index 2a4286e3..00000000 --- a/e2e/qemu/x86-ubuntu-24.04.yaml +++ /dev/null @@ -1,15 +0,0 @@ -targets: - main: - resources: - NetworkService: - address: 'localhost' - port: 2222 - username: 'root' - drivers: - QEMUDriver: - qemu_bin: 'qemu-system-x86_64' - machine: 'pc' - cpu: 'max' - memory: '12G' - extra_args: !template '-hda $LG_QEMU_HDA -net nic -net user,hostfwd=tcp::2222-:22' - SSHDriver: {} diff --git a/e2e/qemu/debian/BUILD.bazel b/qemu/debian/BUILD.bazel similarity index 99% rename from e2e/qemu/debian/BUILD.bazel rename to qemu/debian/BUILD.bazel index 9b4ddc86..eec1fb2e 100644 --- a/e2e/qemu/debian/BUILD.bazel +++ b/qemu/debian/BUILD.bazel @@ -1,5 +1,6 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test") + alias( name = "image", actual = select({ diff --git a/qemu/debian/MODULE.bazel b/qemu/debian/MODULE.bazel new file mode 100644 index 00000000..d6eaaa16 --- /dev/null +++ b/qemu/debian/MODULE.bazel @@ -0,0 +1,23 @@ +############################################################################### +# Bazel now uses Bzlmod by default to manage external dependencies. +# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. +# +# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 +############################################################################### + +bazel_dep(name = "download_utils", version = "1.0.0-beta.2") + +# Download QEMU images +download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "download_file") +[ + download_file( + name = "{}-debian.12-gnu-qemu".format(cpu), + output = "image.qcow2", + executable = False, + urls = ["https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-{}.qcow2".format(cpu)], + ) + for cpu, integrity in ( + ("amd64", "sha256-p9rCK1tT7V/uDBI70LR3UoT8vK1aaJ9rWpL0jgXp+1I="), + ("arm64", "sha256-gxjqgasbjKLrLUtVJYz/MTiPbttisBz3Y4HglSRRspo="), + ) +] \ No newline at end of file diff --git a/qemu/debian/MODULE.bazel.lock b/qemu/debian/MODULE.bazel.lock new file mode 100644 index 00000000..43e29a9d --- /dev/null +++ b/qemu/debian/MODULE.bazel.lock @@ -0,0 +1,84 @@ +{ + "lockFileVersion": 11, + "registryFileHashes": { + "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", + "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", + "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589", + "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/source.json": "7e3a9adf473e9af076ae485ed649d5641ad50ec5c11718103f34de03170d94ad", + "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel": "50341a62efbc483e8a2a6aec30994a58749bd7b885e18dd96aa8c33031e558ef", + "https://bcr.bazel.build/modules/apple_support/1.5.0/source.json": "eb98a7627c0bc486b57f598ad8da50f6625d974c8f723e9ea71bd39f709c9862", + "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", + "https://bcr.bazel.build/modules/bazel_features/1.11.0/source.json": "c9320aa53cd1c441d24bd6b716da087ad7e4ff0d9742a9884587596edfe53015", + "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", + "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", + "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", + "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/source.json": "082ed5f9837901fada8c68c2f3ddc958bb22b6d654f71dd73f3df30d45d4b749", + "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", + "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", + "https://bcr.bazel.build/modules/download_utils/1.0.0-beta.2/MODULE.bazel": "bced1551849a5d1ca00b985c0d267ab690af840f04c685f2c62f40e92f66fac0", + "https://bcr.bazel.build/modules/download_utils/1.0.0-beta.2/source.json": "0ab7ebbc57f39a7fe96190e01fe9773482bc4e3d465e9cd9b239bb44ad57791d", + "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", + "https://bcr.bazel.build/modules/googletest/1.11.0/source.json": "c73d9ef4268c91bd0c1cd88f1f9dfa08e814b1dbe89b5f594a9f08ba0244d206", + "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", + "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", + "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", + "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", + "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc", + "https://bcr.bazel.build/modules/platforms/0.0.9/source.json": "cd74d854bf16a9e002fb2ca7b1a421f4403cda29f824a765acd3a8c56f8d43e6", + "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", + "https://bcr.bazel.build/modules/protobuf/21.7/source.json": "bbe500720421e582ff2d18b0802464205138c06056f443184de39fbb8187b09b", + "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", + "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858", + "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", + "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", + "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", + "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", + "https://bcr.bazel.build/modules/rules_cc/0.0.9/source.json": "1f1ba6fea244b616de4a554a0f4983c91a9301640c8fe0dd1d410254115c8430", + "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", + "https://bcr.bazel.build/modules/rules_java/7.6.5/MODULE.bazel": "481164be5e02e4cab6e77a36927683263be56b7e36fef918b458d7a8a1ebadb1", + "https://bcr.bazel.build/modules/rules_java/7.6.5/source.json": "a805b889531d1690e3c72a7a7e47a870d00323186a9904b36af83aa3d053ee8d", + "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", + "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/source.json": "a075731e1b46bc8425098512d038d416e966ab19684a10a34f4741295642fc35", + "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", + "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", + "https://bcr.bazel.build/modules/rules_license/0.0.7/source.json": "355cc5737a0f294e560d52b1b7a6492d4fff2caf0bef1a315df5a298fca2d34a", + "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", + "https://bcr.bazel.build/modules/rules_pkg/0.7.0/source.json": "c2557066e0c0342223ba592510ad3d812d4963b9024831f7f66fd0584dd8c66c", + "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", + "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", + "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/source.json": "d57902c052424dfda0e71646cb12668d39c4620ee0544294d9d941e7d12bc3a9", + "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", + "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel": "26114f0c0b5e93018c0c066d6673f1a2c3737c7e90af95eff30cfee38d0bbac7", + "https://bcr.bazel.build/modules/rules_python/0.22.1/source.json": "57226905e783bae7c37c2dd662be078728e48fa28ee4324a7eabcafb5a43d014", + "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", + "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", + "https://bcr.bazel.build/modules/stardoc/0.5.1/source.json": "a96f95e02123320aa015b956f29c00cb818fa891ef823d55148e1a362caacf29", + "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", + "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/source.json": "f1ef7d3f9e0e26d4b23d1c39b5f5de71f584dd7d1b4ef83d9bbba6ec7a6a6459", + "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", + "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d" + }, + "selectedYankedVersions": {}, + "moduleExtensions": { + "@@platforms//host:extension.bzl%host_platform": { + "general": { + "bzlTransitiveDigest": "xelQcPZH8+tmuOHVjL9vDxMnnQNMlwj0SlvgoqBkm4U=", + "usagesDigest": "meSzxn3DUCcYEhq4HQwExWkWtU4EjriRBQLsZN+Q0SU=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "host_platform": { + "bzlFile": "@@platforms//host:extension.bzl", + "ruleClassName": "host_platform_repo", + "attributes": {} + } + }, + "recordedRepoMappingEntries": [] + } + } + } +} diff --git a/qemu/debian/bazel-bin b/qemu/debian/bazel-bin new file mode 120000 index 00000000..2ee86581 --- /dev/null +++ b/qemu/debian/bazel-bin @@ -0,0 +1 @@ +/home/jorbon01/.cache/bazel/_bazel_jorbon01/a71b5c810287cc02bd9f8646c775a961/execroot/_main/bazel-out/k8-fastbuild/bin \ No newline at end of file diff --git a/qemu/debian/bazel-debian b/qemu/debian/bazel-debian new file mode 120000 index 00000000..a5077c68 --- /dev/null +++ b/qemu/debian/bazel-debian @@ -0,0 +1 @@ +/home/jorbon01/.cache/bazel/_bazel_jorbon01/a71b5c810287cc02bd9f8646c775a961/execroot/_main \ No newline at end of file diff --git a/qemu/debian/bazel-out b/qemu/debian/bazel-out new file mode 120000 index 00000000..fc5e7cb3 --- /dev/null +++ b/qemu/debian/bazel-out @@ -0,0 +1 @@ +/home/jorbon01/.cache/bazel/_bazel_jorbon01/a71b5c810287cc02bd9f8646c775a961/execroot/_main/bazel-out \ No newline at end of file diff --git a/qemu/debian/bazel-testlogs b/qemu/debian/bazel-testlogs new file mode 120000 index 00000000..41222e7c --- /dev/null +++ b/qemu/debian/bazel-testlogs @@ -0,0 +1 @@ +/home/jorbon01/.cache/bazel/_bazel_jorbon01/a71b5c810287cc02bd9f8646c775a961/execroot/_main/bazel-out/k8-fastbuild/testlogs \ No newline at end of file -- GitLab From 4c4e673bb8d46bc8d02e5f92d10f7721a703a36e Mon Sep 17 00:00:00 2001 From: Jordan Bonser Date: Wed, 18 Sep 2024 09:31:56 +0100 Subject: [PATCH 6/9] refactor: modules and bazelrc changes. --- .bazelrc | 3 -- MODULE.bazel | 15 +++++++ e2e/MODULE.bazel | 18 +------- qemu/debian/MODULE.bazel | 23 ---------- qemu/debian/MODULE.bazel.lock | 84 ----------------------------------- 5 files changed, 16 insertions(+), 127 deletions(-) delete mode 100644 qemu/debian/MODULE.bazel delete mode 100644 qemu/debian/MODULE.bazel.lock diff --git a/.bazelrc b/.bazelrc index 73a93c5b..1eb348b6 100644 --- a/.bazelrc +++ b/.bazelrc @@ -25,8 +25,5 @@ common --@rules_labgrid//python:bootstrap=script # Enable built Zstandard toolchain common --extra_toolchains=@rules_zstd//zstd/toolchain/zstd:built -# Download utils -common --registry https://bcr.bazel.build - # User-specific .bazelrc try-import %workspace%/.bazelrc.user diff --git a/MODULE.bazel b/MODULE.bazel index a2cb5ad0..e9796e8f 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -296,3 +296,18 @@ download_archive = use_repo_rule("@download_utils//download/archive:defs.bzl", " ("arm64", "zlib1g", "1.2.13.dfsg-1", "z", "zlib", "sha256-Uri4oUW74ZVruoIDT3cCLL7ww9CIXJ4y2YF6eTL+GRM="), ) ] + +# Download QEMU debian cloud images +download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "download_file") +[ + download_file( + name = "{}-debian.12-gnu-qemu".format(cpu), + output = "image.qcow2", + executable = False, + urls = ["https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-{}.qcow2".format(cpu)], + ) + for cpu, integrity in ( + ("amd64", "sha256-p9rCK1tT7V/uDBI70LR3UoT8vK1aaJ9rWpL0jgXp+1I="), + ("arm64", "sha256-gxjqgasbjKLrLUtVJYz/MTiPbttisBz3Y4HglSRRspo="), + ) +] \ No newline at end of file diff --git a/e2e/MODULE.bazel b/e2e/MODULE.bazel index 5bf59a1a..73bb474f 100644 --- a/e2e/MODULE.bazel +++ b/e2e/MODULE.bazel @@ -5,7 +5,6 @@ module( ], ) -bazel_dep(name = "download_utils", version = "1.0.0-beta.2") bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.14") bazel_dep(name = "rules_python", version = "0.33.2") @@ -44,19 +43,4 @@ pip.parse( python_version = "3.11", requirements_lock = "//python:requirements.txt", ) -use_repo(pip, "pip") - -# Download QEMU images -download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "download_file") -[ - download_file( - name = "{}-debian.12-gnu-qemu".format(cpu), - output = "image.qcow2", - executable = False, - urls = ["https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-{}.qcow2".format(cpu)], - ) - for cpu, integrity in ( - ("amd64", "sha256-p9rCK1tT7V/uDBI70LR3UoT8vK1aaJ9rWpL0jgXp+1I="), - ("arm64", "sha256-gxjqgasbjKLrLUtVJYz/MTiPbttisBz3Y4HglSRRspo="), - ) -] \ No newline at end of file +use_repo(pip, "pip") \ No newline at end of file diff --git a/qemu/debian/MODULE.bazel b/qemu/debian/MODULE.bazel deleted file mode 100644 index d6eaaa16..00000000 --- a/qemu/debian/MODULE.bazel +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################### -# Bazel now uses Bzlmod by default to manage external dependencies. -# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. -# -# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 -############################################################################### - -bazel_dep(name = "download_utils", version = "1.0.0-beta.2") - -# Download QEMU images -download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "download_file") -[ - download_file( - name = "{}-debian.12-gnu-qemu".format(cpu), - output = "image.qcow2", - executable = False, - urls = ["https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-{}.qcow2".format(cpu)], - ) - for cpu, integrity in ( - ("amd64", "sha256-p9rCK1tT7V/uDBI70LR3UoT8vK1aaJ9rWpL0jgXp+1I="), - ("arm64", "sha256-gxjqgasbjKLrLUtVJYz/MTiPbttisBz3Y4HglSRRspo="), - ) -] \ No newline at end of file diff --git a/qemu/debian/MODULE.bazel.lock b/qemu/debian/MODULE.bazel.lock deleted file mode 100644 index 43e29a9d..00000000 --- a/qemu/debian/MODULE.bazel.lock +++ /dev/null @@ -1,84 +0,0 @@ -{ - "lockFileVersion": 11, - "registryFileHashes": { - "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", - "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", - "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589", - "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/source.json": "7e3a9adf473e9af076ae485ed649d5641ad50ec5c11718103f34de03170d94ad", - "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel": "50341a62efbc483e8a2a6aec30994a58749bd7b885e18dd96aa8c33031e558ef", - "https://bcr.bazel.build/modules/apple_support/1.5.0/source.json": "eb98a7627c0bc486b57f598ad8da50f6625d974c8f723e9ea71bd39f709c9862", - "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", - "https://bcr.bazel.build/modules/bazel_features/1.11.0/source.json": "c9320aa53cd1c441d24bd6b716da087ad7e4ff0d9742a9884587596edfe53015", - "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", - "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", - "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", - "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", - "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/source.json": "082ed5f9837901fada8c68c2f3ddc958bb22b6d654f71dd73f3df30d45d4b749", - "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", - "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", - "https://bcr.bazel.build/modules/download_utils/1.0.0-beta.2/MODULE.bazel": "bced1551849a5d1ca00b985c0d267ab690af840f04c685f2c62f40e92f66fac0", - "https://bcr.bazel.build/modules/download_utils/1.0.0-beta.2/source.json": "0ab7ebbc57f39a7fe96190e01fe9773482bc4e3d465e9cd9b239bb44ad57791d", - "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", - "https://bcr.bazel.build/modules/googletest/1.11.0/source.json": "c73d9ef4268c91bd0c1cd88f1f9dfa08e814b1dbe89b5f594a9f08ba0244d206", - "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", - "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", - "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", - "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", - "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc", - "https://bcr.bazel.build/modules/platforms/0.0.9/source.json": "cd74d854bf16a9e002fb2ca7b1a421f4403cda29f824a765acd3a8c56f8d43e6", - "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", - "https://bcr.bazel.build/modules/protobuf/21.7/source.json": "bbe500720421e582ff2d18b0802464205138c06056f443184de39fbb8187b09b", - "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", - "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858", - "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", - "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", - "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", - "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", - "https://bcr.bazel.build/modules/rules_cc/0.0.9/source.json": "1f1ba6fea244b616de4a554a0f4983c91a9301640c8fe0dd1d410254115c8430", - "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", - "https://bcr.bazel.build/modules/rules_java/7.6.5/MODULE.bazel": "481164be5e02e4cab6e77a36927683263be56b7e36fef918b458d7a8a1ebadb1", - "https://bcr.bazel.build/modules/rules_java/7.6.5/source.json": "a805b889531d1690e3c72a7a7e47a870d00323186a9904b36af83aa3d053ee8d", - "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", - "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/source.json": "a075731e1b46bc8425098512d038d416e966ab19684a10a34f4741295642fc35", - "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", - "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", - "https://bcr.bazel.build/modules/rules_license/0.0.7/source.json": "355cc5737a0f294e560d52b1b7a6492d4fff2caf0bef1a315df5a298fca2d34a", - "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", - "https://bcr.bazel.build/modules/rules_pkg/0.7.0/source.json": "c2557066e0c0342223ba592510ad3d812d4963b9024831f7f66fd0584dd8c66c", - "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", - "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", - "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/source.json": "d57902c052424dfda0e71646cb12668d39c4620ee0544294d9d941e7d12bc3a9", - "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", - "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel": "26114f0c0b5e93018c0c066d6673f1a2c3737c7e90af95eff30cfee38d0bbac7", - "https://bcr.bazel.build/modules/rules_python/0.22.1/source.json": "57226905e783bae7c37c2dd662be078728e48fa28ee4324a7eabcafb5a43d014", - "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", - "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", - "https://bcr.bazel.build/modules/stardoc/0.5.1/source.json": "a96f95e02123320aa015b956f29c00cb818fa891ef823d55148e1a362caacf29", - "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", - "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/source.json": "f1ef7d3f9e0e26d4b23d1c39b5f5de71f584dd7d1b4ef83d9bbba6ec7a6a6459", - "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", - "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27", - "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79", - "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d" - }, - "selectedYankedVersions": {}, - "moduleExtensions": { - "@@platforms//host:extension.bzl%host_platform": { - "general": { - "bzlTransitiveDigest": "xelQcPZH8+tmuOHVjL9vDxMnnQNMlwj0SlvgoqBkm4U=", - "usagesDigest": "meSzxn3DUCcYEhq4HQwExWkWtU4EjriRBQLsZN+Q0SU=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "host_platform": { - "bzlFile": "@@platforms//host:extension.bzl", - "ruleClassName": "host_platform_repo", - "attributes": {} - } - }, - "recordedRepoMappingEntries": [] - } - } - } -} -- GitLab From f1af4d162b004acb58af2d8e42df74632fc7dbdf Mon Sep 17 00:00:00 2001 From: Jordan Bonser Date: Wed, 18 Sep 2024 09:43:51 +0100 Subject: [PATCH 7/9] refactor: remove the generated bazel files --- qemu/debian/bazel-bin | 1 - qemu/debian/bazel-debian | 1 - qemu/debian/bazel-out | 1 - qemu/debian/bazel-testlogs | 1 - 4 files changed, 4 deletions(-) delete mode 120000 qemu/debian/bazel-bin delete mode 120000 qemu/debian/bazel-debian delete mode 120000 qemu/debian/bazel-out delete mode 120000 qemu/debian/bazel-testlogs diff --git a/qemu/debian/bazel-bin b/qemu/debian/bazel-bin deleted file mode 120000 index 2ee86581..00000000 --- a/qemu/debian/bazel-bin +++ /dev/null @@ -1 +0,0 @@ -/home/jorbon01/.cache/bazel/_bazel_jorbon01/a71b5c810287cc02bd9f8646c775a961/execroot/_main/bazel-out/k8-fastbuild/bin \ No newline at end of file diff --git a/qemu/debian/bazel-debian b/qemu/debian/bazel-debian deleted file mode 120000 index a5077c68..00000000 --- a/qemu/debian/bazel-debian +++ /dev/null @@ -1 +0,0 @@ -/home/jorbon01/.cache/bazel/_bazel_jorbon01/a71b5c810287cc02bd9f8646c775a961/execroot/_main \ No newline at end of file diff --git a/qemu/debian/bazel-out b/qemu/debian/bazel-out deleted file mode 120000 index fc5e7cb3..00000000 --- a/qemu/debian/bazel-out +++ /dev/null @@ -1 +0,0 @@ -/home/jorbon01/.cache/bazel/_bazel_jorbon01/a71b5c810287cc02bd9f8646c775a961/execroot/_main/bazel-out \ No newline at end of file diff --git a/qemu/debian/bazel-testlogs b/qemu/debian/bazel-testlogs deleted file mode 120000 index 41222e7c..00000000 --- a/qemu/debian/bazel-testlogs +++ /dev/null @@ -1 +0,0 @@ -/home/jorbon01/.cache/bazel/_bazel_jorbon01/a71b5c810287cc02bd9f8646c775a961/execroot/_main/bazel-out/k8-fastbuild/testlogs \ No newline at end of file -- GitLab From d5556d891020df73d3184e028897c4c19a317dda Mon Sep 17 00:00:00 2001 From: Jordan Bonser Date: Wed, 18 Sep 2024 11:53:15 +0100 Subject: [PATCH 8/9] fix: use integrity in download_file --- MODULE.bazel | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index e9796e8f..7fa520b3 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -305,8 +305,9 @@ download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "downlo output = "image.qcow2", executable = False, urls = ["https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-{}.qcow2".format(cpu)], + integrity = integrity_sha ) - for cpu, integrity in ( + for cpu, integrity_sha in ( ("amd64", "sha256-p9rCK1tT7V/uDBI70LR3UoT8vK1aaJ9rWpL0jgXp+1I="), ("arm64", "sha256-gxjqgasbjKLrLUtVJYz/MTiPbttisBz3Y4HglSRRspo="), ) -- GitLab From 0c0b8e932077775232a63434e92b3e7cf48f4144 Mon Sep 17 00:00:00 2001 From: Jordan Bonser Date: Wed, 18 Sep 2024 13:36:52 +0100 Subject: [PATCH 9/9] refactor: integrity variable naming --- MODULE.bazel | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 7fa520b3..9d9576b9 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -305,9 +305,9 @@ download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "downlo output = "image.qcow2", executable = False, urls = ["https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-{}.qcow2".format(cpu)], - integrity = integrity_sha + integrity = integrity ) - for cpu, integrity_sha in ( + for cpu, integrity in ( ("amd64", "sha256-p9rCK1tT7V/uDBI70LR3UoT8vK1aaJ9rWpL0jgXp+1I="), ("arm64", "sha256-gxjqgasbjKLrLUtVJYz/MTiPbttisBz3Y4HglSRRspo="), ) -- GitLab