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

adding tensorflow_io_gcs_filesystem #17069

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
910cf8e
Update azure-pipelines-linux.yml
ngam Nov 22, 2021
ac115a8
Update azure-pipelines-linux.yml
ngam Nov 22, 2021
3eea7d1
Update azure-pipelines-linux.yml
ngam Nov 22, 2021
821ba5d
Merge branch 'conda-forge:main' into main
ngam Nov 22, 2021
138044d
Merge branch 'conda-forge:main' into main
ngam Nov 23, 2021
7a24ffa
Merge branch 'conda-forge:main' into main
ngam Nov 24, 2021
31c5210
Merge branch 'conda-forge:main' into main
ngam Nov 24, 2021
ad71f72
Merge branch 'conda-forge:main' into main
ngam Nov 24, 2021
33f3122
Merge branch 'conda-forge:main' into main
ngam Nov 24, 2021
574ea90
Create meta.yaml
ngam Nov 24, 2021
506572b
Update meta.yaml
ngam Nov 24, 2021
12fb425
Create build.sh
ngam Nov 24, 2021
0f3e328
Update meta.yaml
ngam Nov 24, 2021
cfe7537
Update build.sh
ngam Nov 24, 2021
adf3c3f
Update meta.yaml
ngam Nov 24, 2021
a716eef
Update build.sh
ngam Nov 24, 2021
7bd1056
Update meta.yaml
ngam Nov 24, 2021
bdf58ff
Update meta.yaml
ngam Nov 24, 2021
9db3048
Update meta.yaml
ngam Nov 25, 2021
170b5f5
Update build.sh
ngam Nov 25, 2021
a2aa31b
Update build.sh
ngam Nov 25, 2021
6e3b8c0
Update build.sh
ngam Nov 25, 2021
7ae32cf
Update meta.yaml
ngam Nov 25, 2021
48052d8
Update meta.yaml
ngam Nov 25, 2021
5e2b1ba
Update build.sh
ngam Nov 25, 2021
e598d3d
Merge branch 'conda-forge:main' into ngam/tfio
ngam Nov 25, 2021
66da200
iteration
h-vetinari Dec 5, 2021
dd9202b
try 0.21.0 first
ngam Dec 5, 2021
b56f561
Merge branch 'conda-forge:main' into ngam/tfio
ngam Dec 5, 2021
07dc4f9
explicit tf??
ngam Dec 5, 2021
1767e13
Update meta.yaml
ngam Dec 5, 2021
77a0ac5
More tensorflow dependecy
hmaarrfk Dec 5, 2021
4e1ea35
Update meta.yaml
hmaarrfk Dec 5, 2021
6417b42
Add myself to the maintainers
hmaarrfk Dec 5, 2021
c4841fc
add libprotobuf dependency
hmaarrfk Dec 5, 2021
db55eaf
pin correct version of libprotobuf
hmaarrfk Dec 5, 2021
ba778e5
Update build.sh
hmaarrfk Dec 5, 2021
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
28 changes: 28 additions & 0 deletions recipes/tensorflow_io_gcs_filesystem/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# copy pkg


# Install tensorflow and configure bazel
./configure.sh


# # Alias python3 to python, needed by bazel
# ln -s /usr/bin/python3 /usr/bin/python

# Add any optimization on bazel command, e.g., --compilation_mode=opt,
# --copt=-msse4.2, --remote_cache=, etc.
# export BAZEL_OPTIMIZATION=

# Get rid of unwanted defaults
sed -i -e "/PROTOBUF_INCLUDE_PATH/c\ " .bazelrc
sed -i -e "/PREFIX/c\ " .bazelrc

# Build shared libraries
bazel build -s --verbose_failures --define=PROTOBUF_INCLUDE=${PREFIX}/include --define=PREFIX=${PREFIX} $BAZEL_OPTIMIZATION //tensorflow_io/... //tensorflow_io_gcs_filesystem/...

# # Once build is complete, shared libraries will be available in
# # `bazel-bin/tensorflow_io/core`, `bazel-bin/tensorflow_io/python/ops` and
# # it is possible to run tests with `pytest`, e.g.:
# sudo python3 -m pip install pytest
# TFIO_DATAPATH=bazel-bin python3 -m pytest -s -v tests/test_serialization.py
48 changes: 48 additions & 0 deletions recipes/tensorflow_io_gcs_filesystem/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{% set version = "0.21.0" %}

package:
name: tensorflow-io
version: {{ version }}

source:
url: https://github.com/tensorflow/io/archive/refs/tags/v{{ version }}.tar.gz
sha256: a5adce1cc70efc1b83a9a2d13192002d87eb78f4c16d0814ab7fb765f73ffad1
# patches:
# # backport cyclic dependency breaker
# - patches/0001-setup.py-move-tensorflow-requirement-to-extras_requi.patch

build:
number: 0
skip: true # [win]

requirements:
build:
- {{ compiler('cxx') }}
- bazel 3.7.2
- tensorflow >=2.6.0,
ngam marked this conversation as resolved.
Show resolved Hide resolved
host:
- python
- pip
run:
- python

test:
commands:
- echo "testing..."

about:
home: https://github.com/tensorflow/io
license: Apache-2.0
license_file: LICENSE
summary: 'Dataset, streaming, and file system extensions maintained by TensorFlow SIG-IO'

description: |
Dataset, streaming, and file system extensions maintained by TensorFlow SIG-IO


dev_url: https://github.com/tensorflow/io/blob/master/docs/development.md
doc_url: https://github.com/tensorflow/io/tree/master/docs

