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

[ci] Separate mac wheels & trigger wheel build from ui #1499

Merged
merged 4 commits into from
Mar 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@ name: CI (Python)

on:
pull_request:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pull_request:
pull_request:

I think this line needs to go away to not trigger this job.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's still supposed to trigger it because of the linting that we always want to do. But then there is a check later down and I just learned how that was broken :)
Or rather I believe I know now why

types: [labeled, synchronize, opened]
push:
branches:
- "main"
tags:
- "v*.*.*" # on release tag
workflow_dispatch:
inputs:
force_build_wheel:
description: 'Build python wheels'
required: true
default: false
type: boolean

env:
PYTHON_VERSION: "3.8"
PRE_RELEASE_INSTRUCTIONS: |
## Installing the pre-release Python SDK
1. Download the correct `.whl`. For Mac M1/M2, grab the "universal2" `.whl`
1. Download the correct `.whl`.
2. Run `pip install rerun_sdk<...>.whl` (replace `<...>` with the actual filename)
3. Test it: `rerun --version`
UBUNTU_REQUIRED_PKGS: libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev libfontconfig1-dev libatk-bridge2.0 libfreetype6-dev libglib2.0-dev
Expand Down Expand Up @@ -59,8 +65,8 @@ jobs:

matrix-setup:
# Building all the wheels is expensive, so we only run this job when we push (to main or release tags),
# or if the PR has the 'build wheels' label for explicit testing of wheels.
if: github.event_name == 'push' || contains( github.event.pull_request.labels.*.name, '🛞 build wheels')
# or if the job was manually triggered with `force_build_wheel` set to true.
if: github.event_name == 'push' || github.event.inputs.force_build_wheel
runs-on: ubuntu-latest

outputs:
Expand All @@ -75,22 +81,15 @@ jobs:
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
# Sets TAGGED_OR_MAIN if this workflow is running on a tag or the main branch.
- name: Set TAGGED_OR_MAIN
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
run: echo "TAGGED_OR_MAIN=1" >> $GITHUB_ENV

- id: set-matrix
shell: bash
run: |
matrix=()

if [[ $TAGGED_OR_MAIN ]]; then
# MacOS build is really slow (>30 mins); uses up a lot of CI minutes
matrix+=('{"platform": "macos", "runs_on": "macos-latest"},')
fi
matrix+=('{"platform": "windows", "runs_on": "windows-latest-8-cores"},')
matrix+=('{"platform": "linux", "runs_on": "ubuntu-latest-16-cores", container: {"image": "rerunio/ci_docker:0.5"}}')
matrix+=('{"platform": "macos", "target": "x86_64-apple-darwin", "runs_on": "macos-latest"},')
matrix+=('{"platform": "macos", "target": "aarch64-apple-darwin", "runs_on": "macos-latest"},')
matrix+=('{"platform": "windows", "target": "x86_64-pc-windows-msvc", "runs_on": "windows-latest-8-cores"},')
matrix+=('{"platform": "linux", "target": "x86_64-unknown-linux-gnu", "runs_on": "ubuntu-latest-16-cores", container: {"image": "rerunio/ci_docker:0.5"}}')
Comment on lines 88 to +92
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little different from how it normally looks:

https://github.com/rust-windowing/winit/blob/master/.github/workflows/ci.yml#L22-L43

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's try this format instead, looks cleaner

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, now that it's not dynamically generated based on an env-variable, seems like we can clean it up.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's also something we might want to punt on though since this matrix-CI-builder mechanism has been working so far and restructuring the job graph is a good way to end up debugging job-graphs over the weekend.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.. in a separate PR!


echo "Matrix values: ${matrix[@]}"

Expand Down Expand Up @@ -204,9 +203,9 @@ jobs:
args: |
--manifest-path rerun_py/Cargo.toml
--release
--target ${{ matrix.target }}
--no-default-features
--features pypi
--universal2
--out pre-dist

- name: Install built wheel
Expand Down