Skip to content

Commit

Permalink
refactor: make crane write blobs to disk (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn authored Nov 16, 2023
1 parent 74dedd0 commit bf596e6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bazel_dep(name = "bazel_skylib", version = "1.4.1")
bazel_dep(name = "platforms", version = "0.0.5")

oci = use_extension("//oci:extensions.bzl", "oci")
oci.toolchains(crane_version = "v0.14.0")
oci.toolchains(crane_version = "v0.16.1")
use_repo(oci, "oci_auth_config", "oci_crane_registry_toolchains", "oci_crane_toolchains")

register_toolchains("@oci_crane_toolchains//:all", "@oci_crane_registry_toolchains//:all")
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ Note that these examples rely on the setup code in the `/WORKSPACE` file in the
rules_oci supports two different registry implementation for the temporary storage within actions spawned by bazel.

1. By default we recommend using `zot` as it stores blobs on disk, however it doesn't support `Docker`-format images.
2. `crane` is memory hungry as it stores blobs in memory, leading to high memory usage.
However it supports both `OCI` and `Docker` formats which is quite useful for using `Docker` images pulled from the registries such as DockerHub.
2. `crane` is a better alternative as it supports both `OCI` and `Docker` formats which is required to make images with `Docker` media types work. However, it might not support everything that zot does.

## Public API Docs

Expand Down
2 changes: 1 addition & 1 deletion oci/private/registry/crane_launcher.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function start_registry() {
local output="$2"
local deadline="${3:-5}"
"${CRANE_REGISTRY_BIN}" registry serve>> $output 2>&1 &
"${CRANE_REGISTRY_BIN}" registry serve --blobs-to-disk >> $output 2>&1 &
local timeout=$((SECONDS+${deadline}))

Expand Down
14 changes: 14 additions & 0 deletions oci/private/versions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

# WARNING: only v0.12.0 and above is supported.
CRANE_VERSIONS = {
"v0.16.1": {
"go-containerregistry-0": "sha256-KHa1NgQVE4cW1YN6aeHBFhgOSOz2KmP1MBw1HVoS+Zs=",
"darwin_arm64": "sha256-OgSfRI2SluHc01ZsWALiQbzU4Yc/mYoSKCRlXiDg10Q=",
"darwin_x86_64": "sha256-0AynKTFcu5FKFFQl2y49eoFsXB+DVFlxiBV64heyN34=",
"linux_arm64": "sha256-niJneTd6IHE/FqyU3sn2wX9piDTqQMM6bIb53ohFcis=",
"linux_armv6": "sha256-submkJ8j5DTlRA0E8om9KQ9+mMJBQotG0BAsYpn6NQ8=",
"linux_i386": "sha256-XXZ5/2Oz1poXNIbY9IOomRt2IDPAKN689md3nU5LqOU=",
"linux_ppc64le": "sha256-p7xthOifRHjqDB8owPkVlkAJJVUKYWeKQhIvtx9e/z8=",
"linux_s390x": "sha256-7yLdSqxExI4cSRIbQJaPfILy0Y+7Ze6fNmQpLb9abWk=",
"linux_x86_64": "sha256-EV3ITRTFrcicFuP6KX6U8GqexJK7Hccw2mJIULd8m+I=",
"windows_arm64": "sha256-H4CfiYT15fh9E9VRTeLYlv3/Ys+1Rnr2Gp1xAqFtpWE=",
"windows_armv6": "sha256-j6Oa4+kBYGOub0jlMSfUGNtpoCR0G/kACh4YB456PGE=",
"windows_x86_64": "sha256-iU9Nm6K8+07QE/f72n+WL3yS2+84/dFy1GdgdfTopRk="
},
"v0.15.2": {
"darwin_arm64": "sha256-XPquVFIWvxd6ZKhSo/HxI7lYBDjOYIoOnNy02uK6F0c=",
"darwin_x86_64": "sha256-xzpmoZ4cwx0jKP07UvMZgZqb9sOKOA3/TfTeq6AsFHc=",
Expand Down

0 comments on commit bf596e6

Please sign in to comment.