Skip to content

Commit

Permalink
chore: port #650 to 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Jul 12, 2024
1 parent 4b843d6 commit 227ac26
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/image.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions examples/assertion/big_image/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ N_LAYERS = 5
oci_image(
name = "extended",
base = ":base",
# Tell Bazel to reserve more than the default 250MB of RAM for the OCIImage action
resource_set = "mem_8g",
tags = ["manual"],
tars = [":layer_%s" % i for i in range(N_LAYERS)],
)
1 change: 1 addition & 0 deletions oci/private/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ bzl_library(
],
deps = [
":util",
"@aspect_bazel_lib//lib:resource_sets",
"@bazel_features//:features",
],
)
Expand Down
6 changes: 4 additions & 2 deletions oci/private/image.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"Implementation details for image rule"

load("@aspect_bazel_lib//lib:resource_sets.bzl", "resource_set", "resource_set_attr")
load("@bazel_features//:features.bzl", "bazel_features")
load("//oci/private:util.bzl", "util")
load("util.bzl", "util")

_ACCEPTED_TAR_EXTENSIONS = [
".tar",
Expand Down Expand Up @@ -248,6 +249,7 @@ def _oci_image_impl(ctx):
],
mnemonic = "OCIImage",
progress_message = "OCI Image %{label}",
resource_set = resource_set(ctx.attr),
toolchain = None,
)

Expand All @@ -260,7 +262,7 @@ def _oci_image_impl(ctx):

oci_image = rule(
implementation = _oci_image_impl,
attrs = _attrs,
attrs = dict(_attrs, **resource_set_attr),
doc = _DOC,
toolchains = [
"@aspect_bazel_lib//lib:jq_toolchain_type",
Expand Down

0 comments on commit 227ac26

Please sign in to comment.