From 9aa0382ef5049cdd216494a865b2624680f1b8cf Mon Sep 17 00:00:00 2001 From: rly Date: Sat, 8 Jun 2024 01:51:06 -0700 Subject: [PATCH] Deploy on x64 mac, install neuroconv from github on arm64 mac --- .github/workflows/build_and_deploy_mac.yml | 10 ++++++---- .github/workflows/testing_flask_build_and_dist.yml | 2 +- environments/environment-MAC-apple-silicon.yml | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_and_deploy_mac.yml b/.github/workflows/build_and_deploy_mac.yml index 42bb45ac8..d53b6ec34 100644 --- a/.github/workflows/build_and_deploy_mac.yml +++ b/.github/workflows/build_and_deploy_mac.yml @@ -7,9 +7,11 @@ on: jobs: deploy-on-mac: - runs-on: macos-latest - # not using macos-latest because that runner is an arm64 mac and there are issues - # building and deploying with sonpy (Spike2RecordingInterface) on arm64 mac + runs-on: macos-13 + # NOTE: macos-latest is an arm64 mac, and the dependency sonpy (Spike2RecordingInterface) has a .so file that + # works only on mac x64. This causes issues building and deploying on mac arm64. So we use macos-13 (x64) + # to build and deploy both the x64 and arm64 versions of the app. + # NOTE: if changing this to macos-latest, make sure to use the apple-silicon conda environment. defaults: run: @@ -31,7 +33,7 @@ jobs: use-mamba: true - name: Create and activate environment - run: mamba env update --name nwb-guide --file environments/environment-MAC-apple-silicon.yml + run: mamba env update --name nwb-guide --file environments/environment-MAC-intel.yml - name: Use Node.js 20 uses: actions/setup-node@v4 diff --git a/.github/workflows/testing_flask_build_and_dist.yml b/.github/workflows/testing_flask_build_and_dist.yml index 8b3c1dc88..6c477d5e4 100644 --- a/.github/workflows/testing_flask_build_and_dist.yml +++ b/.github/workflows/testing_flask_build_and_dist.yml @@ -82,7 +82,7 @@ jobs: # Fix for macos build - remove bad sonpy file - if: matrix.os == 'macos-latest' || matrix.os == 'macos-13' - run: rm -f /Users/runner/miniconda3/envs/nwb-guide/lib/python3.9/site-packages/sonpy/linux/sonpy.so + run: rm -f "$CONDA_PREFIX/lib/python3.9/site-packages/sonpy/linux/sonpy.so" - name: Build PyFlask distribution run: npm run build:flask diff --git a/environments/environment-MAC-apple-silicon.yml b/environments/environment-MAC-apple-silicon.yml index 84e29d4f3..39daf9452 100644 --- a/environments/environment-MAC-apple-silicon.yml +++ b/environments/environment-MAC-apple-silicon.yml @@ -21,6 +21,8 @@ dependencies: - flask == 2.3.2 - flask-cors == 4.0.0 - flask_restx == 1.1.0 + # NOTE: the neuroconv wheel on pypi includes sonpy which is not compatible with arm64, so build and install + # neuroconv from github, which will remove the sonpy dependency when building from mac arm64 - neuroconv @ git+https://github.com/catalystneuro/neuroconv.git@main#neuroconv[full] - dandi >= 0.60.0 - pytest == 7.4.0