Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .bazeliskrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
USE_BAZEL_VERSION=5.3.0
28 changes: 0 additions & 28 deletions .devcontainer/Dockerfile

This file was deleted.

37 changes: 22 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
{
"dockerFile": "./Dockerfile",
"context": "..",
"settings": {},
"build": {
"dockerfile": "../Dockerfile",
"context": "..",
"target": "dev_container"
},
// Useful extensions.
"extensions": [
"ms-python.python",
"ms-vscode.cpptools",
"ms-vscode.makefile-tools",
"github.vscode-pull-request-github",
"github.copilot",
"zxh404.vscode-proto3"
],
// Enable GPUs.
"runArgs": [
"--gpus=all"
],
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-vscode.cpptools",
"ms-vscode.makefile-tools",
"github.vscode-pull-request-github",
"github.copilot",
"zxh404.vscode-proto3",
"BazelBuild.vscode-bazel"
]
}
},
// Uncomment below to enable GPU support within dev container.
// "runArgs": [
// "--gpus=all"
// ],
// Enable plotting.
"mounts": [
"type=bind,source=/tmp/.X11-unix,target=/tmp/.X11-unix"
Expand Down
260 changes: 260 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
name: Build and release

on:
push:
branches:
- master
tags:
- v[0-9]+.[0-9]+.[0-9]+*
pull_request:
branches:
- master

env:
MIN_PY_VERSION: '3.7'
MAX_PY_VERSION: '3.10'

jobs:
# test-with-bazel:
# name: Test with bazel
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v2
# with:
# python-version: ${{ env.MIN_PY_VERSION }}
# - name: Build wheels
# run: |
# pip install --default-timeout=1000 -r tools/install_deps/pytest.txt -r tools/install_deps/tensorflow-cpu.txt -r requirements.txt
# bash tools/install_deps/install_bazelisk.sh ./
# python configure.py
# bazel test -k --test_timeout 300,450,1200,3600 --test_output=errors //tensorflow_addons/...
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
# To switch on windows-2022/latest, please verify the bazel version:
# https://github.com/bazelbuild/bazel/issues/14232#issuecomment-1011247429
os: ['ubuntu-20.04', 'windows-2019'] # ['macos-12', 'windows-2019', 'ubuntu-20.04']
py-version: ['3.8'] # ['3.7', '3.8', '3.9', '3.10']
tf-version: ['2.11']
cpu: ['x86']
# include:
# - os: 'macos-12'
# cpu: 'arm64'
# tf-version: '2.11.0'
# py-version: '3.8'
# - os: 'macos-12'
# cpu: 'arm64'
# tf-version: '2.11.0'
# py-version: '3.9'
# - os: 'macos-12'
# cpu: 'arm64'
# tf-version: '2.11.0'
# py-version: '3.10'
fail-fast: false
steps:
# - uses: actions/github-script@0.3.0
# id: author-date
# with:
# github-token: ${{secrets.GITHUB_TOKEN}}
# script: |
# const commit_details = await github.git.getCommit({owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha});
# return commit_details.data.author.date
# - if: matrix.tf-version != '2.10.0'
# shell: bash
# run: echo "SKIP_CUSTOM_OP_TESTS=--skip-custom-ops" >> $GITHUB_ENV
# - if: github.event_name == 'push'
# shell: bash
# run: echo "NIGHTLY_FLAG=--nightly" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py-version }}

- if: matrix.os != 'ubuntu-20.04'
name: Setup Bazel
# Ubuntu bazel is run inside of the docker image
run: bash tools/install_deps/install_bazelisk.sh ./

- name: Build wheels
env:
OS: ${{ runner.os }}
PY_VERSION: ${{ matrix.py-version }}
TF_VERSION: ${{ matrix.tf-version }}
CPU: ${{ matrix.cpu }}
shell: bash
run: bash ./tools/build/make_wheel_${OS}_${CPU}.sh

- name: Upload wheels
if: startsWith(github.ref, 'refs/tags')
uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-${{ matrix.py-version }}-tf${{ matrix.tf-version }}-${{ matrix.cpu }}-wheel
path: ./wheelhouse

- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
packages_dir: wheelhouse/
skip_existing: true

lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install requirements
run: |
pip install -r tools/install_deps/lint.txt

- name: Lint code
run: make lint

docs:
name: Docs
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install requirements
run: |
pip install -r tools/install_deps/docs.txt

- name: Build docs
run: make docs

- name: Upload docs
if: startsWith(github.ref, 'refs/tags')
uses: actions/upload-artifact@v2
with:
name: docs
path: ./docs/_build/dirhtml

release:
name: Release
needs: [build, lint, docs]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')

steps:
- name: Checkout docs branch
uses: actions/checkout@v2
with:
ref: docs

- name: Clean docs branch
run: |
rm -rf ./*

- name: Download docs
uses: actions/download-artifact@v2
with:
name: docs

- name: Publish docs to GitHub Pages
run: |
git config --global user.name mrphys
git config --global user.email mrphys@users.noreply.github.com
git add -A
git commit -m "Update docs [bot]" || echo "No changes to commit."
git push --force

- name: Checkout master
uses: actions/checkout@v2

- name: Get release tag
run: |
echo "release=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV

- name: Create a release
uses: softprops/action-gh-release@v1
with:
name: TensorFlow NUFFT ${{ env.release }}
body_path: RELEASE.md
prerelease: ${{ contains(env.release, 'a') || contains(env.release, 'b') || contains(env.release, 'rc') }}
fail_on_unmatched_files: true

- name: Download wheels
uses: actions/download-artifact@v2
with:
name: wheels
path: artifacts/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: artifacts/

# upload-wheels:
# name: Publish wheels to PyPi
# needs: [release-wheel, test-with-bazel]
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# os: ['macOS', 'Windows', 'Linux']
# py-version: ['3.7', '3.8', '3.9', '3.10']
# tf-version: ['2.11.0']
# cpu: ['x86']
# include:
# - os: 'macOS'
# cpu: 'arm64'
# tf-version: '2.11.0'
# py-version: '3.8'
# - os: 'macOS'
# cpu: 'arm64'
# tf-version: '2.11.0'
# py-version: '3.9'
# - os: 'macOS'
# cpu: 'arm64'
# tf-version: '2.11.0'
# py-version: '3.10'
# fail-fast: false
# if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release'
# steps:
# - uses: actions/download-artifact@v1
# with:
# name: ${{ matrix.os }}-${{ matrix.py-version }}-tf${{ matrix.tf-version }}-${{ matrix.cpu }}-wheel
# path: ./dist
# - run: |
# set -e -x
# ls -la dist/
# sha256sum dist/*.whl
# - uses: pypa/gh-action-pypi-publish@v1.1.0
# with:
# user: __token__
# password: ${{ secrets.pypi_token }}
# upload-dev-container:
# name: Upload dev container to DockerHub
# needs: [release-wheel, test-with-bazel]
# runs-on: ubuntu-20.04
# env:
# PY_VERSION: '3.9'
# if: (github.event_name == 'push' && github.ref == 'refs/heads/master')
# steps:
# - uses: actions/checkout@v2
# - run: |
# set -e -x
# echo ${{ secrets.DOCKER_PW }} | docker login --username ${{ secrets.DOCKER_USER }} --password-stdin
# bash .github/workflows/github_build_dev_container.sh
# docker push tfaddons/dev_container:latest-gpu
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
*.ipynb_checkpoints*
__pycache__/
artifacts/
wheelhouse/
docs/_*
docs/api_docs/tfft/
*_pb2.py
*.pb.h
*.pb.cc

# Bazel
/.bazelrc
/bazel-*
Loading