Skip to content

Commit f34b3f7

Browse files
authored
Remove CentOS 7 support... (#2305)
...and force all remaining CentOS jobs to use Rocky Linux instead. This workaround mostly aims at Bazel release branches that contain old versions of CI configurations. We should remove it after a brief migration period. Progress towards #2272
1 parent d0358a1 commit f34b3f7

File tree

3 files changed

+32
-155
lines changed

3 files changed

+32
-155
lines changed

buildkite/bazelci.py

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -266,27 +266,6 @@
266266
# the platform name in a human readable format, and a the buildkite-agent's
267267
# working directory.
268268
PLATFORMS = {
269-
"centos7": {
270-
"name": "CentOS 7",
271-
"emoji-name": ":centos: CentOS 7",
272-
"publish_binary": [],
273-
"docker-image": f"gcr.io/{DOCKER_REGISTRY_PREFIX}/centos7",
274-
"python": "python3.6",
275-
},
276-
"centos7_java11": {
277-
"name": "CentOS 7 (OpenJDK 11, gcc 4.8.5)",
278-
"emoji-name": ":centos: CentOS 7 (OpenJDK 11, gcc 4.8.5)",
279-
"publish_binary": [],
280-
"docker-image": f"gcr.io/{DOCKER_REGISTRY_PREFIX}/centos7-java11",
281-
"python": "python3.6",
282-
},
283-
"centos7_java11_devtoolset10": {
284-
"name": "CentOS 7 (OpenJDK 11, gcc 10.2.1)",
285-
"emoji-name": ":centos: CentOS 7 (OpenJDK 11, gcc 10.2.1)",
286-
"publish_binary": [],
287-
"docker-image": f"gcr.io/{DOCKER_REGISTRY_PREFIX}/centos7-java11-devtoolset10",
288-
"python": "python3.6",
289-
},
290269
"rockylinux8": {
291270
"name": "Rocky Linux 8",
292271
"emoji-name": ":rocky: Rocky Linux 8",
@@ -2713,30 +2692,13 @@ def execute_command(
27132692
def create_step(
27142693
label, commands, platform, shards=1, soft_fail=None, concurrency=None, concurrency_group=None
27152694
):
2716-
# TODO: remove
2717-
if "centos" in platform:
2718-
tmpdir = tempfile.mkdtemp()
2719-
try:
2720-
basename = "{}_{}_{}_{}.txt".format(os.getenv("BUILDKITE_ORGANIZATION_SLUG"),
2721-
os.getenv("BUILDKITE_PIPELINE_SLUG"),
2722-
os.getenv("BUILDKITE_BUILD_NUMBER"),
2723-
os.getenv("BUILDKITE_JOB_ID"))
2724-
path = os.path.join(tmpdir, basename)
2725-
with open(path, "wt") as f:
2726-
f.write(platform)
2727-
2728-
execute_command(
2729-
[
2730-
gsutil_command(),
2731-
"cp",
2732-
path,
2733-
f"gs://bazel-centos-deprecation/{basename}",
2734-
]
2735-
)
2736-
except Exception as ex:
2737-
eprint(ex)
2738-
finally:
2739-
shutil.rmtree(tmpdir)
2695+
# TODO(#2272): remove after a migration period
2696+
if "centos7" in platform:
2697+
log_deprecated_platform_usage(platform)
2698+
# Move all CentOS workloads to Rocky Linux.
2699+
# A simple "replace" works since our Rocky Linux images
2700+
# follow the same naming convention as the CentOS ones.
2701+
platform = platform.replace("centos7", "rockylinux8")
27402702

27412703
if "docker-image" in PLATFORMS[platform]:
27422704
step = create_docker_step(
@@ -2834,6 +2796,31 @@ def create_docker_step(
28342796
return step
28352797

28362798

2799+
def log_deprecated_platform_usage(platform):
2800+
tmpdir = tempfile.mkdtemp()
2801+
try:
2802+
basename = "{}_{}_{}_{}.txt".format(os.getenv("BUILDKITE_ORGANIZATION_SLUG"),
2803+
os.getenv("BUILDKITE_PIPELINE_SLUG"),
2804+
os.getenv("BUILDKITE_BUILD_NUMBER"),
2805+
os.getenv("BUILDKITE_JOB_ID"))
2806+
path = os.path.join(tmpdir, basename)
2807+
with open(path, "wt") as f:
2808+
f.write(platform)
2809+
2810+
execute_command(
2811+
[
2812+
gsutil_command(),
2813+
"cp",
2814+
path,
2815+
f"gs://bazel-centos-deprecation/{basename}",
2816+
]
2817+
)
2818+
except Exception as ex:
2819+
eprint(ex)
2820+
finally:
2821+
shutil.rmtree(tmpdir)
2822+
2823+
28372824
def print_project_pipeline(
28382825
configs,
28392826
project_name,

buildkite/docker/centos7/Dockerfile

Lines changed: 0 additions & 102 deletions
This file was deleted.

buildkite/docker/centos7/google-cloud-sdk.repo

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)