Skip to content

Commit bf7bc91

Browse files
committed
Update to use docker build instead
1 parent 60faae5 commit bf7bc91

File tree

3 files changed

+29
-6
lines changed

3 files changed

+29
-6
lines changed

.github/workflows/build.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,13 @@ jobs:
307307
if [[ "${{ env.EVENT_NAME }}" == "push" && "${{ env.REPO_NAME }}" == "tensorflow/io" ]]; then
308308
export BAZEL_OPTIMIZATION="$BAZEL_OPTIMIZATION --remote_upload_local_results=true --google_credentials=service_account_creds.json"
309309
fi
310-
#docker run -e TF_PYTHON_VERSION=3.9 -v $PWD:/v -w /v --net=host quay.io/pypa/manylinux2014_x86_64 bash -x .github/workflows/build.bazel.sh python3.9
311-
docker run -e TF_PYTHON_VERSION=3.9 -v $PWD:/v -w /v --net=host --entrypoint=/bin/bash gcr.io/tensorflow-testing/nosla-cuda12.0.1-cudnn8.8-ubuntu20.04-manylinux2014-multipython -x -e .github/workflows/build.bazel.sh python3.9
310+
docker build -t io -f tools/docker/build.Dockerfile --build-arg PYTHON_VERSION=3.10 --build-arg TENSORFLOW_VERSION=2.14 --build-arg BAZEL_OPTIMIZATION=$BAZEL_OPTIMIZATION --progress=plain .
311+
docker create -it io --name io bash
312+
docker cp -L io:/opt/io/bazel-bin build
312313
sudo cp .bazelrc build/tensorflow_io/
313314
sudo chown -R $(id -nu):$(id -ng) .
315+
find build/tensorflow_io -name '*runfiles*' | xargs rm -rf
316+
find build/tensorflow_io_gcs_filesystem -name '*runfiles*' | xargs rm -rf
314317
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
315318
with:
316319
name: ${{ runner.os }}-bazel-bin

WORKSPACE

+3-4
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,10 @@ http_archive(
262262
http_archive(
263263
name = "bzip2",
264264
build_file = "//third_party:bzip2.BUILD",
265-
sha256 = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269",
266-
strip_prefix = "bzip2-1.0.8",
265+
sha256 = "329e4eb98f6af8d39da05cb51bccec88ae015eac99a42b1ee04dec0af7f4b957",
266+
strip_prefix = "bzip2-bzip2-1.0.8",
267267
urls = [
268-
"https://storage.googleapis.com/mirror.tensorflow.org/sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
269-
"https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
268+
"https://gitlab.com/bzip2/bzip2/-/archive/bzip2-1.0.8/bzip2-bzip2-1.0.8.tar.gz",
270269
],
271270
)
272271

tools/docker/build.Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ARG PYTHON_VERSION
2+
ARG TENSORFLOW_VERSION
3+
FROM tensorflow/build:${TENSORFLOW_VERSION}-python$PYTHON_VERSION
4+
5+
ARG PYTHON_VERSION
6+
ARG TENSORFLOW_VERSION
7+
ARG BAZEL_OPTIMIZATION
8+
9+
ADD . /opt/io
10+
WORKDIR /opt/io
11+
12+
RUN python${PYTHON_VERSION} -m pip install tensorflow==${TENSORFLOW_VERSION}
13+
14+
RUN python$PYTHON_VERSION -m pip uninstall -y tensorflow-io-gcs-filesystem
15+
16+
RUN python$PYTHON_VERSION tools/build/configure.py
17+
18+
RUN cat .bazelrc
19+
20+
RUN TF_PYTHON_VERSION=${PYTHON_VERSION} bazel build ${BAZEL_OPTIMIZATION} -- //tensorflow_io/... //tensorflow_io_gcs_filesystem/...
21+

0 commit comments

Comments
 (0)