From 2a1d321f355086e4b92d4c45127079f3b3d98529 Mon Sep 17 00:00:00 2001 From: Arik Hadas Date: Sun, 11 Feb 2024 00:08:54 +0200 Subject: [PATCH] add ova-nfs image Signed-off-by: Arik Hadas --- build_tests_bazel.sh | 1 + stub-images/BUILD.bazel | 9 +++++++++ stub-images/ova-nfs/BUILD.bazel | 27 +++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 stub-images/ova-nfs/BUILD.bazel diff --git a/build_tests_bazel.sh b/build_tests_bazel.sh index 0e767e7..291a601 100755 --- a/build_tests_bazel.sh +++ b/build_tests_bazel.sh @@ -23,3 +23,4 @@ export REGISTRY_TAG=latest cp -fr ${SCRIPT_DIR}/stub-images virt-v2v/cold bazel run --strategy_regexp="RunAndCommitLayer stub-images/virt-v2v-stub/qemu-img-layer.tar"=processwrapper-sandbox --package_path=virt-v2v/cold stub-images:push-forklift-virt-v2v-stub --verbose_failures bazel run --strategy_regexp="Action stub-images/vddk-test-vmdk/convert_to_vmdk/tmp/cirros.vmdk"=processwrapper-sandbox --package_path=virt-v2v/cold stub-images:push-vddk-test-vmdk --verbose_failures +bazel run --strategy_regexp="RunAndCommitLayer stub-images/ova-nfs/ova-repository-layer.tar"=processwrapper-sandbox --package_path=virt-v2v/cold stub-images:push-forkliftci-ova-nfs --verbose_failures diff --git a/stub-images/BUILD.bazel b/stub-images/BUILD.bazel index 604fc30..926ec65 100644 --- a/stub-images/BUILD.bazel +++ b/stub-images/BUILD.bazel @@ -21,3 +21,12 @@ container_push( repository = "$${REGISTRY_ORG:-}$${REGISTRY_ORG:+/}vddk-test-vmdk", tag = "$${REGISTRY_TAG:-devel}", ) + +container_push( + name = "push-forkliftci-ova-nfs", + format = "Docker", + image = "//stub-images/ova-nfs:ova-nfs-server", + registry = "$${REGISTRY:-quay.io}", + repository = "$${REGISTRY_ORG:-}$${REGISTRY_ORG:+/}forkliftci-ova-nfs", + tag = "$${REGISTRY_TAG:-devel}", +) diff --git a/stub-images/ova-nfs/BUILD.bazel b/stub-images/ova-nfs/BUILD.bazel new file mode 100644 index 0000000..12f51f5 --- /dev/null +++ b/stub-images/ova-nfs/BUILD.bazel @@ -0,0 +1,27 @@ +load( + "@io_bazel_rules_docker//container:container.bzl", + "container_image", +) +load("@io_bazel_rules_docker//docker/util:run.bzl", "container_run_and_commit_layer") + +container_run_and_commit_layer( + name = "ova-repository", + commands = [ + "dnf -y install nfs-utils wget", + "mkdir -p /home/nfsshare", + "chmod 777 /home/nfsshare", + "echo '/home/nfsshare *(insecure,rw,no_root_squash)' >>/etc/exports", + "cd /home/nfsshare", + "wget https://github.com/kubev2v/forkliftci/releases/download/v9.0/vm.ova", + "systemctl enable nfs-server", + ], + image = "@centos-stream-9//image", +) + +container_image( + name = "ova-nfs-server", + base = "@centos-stream-9//image", + layers = [":ova-repository"], + user = "1001", + visibility = ["//visibility:public"], +)