|
266 | 266 | # the platform name in a human readable format, and a the buildkite-agent's
|
267 | 267 | # working directory.
|
268 | 268 | 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 |
| - }, |
290 | 269 | "rockylinux8": {
|
291 | 270 | "name": "Rocky Linux 8",
|
292 | 271 | "emoji-name": ":rocky: Rocky Linux 8",
|
@@ -2713,30 +2692,13 @@ def execute_command(
|
2713 | 2692 | def create_step(
|
2714 | 2693 | label, commands, platform, shards=1, soft_fail=None, concurrency=None, concurrency_group=None
|
2715 | 2694 | ):
|
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") |
2740 | 2702 |
|
2741 | 2703 | if "docker-image" in PLATFORMS[platform]:
|
2742 | 2704 | step = create_docker_step(
|
@@ -2834,6 +2796,31 @@ def create_docker_step(
|
2834 | 2796 | return step
|
2835 | 2797 |
|
2836 | 2798 |
|
| 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 | + |
2837 | 2824 | def print_project_pipeline(
|
2838 | 2825 | configs,
|
2839 | 2826 | project_name,
|
|
0 commit comments