Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python/ci] Stop wheel-smoke-test failures for MacOS > 11 #2620

Merged
merged 25 commits into from
May 23, 2024

Conversation

johnkerl
Copy link
Member

@johnkerl johnkerl commented May 22, 2024

Problem

Our current package-release CI is broken. It requires manual wheel-publish as at
https://github.com/single-cell-data/TileDB-SOMA/wiki/PyPI-packaging-notes

CI failures are like
https://github.com/single-cell-data/TileDB-SOMA/actions/runs/9189052757
following the well-intentioned but fateful #2491.

Also nightly wheel-build failures such as #2630.

Cause

Debugging reveals:

Attempted solutions

  • ❌ Setting the CMAKE_OSX_DEPLOYMENT_TARGET: "10.9" in our CI YAML's env does not help since in [c++] Refactor SOMAArray and SOMAGroup to inherit from SOMAObject #2124 we set -mmacosx-version-min=11.0 to support usage of C++17 feature std::filesystem::path, which overrides the env
  • ❌ Having our CI YAML copy files like tiledbsoma-VERSIONHERE-cp311-cp311-macosx_11_0_arm64.whl to tiledbsoma-VERSIONHERE-cp311-cp311-macosx_14_0_arm64.whl does not work, and in fact is a step in the wrong direction: since macos14 self-reports as 10.9 within pip install as shown above.
  • ❌ Having our CI YAML rename files like tiledbsoma-VERSIONHERE-cp311-cp311-macosx_11_0_arm64.whl to tiledbsoma-VERSIONHERE-cp311-cp311-macosx_10_9_arm64.whl does work, since macos 14 self-reports as 10.9 at pip install time.
    • ✅ Works on my laptop with macos14 and Python 3.9
    • ❌ Fails in CI with macos14 and Python 3.11
    • ❌ Fails in macos-on-macos Docker on my laptop with Python 3.11 (see below)

Laptop details

With macos 14 and Python 3.9:

laptop$ sw_vers
ProductName:		macOS
ProductVersion:		14.5
BuildVersion:		23F79

laptop$ python --version
Python 3.9.13

laptop$ ll | grep macos | grep x86
-rw-r--r--@ 1 johnkerl  staff  24547997 May 21 22:50 tiledbsoma-1.11.2-cp310-cp310-macosx_11_0_x86_64.whl
-rw-r--r--@ 1 johnkerl  staff  24549656 May 21 22:50 tiledbsoma-1.11.2-cp311-cp311-macosx_11_0_x86_64.whl
-rw-r--r--@ 1 johnkerl  staff  24547829 May 21 22:50 tiledbsoma-1.11.2-cp38-cp38-macosx_11_0_x86_64.whl
-rw-r--r--@ 1 johnkerl  staff  24548029 May 21 22:50 tiledbsoma-1.11.2-cp39-cp39-macosx_11_0_x86_64.whl
-rw-r--r--@ 1 johnkerl  staff  97615624 May 21 18:53 wheels-macos-x86_64.zip

laptop$ pip install tiledbsoma-1.11.2-cp39-cp39-macosx_11_0_x86_64.whl
ERROR: tiledbsoma-1.11.2-cp39-cp39-macosx_11_0_x86_64.whl is not a supported wheel on this platform.

laptop$ cp tiledbsoma-1.11.2-cp39-cp39-macosx_11_0_x86_64.whl tiledbsoma-1.11.2-cp39-cp39-macosx_10_9_x86_64.whl

laptop$ pip install tiledbsoma-1.11.2-cp39-cp39-macosx_10_9_x86_64.whl
Processing ./tiledbsoma-1.11.2-cp39-cp39-macosx_10_9_x86_64.whl

Note this exact logic -- successful on laptop -- fails as of
https://github.com/single-cell-data/TileDB-SOMA/actions/runs/9198109199/job/25300662543
for commit d793416

Using https://hub.docker.com/r/sickcodes/docker-osx -- macos-on-macos Docker -- with Python 3.11 I found that the trick which worked on my laptop (macos 14 with Python 3.9), and which fails in CI here with macos 14 and Python 3.11, also fails in sickcodes/docker-osx with Python 3.11.

