Skip to content

Commit

Permalink
Replace macOS 10.15 x86-64 self-hosted runner with 12 GH-hosted (#21417)
Browse files Browse the repository at this point in the history
This removes our use of the self-hosted 10.15 x86-64 runner in favour of
a GitHub-hosted macOS 12 runner, implicitly changing our macOS version
support in the process.

Note: these macOS 12 runners are disappearing in #21333, so I think 2.24
will have to be the last release supporting macOS 12 "properly", and
hopefully we'll have finished that release series before GitHub gets rid
of them.

An alternative that doesn't limit us to GitHub's timelines would be
upgrading OS on the self-hosted runner. I'm disinclined from the
alternative. Landing this PR as-is theoretically allows us to turn off
the self-hosted runner and save money.

Half of #21413
  • Loading branch information
huonw authored Sep 23, 2024
1 parent 4d96bcc commit ae20980
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 58 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/clear_self_hosted_persistent_caches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,6 @@ jobs:
run: du -sh ~/.pex || true; rm -rf ~/.pex || true
- name: df after
run: df -h
clean_macos10_15_x86_64:
runs-on:
- self-hosted
- macOS-10.15-X64
steps:
- name: df before
run: df -h
- name: Deleting ~/Library/Caches
run: du -sh ~/Library/Caches || true; rm -rf ~/Library/Caches || true
- name: Deleting ~/.cache
run: du -sh ~/.cache || true; rm -rf ~/.cache || true
- name: Deleting ~/.nce
run: du -sh ~/.nce || true; rm -rf ~/.nce || true
- name: Deleting ~/.rustup
run: du -sh ~/.rustup || true; rm -rf ~/.rustup || true
- name: Deleting ~/.pex
run: du -sh ~/.pex || true; rm -rf ~/.pex || true
- name: df after
run: df -h
clean_macos11_arm64:
runs-on:
- self-hosted
Expand Down
33 changes: 17 additions & 16 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,18 @@ jobs:
\ needs.release_info.outputs.release-asset-upload-url }}?name=$(basename $WHL)\"\
\ \\\n --data-binary \"@$WHL\";\n"
timeout-minutes: 90
build_wheels_macos10_15_x86_64:
build_wheels_macos11_arm64:
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: false
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: github.repository_owner == 'pantsbuild'
name: Build wheels (macOS10-15-x86_64)
name: Build wheels (macOS11-ARM64)
needs:
- release_info
runs-on:
- self-hosted
- macOS-10.15-X64
- macOS-11-ARM64
steps:
- name: Check out code
uses: actions/checkout@v4
Expand All @@ -195,7 +195,7 @@ jobs:
- name: Cache Rust toolchain
uses: actions/cache@v4
with:
key: macOS10-15-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain')
key: macOS11-ARM64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain')
}}-v2
path: '~/.rustup/toolchains/1.81.0-*
Expand All @@ -220,19 +220,19 @@ jobs:
with:
go-version: 1.19.5
- env:
ARCHFLAGS: -arch x86_64
ARCHFLAGS: -arch arm64
name: Build wheels
run: ./pants run src/python/pants_release/release.py -- build-wheels
- env:
ARCHFLAGS: -arch x86_64
ARCHFLAGS: -arch arm64
name: Build Pants PEX
run: ./pants package src/python/pants:pants-pex
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v4
with:
name: logs-wheels-and-pex-macOS10-15-x86_64
name: logs-wheels-and-pex-macOS11-ARM64
overwrite: 'true'
path: .pants.d/workdir/*.log
- if: needs.release_info.outputs.is-release == 'true'
Expand All @@ -253,24 +253,25 @@ jobs:
\ needs.release_info.outputs.release-asset-upload-url }}?name=$(basename $WHL)\"\
\ \\\n --data-binary \"@$WHL\";\n"
timeout-minutes: 90
build_wheels_macos11_arm64:
build_wheels_macos12_x86_64:
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: false
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: github.repository_owner == 'pantsbuild'
name: Build wheels (macOS11-ARM64)
name: Build wheels (macOS12-x86_64)
needs:
- release_info
runs-on:
- self-hosted
- macOS-11-ARM64
- macos-12
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 10
ref: ${{ needs.release_info.outputs.build-ref }}
- name: Expose Pythons
uses: pantsbuild/actions/expose-pythons@v9
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
with:
Expand All @@ -281,7 +282,7 @@ jobs:
- name: Cache Rust toolchain
uses: actions/cache@v4
with:
key: macOS11-ARM64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain')
key: macOS12-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain')
}}-v2
path: '~/.rustup/toolchains/1.81.0-*
Expand All @@ -306,19 +307,19 @@ jobs:
with:
go-version: 1.19.5
- env:
ARCHFLAGS: -arch arm64
ARCHFLAGS: -arch x86_64
name: Build wheels
run: ./pants run src/python/pants_release/release.py -- build-wheels
- env:
ARCHFLAGS: -arch arm64
ARCHFLAGS: -arch x86_64
name: Build Pants PEX
run: ./pants package src/python/pants:pants-pex
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v4
with:
name: logs-wheels-and-pex-macOS11-ARM64
name: logs-wheels-and-pex-macOS12-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
- if: needs.release_info.outputs.is-release == 'true'
Expand Down Expand Up @@ -347,7 +348,7 @@ jobs:
needs:
- build_wheels_linux_x86_64
- build_wheels_linux_arm64
- build_wheels_macos10_15_x86_64
- build_wheels_macos12_x86_64
- build_wheels_macos11_arm64
- release_info
runs-on: ubuntu-latest
Expand Down
33 changes: 17 additions & 16 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -421,20 +421,20 @@ jobs:
overwrite: 'true'
path: .pants.d/workdir/*.log
timeout-minutes: 90
build_wheels_macos10_15_x86_64:
build_wheels_macos11_arm64:
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: false
MODE: debug
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: ((github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.release == 'true')) && (needs.classify_changes.outputs.docs_only
!= 'true')
name: Build wheels (macOS10-15-x86_64)
name: Build wheels (macOS11-ARM64)
needs:
- classify_changes
runs-on:
- self-hosted
- macOS-10.15-X64
- macOS-11-ARM64
steps:
- name: Check out code
uses: actions/checkout@v4
Expand All @@ -450,7 +450,7 @@ jobs:
- name: Cache Rust toolchain
uses: actions/cache@v4
with:
key: macOS10-15-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
key: macOS11-ARM64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.81.0-*
~/.rustup/update-hashes
Expand All @@ -474,41 +474,42 @@ jobs:
with:
go-version: 1.19.5
- env:
ARCHFLAGS: -arch x86_64
ARCHFLAGS: -arch arm64
name: Build wheels
run: ./pants run src/python/pants_release/release.py -- build-wheels
- env:
ARCHFLAGS: -arch x86_64
ARCHFLAGS: -arch arm64
name: Build Pants PEX
run: ./pants package src/python/pants:pants-pex
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v4
with:
name: logs-wheels-and-pex-macOS10-15-x86_64
name: logs-wheels-and-pex-macOS11-ARM64
overwrite: 'true'
path: .pants.d/workdir/*.log
timeout-minutes: 90
build_wheels_macos11_arm64:
build_wheels_macos12_x86_64:
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: false
MODE: debug
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: ((github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.release == 'true')) && (needs.classify_changes.outputs.docs_only
!= 'true')
name: Build wheels (macOS11-ARM64)
name: Build wheels (macOS12-x86_64)
needs:
- classify_changes
runs-on:
- self-hosted
- macOS-11-ARM64
- macos-12
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Expose Pythons
uses: pantsbuild/actions/expose-pythons@v9
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
with:
Expand All @@ -519,7 +520,7 @@ jobs:
- name: Cache Rust toolchain
uses: actions/cache@v4
with:
key: macOS11-ARM64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
key: macOS12-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.81.0-*
~/.rustup/update-hashes
Expand All @@ -543,19 +544,19 @@ jobs:
with:
go-version: 1.19.5
- env:
ARCHFLAGS: -arch arm64
ARCHFLAGS: -arch x86_64
name: Build wheels
run: ./pants run src/python/pants_release/release.py -- build-wheels
- env:
ARCHFLAGS: -arch arm64
ARCHFLAGS: -arch x86_64
name: Build Pants PEX
run: ./pants package src/python/pants:pants-pex
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v4
with:
name: logs-wheels-and-pex-macOS11-ARM64
name: logs-wheels-and-pex-macOS12-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
timeout-minutes: 90
Expand Down Expand Up @@ -700,8 +701,8 @@ jobs:
- bootstrap_pants_macos12_x86_64
- build_wheels_linux_arm64
- build_wheels_linux_x86_64
- build_wheels_macos10_15_x86_64
- build_wheels_macos11_arm64
- build_wheels_macos12_x86_64
- check_labels
- check_release_notes
- classify_changes
Expand Down
1 change: 1 addition & 0 deletions docs/notes/2.24.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ We offer [formal sponsorship tiers for companies](https://www.pantsbuild.org/spo
### Deprecations

- **Python 2.7**: As announced in the v2.23.x release series, Pants v2.24 and later are not proactively tested in CI with Python 2.7 since [Python 2.7 is no longer supported by its maintainers as of 1 January 2020](https://www.python.org/doc/sunset-python-2/). While Pants may continue to work with Python 2.7 in the near term, Pants no longer officially supports use of Python 2.7, and, consequently, any remaining support for Python 2.7 may "bit rot" and diverge over time. Contributions to fix issues with Python 2.7 support will continue to be accepted, but will depend on any community contributions and will not consitute continued official support for Python 2.7.
- **macOS verisons**: as announced in the v2.23.x release series, Pants v2.24 is built on macOS 12 and so may not work on versions of macOS 10.15 and 11 (which Apple no longer supports).


### General
Expand Down
11 changes: 4 additions & 7 deletions src/python/pants_release/generate_github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,15 @@ def action(name: str, node16_compat: bool = False) -> str:
class Platform(Enum):
LINUX_X86_64 = "Linux-x86_64"
LINUX_ARM64 = "Linux-ARM64"
MACOS10_15_X86_64 = "macOS10-15-x86_64"
# the oldest version of macOS supported by GitHub self-hosted runners
MACOS12_X86_64 = "macOS12-x86_64"
MACOS11_ARM64 = "macOS11-ARM64"


GITHUB_HOSTED = {Platform.LINUX_X86_64, Platform.MACOS12_X86_64}
SELF_HOSTED = {Platform.LINUX_ARM64, Platform.MACOS10_15_X86_64, Platform.MACOS11_ARM64}
SELF_HOSTED = {Platform.LINUX_ARM64, Platform.MACOS11_ARM64}
# We control these runners, so we preinstall and expose python on them.
HAS_PYTHON = {Platform.LINUX_ARM64, Platform.MACOS10_15_X86_64, Platform.MACOS11_ARM64}
HAS_PYTHON = {Platform.LINUX_ARM64, Platform.MACOS11_ARM64}
CARGO_AUDIT_IGNORED_ADVISORY_IDS = (
"RUSTSEC-2020-0128", # returns a false positive on the cache crate, which is a local crate not a 3rd party crate
)
Expand Down Expand Up @@ -447,8 +446,6 @@ def runs_on(self) -> list[str]:
ret += ["macos-12"]
elif self.platform == Platform.MACOS11_ARM64:
ret += ["macOS-11-ARM64"]
elif self.platform == Platform.MACOS10_15_X86_64:
ret += ["macOS-10.15-X64"]
elif self.platform == Platform.LINUX_X86_64:
ret += ["ubuntu-22.04"]
elif self.platform == Platform.LINUX_ARM64:
Expand All @@ -464,7 +461,7 @@ def runs_on(self) -> list[str]:

def platform_env(self):
ret = {}
if self.platform in {Platform.MACOS10_15_X86_64, Platform.MACOS12_X86_64}:
if self.platform in {Platform.MACOS12_X86_64}:
# Works around bad `-arch arm64` flag embedded in Xcode 12.x Python interpreters on
# intel machines. See: https://github.com/giampaolo/psutil/issues/1832
ret["ARCHFLAGS"] = "-arch x86_64"
Expand Down Expand Up @@ -1009,7 +1006,7 @@ def build_wheels_jobs(*, for_deploy_ref: str | None = None, needs: list[str] | N
return {
**build_wheels_job(Platform.LINUX_X86_64, for_deploy_ref, needs),
**build_wheels_job(Platform.LINUX_ARM64, for_deploy_ref, needs),
**build_wheels_job(Platform.MACOS10_15_X86_64, for_deploy_ref, needs),
**build_wheels_job(Platform.MACOS12_X86_64, for_deploy_ref, needs),
**build_wheels_job(Platform.MACOS11_ARM64, for_deploy_ref, needs),
}

Expand Down

0 comments on commit ae20980

Please sign in to comment.