11
11
env :
12
12
REPO_NAME : ${{ github.repository }}
13
13
EVENT_NAME : ${{ github.event_name }}
14
- BAZEL_OPTIMIZATION : --copt=-msse4.2 --copt=-mavx --compilation_mode=opt
15
14
16
15
jobs :
17
16
lint :
59
58
- name : macOS
60
59
run : |
61
60
set -x -e
61
+ export BAZEL_OPTIMIZATION="--config=cache"
62
62
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
63
- export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
64
- else
65
- export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
63
+ export BAZEL_OPTIMIZATION="$BAZEL_OPTIMIZATION --remote_upload_local_results=true --google_credentials=service_account_creds.json"
66
64
fi
67
65
echo "Bring /usr/bin to front as GitHub does not use system python3 by default"
68
66
export PATH=/usr/bin:$PATH
76
74
linux :
77
75
name : Linux
78
76
runs-on : ubuntu-latest
77
+ container :
78
+ image : ubuntu:20.04
79
+ env :
80
+ REPO_NAME : ${{ env.REPO_NAME }}
81
+ EVENT_NAME : ${{ env.EVENT_NAME }}
79
82
steps :
80
83
- uses : actions/checkout@v2
81
84
- name : GCP
@@ -84,19 +87,18 @@ jobs:
84
87
${{ secrets.GCP_CREDS }}
85
88
EOF
86
89
- name : Ubuntu 20.04
90
+ shell : bash
87
91
run : |
88
92
set -x -e
93
+ export BAZEL_OPTIMIZATION="--config=cache"
89
94
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
90
- export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
91
- else
92
- export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
95
+ export BAZEL_OPTIMIZATION="$BAZEL_OPTIMIZATION --remote_upload_local_results=true --google_credentials=service_account_creds.json"
93
96
fi
94
- bash -x -e .github/workflows/build.space.sh
97
+ apt update
98
+ apt-get install -y python3
95
99
python3 .github/workflows/build.instruction.py docs/development.md "##### Ubuntu 20.04" > source.sh
96
100
cat source.sh
97
- docker run -i --rm -v $PWD:/v -w /v --net=host \
98
- -e BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION}" \
99
- ubuntu:20.04 bash -x -e source.sh
101
+ bash -x -e source.sh
100
102
101
103
macos-bazel :
102
104
name : Bazel macOS
@@ -111,32 +113,13 @@ jobs:
111
113
- name : Bazel on macOS
112
114
run : |
113
115
set -x -e
116
+ export BAZEL_OPTIMIZATION="--config=optimization --config=cache"
114
117
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
115
- export BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION} --remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
116
- else
117
- export BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION} --remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
118
+ export BAZEL_OPTIMIZATION="$BAZEL_OPTIMIZATION --remote_upload_local_results=true --google_credentials=service_account_creds.json"
118
119
fi
119
120
echo "Bring /usr/bin to front as GitHub does not use system python3 by default"
120
121
export PATH=/usr/bin:$PATH
121
- python3 --version
122
- python3 -c 'import site; print(site.getsitepackages())'
123
- BAZEL_OS=$(uname | tr '[:upper:]' '[:lower:]')
124
- BAZEL_VERSION=$(cat .bazelversion)
125
- curl -sSOL https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-${BAZEL_OS}-x86_64.sh
126
- sudo bash -e bazel-${BAZEL_VERSION}-installer-${BAZEL_OS}-x86_64.sh
127
- sudo python3 -m pip install $(python3 setup.py --install-require)
128
- python3 tools/build/configure.py
129
- bazel build \
130
- ${BAZEL_OPTIMIZATION} \
131
- --copt -Wunguarded-availability \
132
- --noshow_progress \
133
- --noshow_loading_progress \
134
- --verbose_failures \
135
- --test_output=errors \
136
- //tensorflow_io/... //tensorflow_io_gcs_filesystem/...
137
- mkdir build
138
- cp -r bazel-bin/tensorflow_io build
139
- cp -r bazel-bin/tensorflow_io_gcs_filesystem build
122
+ sudo -E bash -e .github/workflows/build.bazel.sh
140
123
- uses : actions/upload-artifact@v2
141
124
with :
142
125
name : ${{ runner.os }}-bazel-bin
@@ -225,6 +208,11 @@ jobs:
225
208
linux-bazel :
226
209
name : Bazel Linux
227
210
runs-on : ubuntu-latest
211
+ container :
212
+ image : gcr.io/tensorflow-testing/nosla-ubuntu16.04-manylinux2010@sha256:3a9b4820021801b1fa7d0592c1738483ac7abc209fc6ee8c9ef06cf2eab2d170
213
+ env :
214
+ REPO_NAME : ${{ env.REPO_NAME }}
215
+ EVENT_NAME : ${{ env.EVENT_NAME }}
228
216
steps :
229
217
- uses : actions/checkout@v2
230
218
- name : GCP
@@ -233,23 +221,14 @@ jobs:
233
221
${{ secrets.GCP_CREDS }}
234
222
EOF
235
223
- name : Bazel on Linux
224
+ shell : bash
236
225
run : |
237
226
set -x -e
227
+ export BAZEL_OPTIMIZATION="--config=optimization --config=linux_ci --config=cache"
238
228
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
239
- export BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION} --remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
240
- else
241
- export BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION} --remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
229
+ export BAZEL_OPTIMIZATION="$BAZEL_OPTIMIZATION --remote_upload_local_results=true --google_credentials=service_account_creds.json"
242
230
fi
243
- bash -x -e .github/workflows/build.space.sh
244
- BAZEL_OS=$(uname | tr '[:upper:]' '[:lower:]')
245
- BAZEL_VERSION=$(cat .bazelversion)
246
- docker run -i --rm -v $PWD:/v -w /v --net=host \
247
- -e BAZEL_VERSION=${BAZEL_VERSION} \
248
- -e BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION}" \
249
- gcr.io/tensorflow-testing/nosla-ubuntu16.04-manylinux2010@sha256:3a9b4820021801b1fa7d0592c1738483ac7abc209fc6ee8c9ef06cf2eab2d170 /v/.github/workflows/build.bazel.sh
250
- sudo chown -R $(id -nu):$(id -ng) .
251
- sudo find build/tensorflow_io -name '*runfiles*' | sudo xargs rm -rf
252
- sudo find build/tensorflow_io_gcs_filesystem -name '*runfiles*' | sudo xargs rm -rf
231
+ bash -x -e .github/workflows/build.bazel.sh
253
232
sudo cp .bazelrc build/tensorflow_io/
254
233
- uses : actions/upload-artifact@v2
255
234
with :
@@ -347,16 +326,11 @@ jobs:
347
326
shell : cmd
348
327
run : |
349
328
@echo on
329
+ set "BAZEL_OPTIMIZATION=--config=cache"
350
330
if "%EVENT_NAME%" == "push" (
351
331
if "%REPO_NAME%" == "tensorflow/io" (
352
- set "BAZEL_OPTIMIZATION=--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
353
- ) else (
354
- echo %REPO_NAME%
355
- set "BAZEL_OPTIMIZATION=--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
332
+ set "BAZEL_OPTIMIZATION=%BAZEL_OPTIMIZATION% --remote_upload_local_results=true --google_credentials=service_account_creds.json"
356
333
)
357
- ) else (
358
- echo %EVENT_NAME%
359
- set "BAZEL_OPTIMIZATION=--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
360
334
)
361
335
set /P BAZEL_VERSION=< .bazelversion
362
336
curl -sSL -o bazel.exe https://github.com/bazelbuild/bazel/releases/download/%BAZEL_VERSION%/bazel-%BAZEL_VERSION%-windows-x86_64.exe
@@ -367,7 +341,7 @@ jobs:
367
341
python3 setup.py --install-require | xargs python3 -m pip install
368
342
python3 tools/build/configure.py
369
343
cat .bazelrc
370
- bazel build -s --verbose_failures --noshow_progress --noshow_loading_progress --experimental_ui_max_stdouterr_bytes=-1 %BAZEL_OPTIMIZATION% //tensorflow_io/core:python/ops/libtensorflow_io.so //tensorflow_io/core:python/ops/libtensorflow_io_plugins.so //tensorflow_io_gcs_filesystem/...
344
+ bazel build -s %BAZEL_OPTIMIZATION% //tensorflow_io/core:python/ops/libtensorflow_io.so //tensorflow_io/core:python/ops/libtensorflow_io_plugins.so //tensorflow_io_gcs_filesystem/...
371
345
if %errorlevel% neq 0 exit /b %errorlevel%
372
346
mkdir build
373
347
cp -r bazel-bin/tensorflow_io build
0 commit comments