...

Text file src/edge-infra.dev/cmd/sds/novnc/BUILD.bazel

Documentation: edge-infra.dev/cmd/sds/novnc

     1load("@container_structure_test//:defs.bzl", "container_structure_test")
     2load("@io_bazel_rules_go//go:def.bzl", "go_test")
     3load("@rules_apko//apko:defs.bzl", "apko_image")
     4load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")
     5load("@rules_pkg//:pkg.bzl", "pkg_tar")
     6load("//hack/build/rules/container:index.bzl", "container_push")
     7
     8apko_image(
     9    name = "novnc_base",
    10    config = "apko.yaml",
    11    contents = "@novnc_lock//:contents",
    12    tag = "novnc_base:latest",
    13    tags = ["requires-network"],
    14)
    15
    16pkg_tar(
    17    name = "nginx_conf",
    18    empty_dirs = ["/etc/nginx/conf.d"],
    19    extension = "tgz",
    20    files = {
    21        ":runNginx.sh": "/bin/runNginx.sh",
    22        ":nginx/nginx.conf": "/etc/nginx/nginx.conf",
    23        ":novnc/favicon.svg": "/usr/share/nginx/html/novnc/favicon.svg",
    24        ":novnc/visibility.svg": "/usr/share/nginx/html/novnc/visibility.svg",
    25        ":novnc/visibility_off.svg": "/usr/share/nginx/html/novnc/visibility_off.svg",
    26        ":novnc/vnc_lite.html": "/usr/share/nginx/html/novnc/vnc_lite.html",
    27    },
    28    symlinks = {
    29        "/var/log/nginx/access.log": "/dev/stdout",
    30        "/var/log/nginx/error.log": "/dev/stderr",
    31    },
    32    tags = [
    33        "manual",
    34        "no-remote-cache",
    35    ],
    36)
    37
    38oci_image(
    39    name = "novnc-client",
    40    base = ":novnc_base",
    41    tars = [
    42        "@novnc//:novnc",
    43        ":nginx_conf",
    44    ],
    45)
    46
    47oci_load(
    48    name = "novnc-client-load",
    49    image = ":novnc-client",
    50    repo_tags = ["novnc_client:latest"],
    51)
    52
    53filegroup(
    54    name = "novnc-client.tar",
    55    srcs = [":novnc-client-load"],
    56    output_group = "tarball",
    57)
    58
    59container_structure_test(
    60    name = "novnc-client-test",
    61    configs = [":novnc-client-test.yaml"],
    62    driver = "tar",
    63    image = ":novnc-client.tar",
    64)
    65
    66container_push(
    67    image = ":novnc-client",
    68    image_name = "novnc",
    69    repository_file = "//hack/build/rules/container:workloads-repo",
    70    tags = [
    71        "manual",
    72        "no-remote-cache",
    73    ],
    74    visibility = ["//visibility:public"],
    75)
    76
    77go_test(
    78    name = "novnc_test",
    79    srcs = ["novnc_test.go"],
    80    data = [
    81        "//hack/tools:etcd",
    82        "//hack/tools:kube-apiserver",
    83        "//hack/tools:kubectl",
    84    ],
    85    embedsrcs = [
    86        "testdata/kustomization_manifests.yaml",
    87        "testdata/local_manifests.yaml",
    88        "testdata/README.md",
    89    ],
    90    tags = [
    91        "integration",
    92        "needs-f2-refactor",
    93        "requires-network",
    94    ],
    95    visibility = ["//visibility:public"],
    96    deps = [
    97        "//pkg/k8s/testing/kmp",
    98        "//pkg/sds/k8s/daemonsetdns/daemonsetdnstest",
    99        "//test/f2",
   100        "//test/f2/integration",
   101        "//test/f2/x/ktest",
   102        "//test/f2/x/ktest/envtest",
   103        "//test/f2/x/ktest/kustomization",
   104        "@com_github_gorilla_websocket//:websocket",
   105        "@com_github_stretchr_testify//assert",
   106        "@io_k8s_api//core/v1:core",
   107        "@tools_gotest_v3//poll",
   108    ],
   109)
   110
   111genrule(
   112    name = "novnc_local_copy",
   113    srcs = [
   114        "//config/pallets/sds/vnc/novnc/local",
   115        "//cmd/sds/novnc/wsserver:kustomization",
   116    ],
   117    outs = [
   118        "testdata/kustomization_manifests.yaml",
   119        "testdata/local_manifests.yaml",
   120    ],
   121    cmd = "mkdir -p $(RULEDIR)/testdata/ && cp $(SRCS) $(RULEDIR)/testdata/",
   122)

View as plain text