In short it seems that the renaming trick from https://stackoverflow.com/questions/65888506/error-wheel-whl-is-not-a-supported-wheel-on-this-platform works in Python 3.9 but not 3.11.

Also note: supposedly-macos-on-macos sickcodes/docker-osx:latest isn't really:

[arch@041a7b1338f2 OSX-KVM]$ uname -a
Linux 041a7b1338f2 5.10.104-linuxkit #1 SMP Wed Mar 9 19:05:23 UTC 2022 x86_64 GNU/Linux

Also, why doesn't pip install tiledbsoma (from PyPI) fail on my Mac?

johnkerl@exade[prod][][~]$ pip install tiledbsoma
Collecting tiledbsoma
  Downloading tiledbsoma-1.11.1.tar.gz (291 kB)
...
Building wheels for collected packages: tiledbsoma
  Building wheel for tiledbsoma (pyproject.toml) ... |
...

-- it doesn't appear to be using the .whl file ...

Also note: on my arm64 mac with macos-14:

$ python -c 'from distutils import util; print(util.get_platform())'
macosx-14-arm64

However even macos12+arm64 runners in GHA misbehave:
https://github.com/single-cell-data/TileDB-SOMA/actions/runs/9198915278/job/25302688619

distutil.util.get_platform: macosx-10.9-universal2

See also

@johnkerl johnkerl force-pushed the kerl/macosx-14-wheel-smoke-test-debug branch from 7da2348 to 3edc8d9 Compare May 22, 2024 14:03
@johnkerl johnkerl force-pushed the kerl/macosx-14-wheel-smoke-test-debug branch from 07b905a to f933cd5 Compare May 22, 2024 14:19
@johnkerl
Copy link
Member Author

@johnkerl
Copy link
Member Author

Manual debug run with the copy strategy from 0d85de6:
https://github.com/single-cell-data/TileDB-SOMA/actions/runs/9194374208

@johnkerl
Copy link
Member Author

@johnkerl johnkerl force-pushed the kerl/macosx-14-wheel-smoke-test-debug branch from a671bc6 to 41dc4e3 Compare May 22, 2024 16:31
@johnkerl johnkerl changed the title [python/ci] Debug MacOS 14 wheel-smoke-test issue [python/ci] Fix MacOS 14 wheel-smoke-test issue [WIP] May 22, 2024
@johnkerl
Copy link
Member Author

johnkerl commented May 22, 2024

Debug run with new verbosities/clarities, but, building and smoke-testing on macos 11:
https://github.com/single-cell-data/TileDB-SOMA/actions/runs/9197526045

Same but without even the rename:
https://github.com/single-cell-data/TileDB-SOMA/actions/runs/9197642927

@johnkerl
Copy link
Member Author

johnkerl commented May 22, 2024

Manual debug run trying macos with arm64 as there are (AFAIK) runners now:
https://github.com/single-cell-data/TileDB-SOMA/actions/runs/9198915278
-- same failure as in the description section of this PR.

@johnkerl
Copy link
Member Author

Experiment pip install -> python -m pip install:
https://github.com/single-cell-data/TileDB-SOMA/actions/runs/9201085806

@johnkerl
Copy link
Member Author

johnkerl commented May 23, 2024

@johnkerl
Copy link
Member Author

johnkerl commented May 23, 2024

Commit b39b87d revealing platform.platform() per advice of @eric-hughes-tiledb:
https://github.com/single-cell-data/TileDB-SOMA/actions/runs/9211800457

@johnkerl johnkerl force-pushed the kerl/macosx-14-wheel-smoke-test-debug branch from a7f7032 to b39b87d Compare May 23, 2024 16:44
@johnkerl
Copy link
Member Author

I ran an EC2 macos14 instance with the help of @nguyenv -- it installed the wheel without problem.

Also note:

>>> platform.platform()
'macOS-14.4.1-x86_64-i386-64bit'

>>> util.get_platform()
'macosx-14.0-x86_64'

