forked from tensorflow/data-validation
-
Notifications
You must be signed in to change notification settings - Fork 0
M1 build #2
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
Open
andrewfulton9
wants to merge
38
commits into
master
Choose a base branch
from
m1_build
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
M1 build #2
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
b1daa23
add build cibuildwheel logic
andrewfulton9 5d300a8
update cibuildwheel
andrewfulton9 3b4987b
update build frontend and skips
andrewfulton9 e28573c
remove mac build
andrewfulton9 23e46de
update platform and build frontend
andrewfulton9 ab59916
skip mac builds
andrewfulton9 ba78c17
remove platform tag
andrewfulton9 c2cd321
don't run macos build
andrewfulton9 37df8cd
add build on macos15
andrewfulton9 dfa764f
add build host_cxxopt to .bazelrc
andrewfulton9 1736aa7
added comment
andrewfulton9 e389eb0
update Build job name
andrewfulton9 698f422
see move generated files
andrewfulton9 71b5502
debugging
andrewfulton9 571b49f
add echo
andrewfulton9 e2cf169
add logic for if platform is arm64
andrewfulton9 4ed05a6
add macos_arm64 to bazelrc build
andrewfulton9 eda3669
update build-backend
andrewfulton9 cbea9b4
debugging
andrewfulton9 619670a
Move build to build.bazel remove subprocess check_calls
andrewfulton9 1f34dc0
remove numpy dependency
andrewfulton9 db0ca49
add numpy back in, add test commands
andrewfulton9 219c0bf
add test extras
andrewfulton9 ace8ec3
fix typo
andrewfulton9 cabc491
add test-sources
andrewfulton9 e0617c6
fix test
andrewfulton9 809c58a
update
andrewfulton9 e93f2f2
try using wheelhouse build on test workflow
andrewfulton9 7dcdef2
remove cibuildwheel tests
andrewfulton9 0dc5faf
try to fix tests by using testpypi for ajf-test-tfx-bsl in place of t…
andrewfulton9 9bb136b
precommit
andrewfulton9 a600f5b
make sure test extras are installed
andrewfulton9 658168f
try not building 311
andrewfulton9 bd7881b
don't fail fast to see if tests fail with other setups
andrewfulton9 518e249
update versioning
andrewfulton9 05113e8
skip failing tests on macos
andrewfulton9 dfab0a5
import sys
andrewfulton9 ce82c99
linting add skip
andrewfulton9 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: Build | ||
|
||
on: | ||
|
@@ -11,44 +25,27 @@ on: | |
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11"] | ||
os: [ubuntu-latest, macos-latest] | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build data-validation | ||
id: build-data-validation | ||
uses: ./.github/reusable-build | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
upload-artifact: true | ||
|
||
upload_to_pypi: | ||
name: Upload to PyPI | ||
runs-on: ubuntu-latest | ||
if: (github.event_name == 'release' && startsWith(github.ref, 'refs/tags')) || (github.event_name == 'workflow_dispatch') | ||
needs: [build] | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/tensorflow-data-validation/ | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Retrieve wheels | ||
uses: actions/[email protected] | ||
with: | ||
merge-multiple: true | ||
path: wheels | ||
|
||
- name: List the build artifacts | ||
run: | | ||
ls -lAs wheels/ | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
# env: | ||
# CIBW_SOME_OPTION: value | ||
# ... | ||
# with: | ||
# package-dir: . | ||
# output-dir: wheelhouse | ||
# config-file: "{package}/pyproject.toml" | ||
|
||
- name: Upload to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1.9 | ||
with: | ||
packages_dir: wheels/ | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||
path: ./wheelhouse/*.whl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,18 +77,34 @@ def finalize_options(self): | |
) | ||
self._additional_build_options = [] | ||
if platform.system() == "Darwin": | ||
self._additional_build_options = ["--macos_minimum_os=10.14"] | ||
# This flag determines the platform qualifier of the macos wheel. | ||
if platform.machine() == "arm64": | ||
self._additional_build_options = [ | ||
"--macos_minimum_os=11.0", | ||
"--config=macos_arm64", | ||
] | ||
else: | ||
self._additional_build_options = ["--macos_minimum_os=10.14"] | ||
|
||
def run(self): | ||
subprocess.check_call( | ||
check_call_call = ( | ||
[self._bazel_cmd, "run", "-c", "opt"] | ||
+ self._additional_build_options | ||
+ ["//tensorflow_data_validation:move_generated_files"], | ||
+ ["//tensorflow_data_validation:move_generated_files"] | ||
) | ||
print(check_call_call) | ||
subprocess.check_call( | ||
check_call_call, | ||
# Bazel should be invoked in a directory containing bazel WORKSPACE | ||
# file, which is the root directory. | ||
cwd=os.path.dirname(os.path.realpath(__file__)), | ||
env=dict(os.environ, PYTHON_BIN_PATH=sys.executable), | ||
) | ||
subprocess.check_call( | ||
["ls", "-al"], | ||
cwd=os.path.dirname(os.path.realpath(__file__)), | ||
env=dict(os.environ, PYTHON_BIN_PATH=sys.executable), | ||
) | ||
|
||
|
||
# TFDV is not a purelib. However because of the extension module is not built | ||
|
@@ -214,17 +230,17 @@ def select_constraint(default, nightly=None, git_master=None): | |
nightly=">=1.18.0.dev", | ||
git_master="@git+https://github.com/tensorflow/metadata@master", | ||
), | ||
"tfx-bsl" | ||
+ select_constraint( | ||
default=">=1.17.1,<1.18", | ||
nightly=">=1.18.0.dev", | ||
git_master="@git+https://github.com/tensorflow/tfx-bsl@master", | ||
), | ||
"ajf-test-tfx-bsl>=1.18.0.dev", | ||
# + select_constraint( | ||
# default=">=1.17.1,<1.18", | ||
# nightly=">=1.18.0.dev", | ||
# git_master="@git+https://github.com/tensorflow/tfx-bsl@master", | ||
# ), | ||
], | ||
extras_require={ | ||
"mutual-information": _make_mutual_information_requirements(), | ||
"visualization": _make_visualization_requirements(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mind please adding the dev and test dependencies to all in the same way that the others have been in order to maintain existing convention |
||
"dev": ["precommit"], | ||
"dev": ["precommit", "cibuildwheel", "build"], | ||
"docs": _make_docs_requirements(), | ||
"test": [ | ||
"pytest", | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason you decided to use cibuildwheel here only, instead of replacing the logic in
reusable-build
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah a couple of reasons:
Before I push this PR up to the main fork, I am actually planning on removing the reusable-build and test workflows since it is already tested as part of the cibuildwheel pipeline.