-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-linux-arm-toolchains
- Loading branch information
Showing
26 changed files
with
321 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,33 @@ | ||
load("//oci:defs.bzl", "oci_image") | ||
load("//oci:defs.bzl", "oci_image", "oci_tarball") | ||
|
||
_ARCH = [ | ||
"amd64", | ||
"arm64", | ||
] | ||
|
||
# crane doesn't do the right thing with compressed tarball inputs like .tar.gz or .tar.xz | ||
[ | ||
genrule( | ||
name = "decompress_" + architecture, | ||
srcs = ["@bash_{}//:layer".format(architecture)], | ||
outs = ["_{}.tar".format(architecture)], | ||
cmd = "xz --decompress --stdout $< >$@", | ||
) | ||
for architecture in _ARCH | ||
] | ||
|
||
[ | ||
oci_image( | ||
name = "image_" + architecture, | ||
architecture = architecture, | ||
os = "linux", | ||
tars = ["@bash_{}//:layer".format(architecture)], | ||
tars = ["_{}.tar".format(architecture)], | ||
) | ||
for architecture in [ | ||
"amd64", | ||
"arm64", | ||
] | ||
for architecture in _ARCH | ||
] | ||
|
||
oci_tarball( | ||
name = "tarball", | ||
image = ":image_amd64", | ||
repo_tags = ["test:test"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
load("//oci:defs.bzl", "oci_image", "oci_tarball") | ||
load("@aspect_bazel_lib//lib:testing.bzl", "assert_json_matches") | ||
load("@bazel_skylib//rules:write_file.bzl", "write_file") | ||
|
||
oci_image( | ||
name = "image", | ||
architecture = select({ | ||
"@platforms//cpu:arm64": "arm64", | ||
"@platforms//cpu:x86_64": "amd64", | ||
}), | ||
os = "linux", | ||
) | ||
|
||
repo_tags = [ | ||
"gcr.io/empty_base:latest", | ||
"two:is_a_company", | ||
"three:is_a_crowd", # Used to test support for more than two repo_tags. | ||
] | ||
|
||
oci_tarball( | ||
name = "tarball", | ||
image = ":image", | ||
repo_tags = ":tags_file.txt", # In particular we check whether empty (last line) of the file gets ignored. | ||
) | ||
|
||
genrule( | ||
name = "tar_manifest", | ||
srcs = [":tarball"], | ||
outs = ["manifest.json"], | ||
cmd = "tar -xOf ./$(location :tarball) manifest.json > $@", | ||
) | ||
|
||
write_file( | ||
name = "expected_RepoTags", | ||
out = "expected_RepoTags.json", | ||
content = [str(repo_tags)], | ||
) | ||
|
||
assert_json_matches( | ||
name = "check_tags", | ||
file1 = ":tar_manifest", | ||
file2 = ":expected_RepoTags", | ||
filter1 = ".[0].RepoTags", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gcr.io/empty_base:latest | ||
|
||
|
||
two:is_a_company | ||
|
||
three:is_a_crowd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
schemaVersion: "2.0.0" | ||
|
||
metadataTest: | ||
envVars: | ||
- key: "ENV" | ||
value: "/test" | ||
entrypoint: ["/custom_bin"] | ||
cmd: ["--arg1", "--arg2"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.