mirror of
https://github.com/kubevirt/containerized-data-importer.git
synced 2025-06-03 06:30:22 +00:00

* Updated dependencies Signed-off-by: Tomasz Baranski <tbaransk@redhat.com> * Replace skopeo with containers API. This commit removes dependence on skopeo (binary) and uses containers API. By doing that we're able to opimize the use of storage (scratch) space, storage I/O and download bandwith. Signed-off-by: Tomasz Baranski <tbaransk@redhat.com> * Fixing rebase - dependencies kerfuffle. Signed-off-by: Tomasz Baranski <tbaransk@redhat.com> * Handling docker-format images as well as OCI. Signed-off-by: Tomasz Baranski <tbaransk@redhat.com> * Fix for missing code-generator module. Signed-off-by: Tomasz Baranski <tbaransk@redhat.com> * Remove regex, image file in registry images are matched by a path prefix. Signed-off-by: Tomasz Baranski <tbaransk@redhat.com> * Added nginx proxy in front of docker registry for a rate-limited access. Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>
119 lines
2.8 KiB
Python
119 lines
2.8 KiB
Python
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
|
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
|
|
load("@io_bazel_rules_container_rpm//rpm:rpm.bzl", "rpm_image")
|
|
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
|
|
|
|
rpm_image(
|
|
name = "cdi-func-test-file-host-init-base-image",
|
|
base = "@fedora//image",
|
|
rpms = [
|
|
"@qemu-img//file",
|
|
"@qemu-block-curl//file",
|
|
"@xen-libs//file",
|
|
"@libaio//file",
|
|
"@capstone//file",
|
|
],
|
|
)
|
|
|
|
rpm_image(
|
|
name = "cdi-func-test-file-host-http-base-image",
|
|
base = "@fedora//image",
|
|
rpms = [
|
|
"@nginx//file",
|
|
"@gperftools-lib//file",
|
|
"@libunwind//file",
|
|
"@nginx-mimetypes//file",
|
|
"@nginx-filesystem//file",
|
|
],
|
|
)
|
|
|
|
go_library(
|
|
name = "go_default_library",
|
|
srcs = ["main.go"],
|
|
importpath = "kubevirt.io/containerized-data-importer/tools/cdi-func-test-file-host-init",
|
|
visibility = ["//visibility:private"],
|
|
deps = [
|
|
"//pkg/util:go_default_library",
|
|
"//tests/utils:go_default_library",
|
|
"//vendor/github.com/pkg/errors:go_default_library",
|
|
"//vendor/k8s.io/klog:go_default_library",
|
|
],
|
|
)
|
|
|
|
go_binary(
|
|
name = "cdi-func-test-file-host-init",
|
|
embed = [":go_default_library"],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
container_image(
|
|
name = "cdi-func-test-file-host-init-file-image",
|
|
base = ":cdi-func-test-file-host-init-base-image",
|
|
directory = "/",
|
|
tars = [
|
|
":test-img-tar",
|
|
":test-invalid-img-tar",
|
|
],
|
|
)
|
|
|
|
container_image(
|
|
name = "cdi-func-test-file-host-init-image",
|
|
base = ":cdi-func-test-file-host-init-file-image",
|
|
directory = "/usr/bin",
|
|
entrypoint = [
|
|
"cdi-func-test-file-host-init",
|
|
"-alsologtostderr",
|
|
],
|
|
files = [":cdi-func-test-file-host-init"],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
container_image(
|
|
name = "cdi-func-test-file-host-http-image",
|
|
base = ":cdi-func-test-file-host-http-base-image",
|
|
directory = "/",
|
|
entrypoint = ["nginx"],
|
|
tars = [":nginx-conf-tar"],
|
|
ports = [
|
|
"80",
|
|
"81",
|
|
"82",
|
|
"83",
|
|
],
|
|
cmd = "mkdir -p /usr/share/nginx/html/images/priv",
|
|
env = {
|
|
"container": "",
|
|
"docker": "",
|
|
},
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
pkg_tar(
|
|
name = "test-img-tar",
|
|
srcs = ["//:test-images"],
|
|
mode = "644",
|
|
package_dir = "/tmp/source",
|
|
)
|
|
|
|
pkg_tar(
|
|
name = "test-invalid-img-tar",
|
|
srcs = ["//:test-invalid-images"],
|
|
mode = "644",
|
|
package_dir = "/tmp/source/invalid_qcow_images",
|
|
)
|
|
|
|
filegroup(
|
|
name = "nginx-conf",
|
|
srcs = [
|
|
":htpasswd",
|
|
":nginx.conf",
|
|
],
|
|
)
|
|
|
|
pkg_tar(
|
|
name = "nginx-conf-tar",
|
|
srcs = [":nginx-conf"],
|
|
mode = "644",
|
|
package_dir = "/etc/nginx/",
|
|
)
|