Skip to content

Commit

Permalink
Use python to invoke docker commands indirectly
Browse files Browse the repository at this point in the history
  • Loading branch information
yongtang committed Nov 8, 2023
1 parent 6eacfce commit 0279092
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import subprocess, sys, os

path = os.getcwd()
with subprocess.Popen(
[
"docker",
"run",
"-e",
"TF_PYTHON_VERSION=3.9",
"-v",
f"{path}:/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",
],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
) as process:
for line in process.stdout:
print(line.decode().strip())
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ jobs:
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 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
python3 .github/workflows/build.py
sudo cp .bazelrc build/tensorflow_io/
sudo chown -R $(id -nu):$(id -ng) .
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
Expand Down

0 comments on commit 0279092

Please sign in to comment.