Skip to content

Commit

Permalink
Use centos:stream9 as a base image, cleanup unused code (#1983)
Browse files Browse the repository at this point in the history
* Retire ember LVM code, unused

(Rationale: avoid having to change more things for changing the
base image)

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Remove unreferenced files from WORKSPACE

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Switch to centos:stream9 as a base image.

It has a significantly longer support cycle than Fedora releases,
and supposedly offers vulnerability scans.

Add a tinyCore.vdi to the repo instead of generating it.
The centos qemu-img has read-only VDI support, so we can't generate
it. Generate it using my system and add to the file-host.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Use full names for pulls from dockerhub

CentOS doesn't like short tags

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Avoid specifying checksum for CentOS images.

They expire faster than we can update checksums, this is unfortunate
but perhaps they will soon publish images at a lower rate allowing
us to keep up.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Bump number of open file limit to avoid bazel crashes

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Update builder to include #2087, builder based on centos stream9

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Update checksums that seem wrong

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Update ovirt links: old ones were removed

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Remove unused RPMs

Noticed due to: duplicated checksum but no problem in testsuite,
lack of aarch64 equivalent.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Put nbdkit-vddk-plugin back for amd64.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Use quay.io instead of dockerhub.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Install util-linux-core for /usr/sbin/blockdev

Needed after #2174

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Update nbdkit/libnbd/nginx/ovirt versions to the latest

The previous version we were using can't be fetched any more

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Generate our own CentOS stream9 image using RPMs

Now updating the dependencies can be done by running `make rpm-deps`
and committing the change, like kubevirt.

This creates a small complication that we need to run update-ca-trust
to trust root CAs. Do this on the pod, using the entrypoint to do so.

Use a single image with all the dependencies for the test tools, we
don't benefit from making them minimal and it saved some trouble in
the conversion.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Fixup imageio test container

Run update-ca-trust and update-crypto-policies before running
ovirt-imageio, to stop error messages.

Signed-off-by: Maya Rashish <mrashish@redhat.com>
  • Loading branch information
maya-r authored Apr 20, 2022
1 parent 60734b5 commit 02e70a5
Show file tree
Hide file tree
Showing 40 changed files with 2,877 additions and 1,671 deletions.
33 changes: 31 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair")
load("@bazeldnf//:def.bzl", "bazeldnf")

py_runtime(
name = "python2_runtime",
Expand Down Expand Up @@ -29,6 +31,8 @@ toolchain(
# gazelle:prefix kubevirt.io/containerized-data-importer
gazelle(name = "gazelle")

bazeldnf(name = "bazeldnf")

go_library(
name = "go_default_library",
srcs = ["doc.go"],
Expand All @@ -54,7 +58,6 @@ container_bundle(
"$(container_prefix)/cdi-func-test-registry-populate:$(container_tag)": "//tools/cdi-func-test-registry-init:cdi-func-test-registry-populate-image",
"$(container_prefix)/cdi-func-test-registry:$(container_tag)": "//tools/cdi-func-test-registry-init:cdi-func-test-registry-image",
"$(container_prefix)/imageio-init:$(container_tag)": "//tools/imageio-init:imageio-init-image",
"$(container_prefix)/loop-back-lvm:$(container_tag)": "//tools/loop-back-lvm:loop-back-lvm-image",
"$(container_prefix)/vcenter-simulator:$(container_tag)": "//tools/vddk-test:vcenter-simulator",
"$(container_prefix)/vddk-init:$(container_tag)": "//tools/vddk-init:vddk-init-image",
"$(container_prefix)/vddk-test:$(container_tag)": "//tools/vddk-test:vddk-test-image",
Expand All @@ -74,7 +77,6 @@ container_bundle(
"$(container_prefix)/cdi-func-test-registry-populate:$(container_tag)": "//tools/cdi-func-test-registry-init:cdi-func-test-registry-populate-image",
"$(container_prefix)/cdi-func-test-registry:$(container_tag)": "//tools/cdi-func-test-registry-init:cdi-func-test-registry-image",
"$(container_prefix)/imageio-init:$(container_tag)": "//tools/imageio-init:imageio-init-image",
"$(container_prefix)/loop-back-lvm:$(container_tag)": "//tools/loop-back-lvm:loop-back-lvm-image",
"$(container_prefix)/vcenter-simulator:$(container_tag)": "//tools/vddk-test:vcenter-simulator",
"$(container_prefix)/cdi-func-test-tinycore:$(container_tag)": "//tests:cdi-func-test-tinycore",
"$(container_prefix)/cdi-func-test-imageio:$(container_tag)": "//tools/image-io:cdi-func-test-imageio-image",
Expand Down Expand Up @@ -165,6 +167,7 @@ filegroup(
name = "test-images",
srcs = [
"//tests:images/tinyCore.iso",
"//tests:images/tinyCore.vdi",
"//tests:images/archive.tar",
"//tests:images/cirros-qcow2.img",
"//tests:images/cirros.raw",
Expand All @@ -185,3 +188,29 @@ filegroup(
],
visibility = ["//visibility:public"],
)

container_image(
name = "testimage_base",
tars = select({
"@io_bazel_rules_go//go/platform:linux_arm64": [
"//rpm:testimage_aarch64",
],
"//conditions:default": [
"//rpm:testimage_x86_64",
],
}),
visibility = ["//visibility:public"],
)

container_image(
name = "centos_base",
tars = select({
"@io_bazel_rules_go//go/platform:linux_arm64": [
"//rpm:centos_base_aarch64",
],
"//conditions:default": [
"//rpm:centos_base_x86_64",
],
}),
visibility = ["//visibility:public"],
)
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ gomod-update:

deps-update: gomod-update bazel-generate

rpm-deps:
${DO_BAZ} "CUSTOM_REPO=${CUSTOM_REPO} ./hack/build/rpm-deps.sh"

apidocs:
${DO_BAZ} "./hack/update-codegen.sh && ./hack/gen-swagger-doc/gen-swagger-docs.sh v1beta1 html"

Expand Down
Loading

0 comments on commit 02e70a5

Please sign in to comment.