Skip to content

Commit

Permalink
Update to use docker build instead
Browse files Browse the repository at this point in the history
  • Loading branch information
yongtang committed Dec 5, 2023
1 parent 60faae5 commit bf7bc91
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,13 @@ jobs:
if [[ "${{ env.EVENT_NAME }}" == "push" && "${{ env.REPO_NAME }}" == "tensorflow/io" ]]; then
export BAZEL_OPTIMIZATION="$BAZEL_OPTIMIZATION --remote_upload_local_results=true --google_credentials=service_account_creds.json"
fi
#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
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
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 .
docker create -it io --name io bash
docker cp -L io:/opt/io/bazel-bin build
sudo cp .bazelrc build/tensorflow_io/
sudo chown -R $(id -nu):$(id -ng) .
find build/tensorflow_io -name '*runfiles*' | xargs rm -rf
find build/tensorflow_io_gcs_filesystem -name '*runfiles*' | xargs rm -rf
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: ${{ runner.os }}-bazel-bin
Expand Down
7 changes: 3 additions & 4 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,10 @@ http_archive(
http_archive(
name = "bzip2",
build_file = "//third_party:bzip2.BUILD",
sha256 = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269",
strip_prefix = "bzip2-1.0.8",
sha256 = "329e4eb98f6af8d39da05cb51bccec88ae015eac99a42b1ee04dec0af7f4b957",
strip_prefix = "bzip2-bzip2-1.0.8",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
"https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
"https://gitlab.com/bzip2/bzip2/-/archive/bzip2-1.0.8/bzip2-bzip2-1.0.8.tar.gz",
],
)

Expand Down
21 changes: 21 additions & 0 deletions tools/docker/build.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ARG PYTHON_VERSION
ARG TENSORFLOW_VERSION
FROM tensorflow/build:${TENSORFLOW_VERSION}-python$PYTHON_VERSION

ARG PYTHON_VERSION
ARG TENSORFLOW_VERSION
ARG BAZEL_OPTIMIZATION

ADD . /opt/io
WORKDIR /opt/io

RUN python${PYTHON_VERSION} -m pip install tensorflow==${TENSORFLOW_VERSION}

RUN python$PYTHON_VERSION -m pip uninstall -y tensorflow-io-gcs-filesystem

RUN python$PYTHON_VERSION tools/build/configure.py

RUN cat .bazelrc

RUN TF_PYTHON_VERSION=${PYTHON_VERSION} bazel build ${BAZEL_OPTIMIZATION} -- //tensorflow_io/... //tensorflow_io_gcs_filesystem/...

0 comments on commit bf7bc91

Please sign in to comment.