From 87cc49afdc461a8ba2d10c8214a99ea0020947f1 Mon Sep 17 00:00:00 2001 From: Vinnie Magro Date: Thu, 5 Dec 2024 09:36:57 -0800 Subject: [PATCH] [antlir][oss] centos10 flavor Summary: Title Test Plan: Export to a PR Differential Revision: D66826628 --- .buckconfig.d/antlir.generated.buckconfig | 3 +- antlir/antlir2/bzl/image/cfg.bzl | 5 ++- flavor/centos10/BUCK | 55 +++++++++++++++++++++++ 3 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 flavor/centos10/BUCK diff --git a/.buckconfig.d/antlir.generated.buckconfig b/.buckconfig.d/antlir.generated.buckconfig index 310020d7de..e9d8b55776 100644 --- a/.buckconfig.d/antlir.generated.buckconfig +++ b/.buckconfig.d/antlir.generated.buckconfig @@ -10,5 +10,4 @@ [external_cell_gh_facebookincubator_antlir_generated] git_origin = https://github.com/facebookincubator/antlir - commit_hash = ec5146ecfa9bc30d411ed99d3b31570dccfd5d38 - + commit_hash = f49e2b13d169eeee3ca78e2b71ae3752522b5b02 diff --git a/antlir/antlir2/bzl/image/cfg.bzl b/antlir/antlir2/bzl/image/cfg.bzl index 145a0bd759..9a720eb416 100644 --- a/antlir/antlir2/bzl/image/cfg.bzl +++ b/antlir/antlir2/bzl/image/cfg.bzl @@ -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", diff --git a/flavor/centos10/BUCK b/flavor/centos10/BUCK new file mode 100644 index 0000000000..447c6f7f00 --- /dev/null +++ b/flavor/centos10/BUCK @@ -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 + """, +)