extra:
recipe-maintainers:
- ngam
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
From f6362ac25c7b6215e2e7fa25e1c5375e601b76e5 Mon Sep 17 00:00:00 2001
From: Luca Toscano <[email protected]>
Date: Sun, 14 Nov 2021 03:31:23 +0100
Subject: [PATCH] setup.py: move tensorflow requirement to extras_require
(#1551)

The AMD ROCm project maintains a fork of the Tensorflow package
called 'tensorflow-rocm', a drop-in replacement for 'tensorflow'.
The fact that tensorflow-io states only 'tensorflow' as specific
dependency makes it hard to use 'tensorflow-rocm', since both
don't work whell in the same environment.

This change follows what's done for tensorflow-addons in
https://github.com/tensorflow/addons/commit/61ebf40b1cd97506e4e43bdcf30c20c43d1597cc,
namely:
- Move the 'tensorflow' requirement to extras_require.
- Add new extras_require for tensorflow-{rocm,cpu,gpu}

Fixes #1548
---
.github/workflows/build.wheel.sh | 3 ++-
.github/workflows/build.yml | 1 +
README.md | 10 ++++++++++
setup.py | 10 ++++++++--
4 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.wheel.sh b/.github/workflows/build.wheel.sh
index 62130b4..c25ba12 100755
--- a/.github/workflows/build.wheel.sh
+++ b/.github/workflows/build.wheel.sh
@@ -8,7 +8,8 @@ run_test() {
CPYTHON_VERSION=$($entry -c 'import sys; print(str(sys.version_info[0])+str(sys.version_info[1]))')
(cd wheelhouse && $entry -m pip install tensorflow_io_gcs_filesystem-*-cp${CPYTHON_VERSION}-*.whl)
(cd wheelhouse && $entry -m pip install tensorflow_io-*-cp${CPYTHON_VERSION}-*.whl)
- $entry -m pip install -q pytest pytest-benchmark pytest-xdist boto3 fastavro avro-python3 scikit-image pandas pyarrow==3.0.0 google-cloud-pubsub==2.1.0 google-cloud-bigtable==1.6.0 google-cloud-bigquery-storage==1.1.0 google-cloud-bigquery==2.3.1 google-cloud-storage==1.32.0 PyYAML==5.3.1 azure-storage-blob==12.8.1 azure-cli==2.29.0
+ TF_VERSION=$(/usr/bin/grep tensorflow tensorflow_io/python/ops/version_ops.py | /usr/bin/cut -d '"' -f 2)
+ $entry -m pip install -q $TF_VERSION pytest pytest-benchmark pytest-xdist boto3 fastavro avro-python3 scikit-image pandas pyarrow==3.0.0 google-cloud-pubsub==2.1.0 google-cloud-bigtable==1.6.0 google-cloud-bigquery-storage==1.1.0 google-cloud-bigquery==2.3.1 google-cloud-storage==1.32.0 PyYAML==5.3.1 azure-storage-blob==12.8.1 azure-cli==2.29.0
(cd tests && $entry -m pytest --benchmark-disable -v --import-mode=append --forked --numprocesses=auto --dist loadfile $(find . -type f \( -iname "test_*.py" ! \( -iname "test_standalone_*.py" \) \)))
(cd tests && $entry -m pytest --benchmark-disable -v --import-mode=append $(find . -type f \( -iname "test_standalone_*.py" \)))
}
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 631972e..01773b9 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -413,6 +413,7 @@ jobs:
python --version
(cd wheel && ls tensorflow_io_gcs_filesystem-*.whl | xargs python -m pip install && cd ..)
(cd wheel && ls tensorflow_io-*.whl | xargs python -m pip install && cd ..)
+ (grep tensorflow tensorflow_io/python/ops/version_ops.py | sed -e "s/require = //g" | xargs python -m pip install)
- name: Test ${{ matrix.python }} Windows
shell: cmd
run: |
diff --git a/README.md b/README.md
index aa596e1..57c1070 100644
--- a/README.md
+++ b/README.md
@@ -83,6 +83,16 @@ People who are a little more adventurous can also try our nightly binaries:
$ pip install tensorflow-io-nightly
```

+To ensure you have a version of TensorFlow that is compatible with TensorFlow-IO,
+you can specify the `tensorflow` extra requirement during install:
+
+```
+pip install tensorflow-io[tensorflow]
+```
+
+Similar extras exist for the `tensorflow-gpu`, `tensorflow-cpu` and `tensorflow-rocm`
+packages.
+
### Docker Images

In addition to the pip packages, the docker images can be used to quickly get started.
diff --git a/setup.py b/setup.py
index 87b7a2f..f807a1c 100644
--- a/setup.py
+++ b/setup.py
@@ -77,9 +77,9 @@ if "--nightly" in sys.argv:

install_requires = []
if project == "tensorflow-io":
- install_requires = [require] + ["{}=={}".format(e, version) for e in subpackages]
+ install_requires = ["{}=={}".format(e, version) for e in subpackages]
elif project == "tensorflow-io-nightly":
- install_requires = [require] + [
+ install_requires = [
"{}-nightly=={}".format(e, version) for e in subpackages
]

@@ -176,6 +176,12 @@ setuptools.setup(
packages=setuptools.find_packages(where=".", exclude=exclude),
python_requires=">=3.6, <3.10",
install_requires=install_requires,
+ extras_require={
+ "tensorflow": [require],
+ "tensorflow-gpu": [require.replace('tensorflow', 'tensorflow-gpu')],
+ "tensorflow-cpu": [require.replace('tensorflow', 'tensorflow-cpu')],
+ "tensorflow-rocm": [require.replace('tensorflow', 'tensorflow-rocm')],
+ },
package_data={".": ["*.so"],},
project_urls={
"Source": "https://github.com/tensorflow/io",
--
2.32.0.windows.2