chore: import upstream snapshot with attribution
cffconvert / validate (push) Has been skipped
License Check / license-check (push) Failing after 2s

This commit is contained in:
wehub-resource-sync
2026-07-13 12:14:16 +08:00
commit 8a852e4b4e
36502 changed files with 9277225 additions and 0 deletions
@@ -0,0 +1,81 @@
#!/bin/bash
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
set -e
# Error if we somehow forget to set the path to bazel_wrapper.py
set -u
BAZEL_WRAPPER_PATH=$1
set +u
# From this point on, logs can be publicly available
set -x
function run_build () {
export ANDROID_NDK_HOME="/opt/android-ndk-r21e"
export NDK_HOME=$ANDROID_NDK_HOME
export ANDROID_SDK_HOME="/opt/android-sdk/current"
export ANDROID_API_LEVEL="23"
export ANDROID_BUILD_TOOLS_VERSION="31.0.0"
ANDROID_OUT=android.out
ANDROID_OUT_TARGET=gen_android_out
# Run the presubmit android build.
tensorflow/tools/ci_build/builds/android.sh 2>&1 | tee tensorflow/tools/ci_build/builds/${ANDROID_OUT}
RC=${PIPESTATUS[0]}
# Since we are running the build remotely (rbe), we need to build a bazel
# target that would output the log generated above and return the expected
# error code.
cat << EOF > tensorflow/tools/ci_build/builds/BUILD
package(default_visibility = ["//tensorflow:internal"])
sh_test(
name = "${ANDROID_OUT_TARGET}",
srcs = ["${ANDROID_OUT_TARGET}.sh"],
data = ["${ANDROID_OUT}"],
tags = ["local"],
)
EOF
cat << EOF > tensorflow/tools/ci_build/builds/${ANDROID_OUT_TARGET}.sh
#!/bin/bash
cat tensorflow/tools/ci_build/builds/${ANDROID_OUT}
exit ${RC}
EOF
# Now trigger the rbe build that outputs the log
chmod +x tensorflow/tools/ci_build/builds/${ANDROID_OUT_TARGET}.sh
# Run bazel test command. Double test timeouts to avoid flakes.
# //tensorflow/core/platform:setround_test is not supported. See b/64264700
"${BAZEL_WRAPPER_PATH}" \
--host_jvm_args=-Dbazel.DigestFunction=SHA256 \
test \
--test_output=all \
tensorflow/tools/ci_build/builds:${ANDROID_OUT_TARGET}
# Copy log to output to be available to GitHub
ls -la "$(bazel info output_base)/java.log"
cp "$(bazel info output_base)/java.log" "${KOKORO_ARTIFACTS_DIR}/"
}
source tensorflow/tools/ci_build/release/common.sh
install_bazelisk
which bazel
run_build
@@ -0,0 +1,53 @@
#!/bin/bash
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
set -e
# Error if we somehow forget to set the path to bazel_wrapper.py
set -u
BAZEL_WRAPPER_PATH=$1
set +u
# From this point on, logs can be publicly available
set -x
source tensorflow/tools/ci_build/release/common.sh
install_bazelisk
which bazel
# Get the default test targets for bazel.
source tensorflow/tools/ci_build/build_scripts/DEFAULT_TEST_TARGETS.sh
tag_filters="-no_oss,-oss_excluded,-oss_serial,-gpu,-tpu,-benchmark-test""$(maybe_skip_v1)"
# Run bazel test command.
"${BAZEL_WRAPPER_PATH}" \
test \
--profile="${KOKORO_ARTIFACTS_DIR}/profile.json.gz" \
--build_event_binary_file="${KOKORO_ARTIFACTS_DIR}/build_events.pb" \
--config=rbe_linux_cpu \
--test_tag_filters="${tag_filters}" \
--build_tag_filters="${tag_filters}" \
--test_lang_filters=cc,py \
-- \
${DEFAULT_BAZEL_TARGETS} -//tensorflow/lite/...
# Print build time statistics, including critical path.
bazel analyze-profile "${KOKORO_ARTIFACTS_DIR}/profile.json.gz"
# Copy log to output to be available to GitHub
ls -la "$(bazel info output_base)/java.log"
cp "$(bazel info output_base)/java.log" "${KOKORO_ARTIFACTS_DIR}/"
@@ -0,0 +1,54 @@
#!/bin/bash
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
set -e
# Error if we somehow forget to set the path to bazel_wrapper.py
set -u
BAZEL_WRAPPER_PATH=$1
set +u
# From this point on, logs can be publicly available
set -x
source tensorflow/tools/ci_build/release/common.sh
install_bazelisk
which bazel
tag_filters="gpu,-no_gpu,-benchmark-test,-no_oss,-oss_excluded,-oss_serial,-no_gpu_presubmit,-no_cuda11""$(maybe_skip_v1)"
# Get the default test targets for bazel.
source tensorflow/tools/ci_build/build_scripts/DEFAULT_TEST_TARGETS.sh
# Run bazel test command.
"${BAZEL_WRAPPER_PATH}" \
test \
--profile="${KOKORO_ARTIFACTS_DIR}/profile.json.gz" \
--build_event_binary_file="${KOKORO_ARTIFACTS_DIR}/build_events.pb" \
--config=rbe_linux_cuda \
--test_tag_filters="${tag_filters}" \
--build_tag_filters="${tag_filters}" \
--test_lang_filters=cc,py \
-- \
${DEFAULT_BAZEL_TARGETS} -//tensorflow/lite/...
# Print build time statistics, including critical path.
bazel analyze-profile "${KOKORO_ARTIFACTS_DIR}/profile.json.gz"
# Copy log to output to be available to GitHub
ls -la "$(bazel info output_base)/java.log"
cp "$(bazel info output_base)/java.log" "${KOKORO_ARTIFACTS_DIR}/"
@@ -0,0 +1,64 @@
:: Copyright 2026 The TensorFlow Authors. All Rights Reserved.
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
:: ==============================================================================
echo on
setlocal enableextensions enabledelayedexpansion
SET PYTHON_DIRECTORY=Python39
@REM This is the path to bazel_wrapper.py, should be set as an argument
set BAZEL_WRAPPER_PATH=%~f1
@REM Load common definitions, install bazel
CALL tensorflow\tools\ci_build\release\common_win.bat
@REM Set up common variables used through the script
set WIN_OUT=win.out
set WIN_OUT_TARGET=gen_win_out
set BUILD_PATH=tensorflow/tools/ci_build/builds
set GEN_SCRIPT=%BUILD_PATH%/%WIN_OUT_TARGET%.sh
set GEN_BUILD=%BUILD_PATH%/BUILD
@REM Run the presubmit win build.
CALL tensorflow\tools\ci_build\windows\cpu\pip\run.bat --enable_remote_cache %* > %BUILD_PATH%/%WIN_OUT% 2>&1
set RC=%errorlevel%
@REM Since we are running the sanity build remotely (rbe), we need to build a bazel
@REM target that would output the log generated above and return the expected
@REM error code.
echo package(default_visibility = ["//visibility:public"]) > %GEN_BUILD%
echo. >> %GEN_BUILD%
echo sh_test( >> %GEN_BUILD%
echo name = "%WIN_OUT_TARGET%", >> %GEN_BUILD%
echo srcs = ["%WIN_OUT_TARGET%.sh"], >> %GEN_BUILD%
echo data = ["%WIN_OUT%"], >> %GEN_BUILD%
echo tags = ["local"], >> %GEN_BUILD%
echo ) >> %GEN_BUILD%
echo #!/bin/bash > %GEN_SCRIPT%
echo function rlocation() { >> %GEN_SCRIPT%
echo fgrep -m1 "$1 " "$RUNFILES_MANIFEST_FILE" ^| cut -d' ' -f2- >> %GEN_SCRIPT%
echo } >> %GEN_SCRIPT%
echo cat $(rlocation %BUILD_PATH%/%WIN_OUT%) >> %GEN_SCRIPT%
echo exit %RC% >> %GEN_SCRIPT%
@REM Now trigger the rbe build that outputs the log
chmod +x %GEN_SCRIPT%
@REM Run bazel test command.
%PY_EXE% %BAZEL_WRAPPER_PATH% --output_user_root=%TMPDIR% ^
--host_jvm_args=-Dbazel.DigestFunction=SHA256 test ^
%BUILD_PATH%:%WIN_OUT_TARGET% --test_output=all ^
--experimental_ui_max_stdouterr_bytes=-1