Skip to content

Commit

Permalink
[antlir][oss] centos10 flavor
Browse files Browse the repository at this point in the history
Summary: Title

Test Plan: Export to a PR

Differential Revision: D66826628
  • Loading branch information
vmagro authored and facebook-github-bot committed Dec 5, 2024
1 parent 9602d91 commit 87cc49a
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .buckconfig.d/antlir.generated.buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@

[external_cell_gh_facebookincubator_antlir_generated]
git_origin = https://github.com/facebookincubator/antlir
commit_hash = ec5146ecfa9bc30d411ed99d3b31570dccfd5d38

commit_hash = f49e2b13d169eeee3ca78e2b71ae3752522b5b02
5 changes: 4 additions & 1 deletion antlir/antlir2/bzl/image/cfg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ def attrs_selected_by_cfg():
# default_os (TODO(T168220644)) and this is not an option, this
# can be removed.
"DEFAULT": None,
"antlir//antlir/antlir2/os:centos10": internal_external(
fb = "antlir//antlir/antlir2/facebook/flavor/centos10:centos10",
oss = "//flavor/centos10:centos10",
),
"antlir//antlir/antlir2/os:centos9": internal_external(
fb = "antlir//antlir/antlir2/facebook/flavor/centos9:centos9",
oss = "//flavor/centos9:centos9",
),
} | internal_external(
fb = {
"antlir//antlir/antlir2/os:centos10": "antlir//antlir/antlir2/facebook/flavor/centos10:centos10",
"antlir//antlir/antlir2/os:centos8": "antlir//antlir/antlir2/facebook/flavor/centos8:centos8",
"antlir//antlir/antlir2/os:eln": "antlir//antlir/antlir2/facebook/flavor/eln:eln",
"antlir//antlir/antlir2/os:none": "antlir//antlir/antlir2/flavor:none",
Expand Down
55 changes: 55 additions & 0 deletions flavor/centos10/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
load("//antlir/antlir2/bzl/flavor:defs.bzl", "flavor")
load("//antlir/bzl:build_defs.bzl", "buck_genrule", "http_file")
load("//antlir/antlir2/bzl/image:defs.bzl", "image")
load("//antlir/antlir2/bzl/package:defs.bzl", "package")
load("//antlir/antlir2/bzl/image:build_appliance.bzl", "build_appliance")

flavor(
name = "centos10",
default_build_appliance = ":build-appliance.prebuilt",
default_dnf_repo_set = "generated//snapshot/rpm/centos10:repos",
default_dnf_versionlock = "//antlir/antlir2/package_managers/dnf/build_appliance:empty-dnf-versionlock.json",
visibility = ["PUBLIC"],
)

sha256 = "2fc8bca9d8609a594d6258d47b93f17dad2f5ff98bc2129f5794b9a98e66d40a"
sha1 = "712adb0f0a06bc55a14200b6a58adc11a31de47f"

http_archive(
name = "build-appliance.tar.zst",
urls = [
"https://antlir.s3.us-east-2.amazonaws.com/build_appliance/" +
"centos10_{}.tar.zst".format(sha256),
],
sha256 = sha256,
sha1 = sha1,
)

build_appliance(
name = "build-appliance.prebuilt",
src = ":build-appliance.tar.zst",
visibility = [
"antlir//antlir/antlir2/flavor:none",
],
)

image.layer(
name = "build-appliance",
build_appliance = ":build-appliance.prebuilt",
features = [
"//antlir/antlir2/build_appliance:features",
],
)

package.unprivileged_dir(
name = "build-appliance.dir",
layer = ":build-appliance",
)

buck_genrule(
name = "build-appliance.impl.tar.zst",
cmd = """
tar -cf $TMP/ba.tar -C $(location :build-appliance.dir) .
zstd $TMP/ba.tar -o $OUT
""",
)

0 comments on commit 87cc49a

Please sign in to comment.