Skip to content

Commit

Permalink
Add more images
Browse files Browse the repository at this point in the history
  • Loading branch information
sluongng committed Sep 27, 2024
1 parent 854bb32 commit ae1c79d
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 0 deletions.
24 changes: 24 additions & 0 deletions codesearch/cmd/server/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")

go_library(
name = "server_lib",
Expand Down Expand Up @@ -51,3 +53,25 @@ container_push(
tag_file = "//deployment:image_tag_file",
tags = ["manual"], # Don't include this target in wildcard patterns
)

pkg_tar(
name = "tar",
srcs = [":server"],
)

oci_image(
name = "oci_image",
target_compatible_with = ["@platforms//os:linux"],
base = "@buildbuddy_go_oci_image_base",
tars = [":tar"],
entrypoint = ["/server"],
visibility = ["//visibility:public"],
)

oci_push(
name = "push",
image = ":oci_image",
repository = "gcr.io/flame-build/codesearch-oci",
# Set the image tag with the bazel run flag "--//deployment:image_tag=TAG"
remote_tags = "//deployment:oci_tag_file",
)
16 changes: 16 additions & 0 deletions enterprise/server/cmd/cache_proxy/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")

package(default_visibility = ["//enterprise:__subpackages__"])

Expand Down Expand Up @@ -49,3 +51,17 @@ container_image(
tags = ["manual"],
visibility = ["//visibility:public"],
)

pkg_tar(
name = "tar",
srcs = [":cache_proxy"],
)

oci_image(
name = "oci_image",
target_compatible_with = ["@platforms//os:linux"],
base = "@buildbuddy_go_oci_image_base",
tars = [":tar"],
entrypoint = ["/cache_proxy"],
visibility = ["//visibility:public"],
)
25 changes: 25 additions & 0 deletions enterprise/server/cmd/server/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")

# gazelle:default_visibility //enterprise:__subpackages__,@buildbuddy_internal//:__subpackages__
package(default_visibility = [
Expand Down Expand Up @@ -130,3 +132,26 @@ container_image(
tags = ["manual"],
visibility = ["//visibility:public"],
)

pkg_tar(
name = "tar",
srcs = [
":buildbuddy",
],
remap_paths = {
"/buildbuddy": "/app/server/cmd/buildbuddy/buildbuddy",
},
symlinks = {
"config.yaml": "app/enterprise/server/cmd/server/buildbuddy.runfiles/buildbuddy/enterprise/config/buildbuddy.release.yaml",
"buildbuddy": "tmp",
},
)

oci_image(
name = "oci_image",
target_compatible_with = ["@platforms//os:linux"],
base = "@buildbuddy_go_oci_image_base",
tars = [":tar"],
entrypoint = ["/app/server/cmd/buildbuddy/buildbuddy"],
visibility = ["//visibility:public"],
)
24 changes: 24 additions & 0 deletions enterprise/tools/rbeperf/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")

package(default_visibility = ["//enterprise:__subpackages__"])

Expand Down Expand Up @@ -57,3 +59,25 @@ container_push(
tag_file = "//deployment:image_tag_file",
tags = ["manual"], # Don't include this target in wildcard patterns
)

pkg_tar(
name = "tar",
srcs = [":rbeperf"],
)

oci_image(
name = "oci_image",
target_compatible_with = ["@platforms//os:linux"],
base = "@buildbuddy_go_oci_image_base",
tars = [":tar"],
entrypoint = ["/rbeperf"],
visibility = ["//visibility:public"],
)

oci_push(
name = "push",
image = ":oci_image",
repository = "gcr.io/flame-build/rbeperf-oci",
# Set the image tag with the bazel run flag "--//deployment:image_tag=TAG"
remote_tags = "//deployment:oci_tag_file",
)
23 changes: 23 additions & 0 deletions tools/cacheload/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")

go_library(
name = "cacheload_lib",
Expand Down Expand Up @@ -55,3 +57,24 @@ container_push(
tag_file = "//deployment:image_tag_file",
tags = ["manual"], # Don't include this target in wildcard patterns
)

pkg_tar(
name = "tar",
srcs = [":cacheload"],
)

oci_image(
name = "oci_image",
target_compatible_with = ["@platforms//os:linux"],
base = "@buildbuddy_go_oci_image_base",
tars = [":tar"],
entrypoint = ["/cacheload"],
)

oci_push(
name = "push",
image = ":oci_image",
repository = "gcr.io/flame-build/cacheload-oci",
# Set the image tag with the bazel run flag "--//deployment:image_tag=TAG"
remote_tags = "//deployment:oci_tag_file",
)
24 changes: 24 additions & 0 deletions tools/smarter_device_manager/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")

# We use this internally so create an alias here to
# ensure our changes don't break the internal build.
Expand Down Expand Up @@ -27,3 +29,25 @@ container_push(
"manual",
],
)

pkg_tar(
name = "tar",
srcs = [":smarter-device-manager"],
)

oci_image(
name = "oci_image",
target_compatible_with = ["@platforms//os:linux"],
base = "@buildbuddy_go_oci_image_base",
tars = [":tar"],
entrypoint = ["/smarter-device-manager"],
visibility = ["//visibility:public"],
)

oci_push(
name = "push",
image = ":oci_image",
repository = "gcr.io/flame-build/smarter-device-manager-oci",
# Set the image tag with the bazel run flag "--//deployment:image_tag=TAG"
remote_tags = "//deployment:oci_tag_file",
)
24 changes: 24 additions & 0 deletions tools/tcpproxy/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")

go_library(
name = "tcpproxy_lib",
Expand Down Expand Up @@ -35,3 +37,25 @@ container_push(
tag_file = "//deployment:image_tag_file",
tags = ["manual"], # Don't include this target in wildcard patterns
)

pkg_tar(
name = "tar",
srcs = [":tcpproxy"],
)

oci_image(
name = "oci_image",
target_compatible_with = ["@platforms//os:linux"],
base = "@buildbuddy_go_oci_image_base",
tars = [":tar"],
entrypoint = ["/tcpproxy"],
visibility = ["//visibility:public"],
)

oci_push(
name = "push",
image = ":oci_image",
repository = "gcr.io/flame-build/tcpproxy-oci",
# Set the image tag with the bazel run flag "--//deployment:image_tag=TAG"
remote_tags = "//deployment:oci_tag_file",
)

0 comments on commit ae1c79d

Please sign in to comment.