where the first one is per @eric-hughes-tiledb and the second is what I've been using.

So this EC2 MacOS instance does not self-report as macosx-10.9-universal2 whereas our tiledbsoma CI macos runner does.

So, useful info, but, does not allow me to interact with a failing macos system:

  • CI: failing -- can't interact -- i've been pushing print-debug PRs the last day and a half
  • My x86 work mac: no repro
  • My personal arm64 mac: no repro
  • EC2 mac x86 instance: no repro

@johnkerl johnkerl changed the title [python/ci] Fix MacOS 14 wheel-smoke-test issue [WIP] [python/ci] Diagnose MacOS 14 wheel-smoke-test issue May 23, 2024
@johnkerl
Copy link
Member Author

johnkerl commented May 23, 2024

At this point I've spent a day and a half of solid debug trying to find out why pip install of wheel-files doesn't work in GHA on MacOS unless MacOS v11 is being used (which GHA is deprecating).

  • The smoke test -- direct pip install of wheel file -- works on macos11 in GHA but GHA is deprecating that
  • The smoke test -- direct pip install of wheel file -- fails on macos > 11 GHA, with no resolution after extensive debug
  • Direct pip install of the wheel file succeeds on both my macs (x86 and arm64) without problem
  • Direct pip install of the wheel file succeeds on Mac EC2 instance
  • pip install tiledbsoma works fine for recent releases

Proving that this is a CI-only issue. I cannot justify further loss of valuable time chasing into this GHA-infra issue at present.

I've filed #2634 to follow up.

@johnkerl johnkerl marked this pull request as ready for review May 23, 2024 17:09
@johnkerl
Copy link
Member Author

@johnkerl johnkerl changed the title [python/ci] Diagnose MacOS 14 wheel-smoke-test issue [python/ci] Stop MacOS 14 wheel-smoke-test failures May 23, 2024
@johnkerl johnkerl changed the title [python/ci] Stop MacOS 14 wheel-smoke-test failures [python/ci] Stop MacOS > 11 wheel-smoke-test failures May 23, 2024
@johnkerl johnkerl changed the title [python/ci] Stop MacOS > 11 wheel-smoke-test failures [python/ci] Stop wheel-smoke-test failures for MacOS > 11 May 23, 2024
@johnkerl johnkerl merged commit 768d8ab into main May 23, 2024
10 checks passed
@johnkerl johnkerl deleted the kerl/macosx-14-wheel-smoke-test-debug branch May 23, 2024 19:29
github-actions bot pushed a commit that referenced this pull request May 23, 2024
* [python/ci] Debug MacOS 14 wheel-smoke-test issue

* no ticket-cut for experiments

* more

* more

* try `CMAKE_OSX_DEPLOYMENT_TARGET`

* try the cp strategy

* try again

* more

* narrow list of installables at smoke-test time

* debug fail in last

* neaten

* abandon non-functional idea

* typofox

* neaten

* iterating

* experimenting with the old way to test narrative

* typofix

* debug

* macos 11 experiment over; back to macos 14

* pip install -vv for smoke test

* attempt macos arm64

* try `pip install` -> `python -m pip install`

* try macos12 x86_64 and macos14 arm64

* debug

* follow-up issue 2634
@johnkerl
Copy link
Member Author

[sc-48079]

johnkerl added a commit that referenced this pull request May 23, 2024
)

* [python/ci] Debug MacOS 14 wheel-smoke-test issue

* no ticket-cut for experiments

* more

* more

* try `CMAKE_OSX_DEPLOYMENT_TARGET`

* try the cp strategy

* try again

* more

* narrow list of installables at smoke-test time

* debug fail in last

* neaten

* abandon non-functional idea

* typofox

* neaten

* iterating

* experimenting with the old way to test narrative

* typofix

* debug

* macos 11 experiment over; back to macos 14

* pip install -vv for smoke test

* attempt macos arm64

* try `pip install` -> `python -m pip install`

* try macos12 x86_64 and macos14 arm64

* debug

* follow-up issue 2634

Co-authored-by: John Kerl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants