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
+71
View File
@@ -0,0 +1,71 @@
# Copyright 2022 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.
# ==============================================================================
name: ARM CD
on:
push:
tags:
- v2.**
branches:
- r2.**
schedule:
- cron: '0 8 * * *'
permissions:
contents: read
jobs:
build:
if: github.repository == 'tensorflow/tensorflow' # Don't do this in forks
runs-on: [self-hosted, linux, ARM64]
strategy:
fail-fast: false
matrix:
pyver: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Stop old running containers (if any)
shell: bash
run: |
running_containers=$(docker ps -q) && \
if [[ $running_containers == "" ]]; then
echo "No running containers";
else
echo "Running container(s) found" && \
docker stop $running_containers;
fi
docker container prune -f
- name: Clean repository
shell: bash
run: find /home/ubuntu/actions-runner/_work/tensorflow/tensorflow/. -name . -o -prune -exec sudo rm -rf -- {} + || true
- name: Checkout repository for nightly (skipped for releases)
if: ${{ github.event_name == 'schedule' }}
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: 'nightly'
- name: Checkout repository for releases (skipped for nightly)
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Build and test pip wheel
shell: bash
run: |
is_nightly=0 && tf_project_name='tensorflow_cpu_aws' && ${{ github.event_name == 'schedule' }} && is_nightly=1 && tf_project_name='tf_nightly_cpu_aws'
echo "PyPI project name:" $tf_project_name
CI_DOCKER_BUILD_EXTRA_PARAMS="--build-arg py_major_minor_version=${{ matrix.pyver }} --build-arg is_nightly=${is_nightly} --build-arg tf_project_name=${tf_project_name}" \
./tensorflow/tools/ci_build/ci_build.sh cpu.arm64 bash tensorflow/tools/ci_build/rel/ubuntu/cpu_arm64_test_build.sh
- name: Upload pip wheel to PyPI
if: github.event_name == 'schedule' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v2')) # only if it is a scheduled nightly or tagged
shell: bash
run: python3 -m twine upload --verbose /home/ubuntu/actions-runner/_work/tensorflow/tensorflow/whl/* -u "__token__" -p ${{ secrets.AWS_PYPI_ACCOUNT_TOKEN }}
+64
View File
@@ -0,0 +1,64 @@
# Copyright 2022 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.
# ==============================================================================
name: ARM CI Extended C++
on:
push:
tags:
- v2.**
schedule:
- cron: '0 2 * * *'
permissions:
contents: read
jobs:
build:
if: github.repository == 'tensorflow/tensorflow' # Don't do this in forks
runs-on: [self-hosted, linux, ARM64]
strategy:
matrix:
pyver: ['3.10']
steps:
- name: Stop old running containers (if any)
shell: bash
run: |
running_containers=$(docker ps -q) && \
if [[ $running_containers == "" ]]; then
echo "No running containers";
else
echo "Running container(s) found" && \
docker stop $running_containers;
fi
docker container prune -f
docker image prune -af
- name: Clean repository
shell: bash
run: find /home/ubuntu/actions-runner/_work/tensorflow/tensorflow/. -name . -o -prune -exec sudo rm -rf -- {} + || true
- name: Checkout repository for nightly (skipped for releases)
if: ${{ github.event_name == 'schedule' }}
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: 'nightly'
- name: Checkout repository
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Build binary and run C++ tests
shell: bash
run: |
is_nightly=0 && tf_project_name='tf_ci_ext_c' && ${{ github.event_name == 'schedule' }} && is_nightly=1 && tf_project_name='tf_nightly_ci_ext_c'
CI_DOCKER_BUILD_EXTRA_PARAMS="--build-arg py_major_minor_version=${{ matrix.pyver }} --build-arg is_nightly=${is_nightly} --build-arg tf_project_name=${tf_project_name}" \
./tensorflow/tools/ci_build/ci_build.sh cpu.arm64 bash tensorflow/tools/ci_build/rel/ubuntu/cpu_arm64_test_cpp.sh
+65
View File
@@ -0,0 +1,65 @@
# Copyright 2022 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.
# ==============================================================================
name: ARM CI Extended
on:
push:
tags:
- v2.**
schedule:
- cron: '0 4 * * *'
permissions:
contents: read
jobs:
build:
if: github.repository == 'tensorflow/tensorflow' # Don't do this in forks
runs-on: [self-hosted, linux, ARM64]
strategy:
fail-fast: false
matrix:
pyver: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Stop old running containers (if any)
shell: bash
run: |
running_containers=$(docker ps -q) && \
if [[ $running_containers == "" ]]; then
echo "No running containers";
else
echo "Running container(s) found" && \
docker stop $running_containers;
fi
docker container prune -f
docker image prune -af
- name: Clean repository
shell: bash
run: find /home/ubuntu/actions-runner/_work/tensorflow/tensorflow/. -name . -o -prune -exec sudo rm -rf -- {} + || true
- name: Checkout repository for nightly (skipped for releases)
if: ${{ github.event_name == 'schedule' }}
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: 'nightly'
- name: Checkout repository
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Build binary and run python tests on nightly for all python versions
shell: bash
run: |
is_nightly=0 && tf_project_name='tf_ci_ext' && ${{ github.event_name == 'schedule' }} && is_nightly=1 && tf_project_name='tf_nightly_ci_ext'
CI_DOCKER_BUILD_EXTRA_PARAMS="--build-arg py_major_minor_version=${{ matrix.pyver }} --build-arg is_nightly=${is_nightly} --build-arg tf_project_name=${tf_project_name}" \
./tensorflow/tools/ci_build/ci_build.sh cpu.arm64 bash tensorflow/tools/ci_build/rel/ubuntu/cpu_arm64_test.sh
+55
View File
@@ -0,0 +1,55 @@
# Copyright 2022 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.
# ==============================================================================
name: ARM CI
on:
push:
branches:
- master
- r2.**
permissions:
contents: read
jobs:
build:
# Don't do this in forks, and if labeled, only for 'kokoro:force-run'
if: github.repository == 'tensorflow/tensorflow' && (github.event.action != 'labeled' || (github.event.action == 'labeled' && github.event.label.name == 'kokoro:force-run'))
runs-on: [self-hosted, linux, ARM64]
strategy:
matrix:
pyver: ['3.10']
steps:
- name: Stop old running containers (if any)
shell: bash
run: |
running_containers=$(docker ps -q) && \
if [[ $running_containers == "" ]]; then
echo "No running containers";
else
echo "Running container(s) found" && \
docker stop $running_containers;
fi
docker container prune -f
- name: Clean repository
shell: bash
run: find /home/ubuntu/actions-runner/_work/tensorflow/tensorflow/. -name . -o -prune -exec sudo rm -rf -- {} + || true
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Build binary and run python tests
shell: bash
run: |
CI_DOCKER_BUILD_EXTRA_PARAMS="--pull --build-arg py_major_minor_version=${{ matrix.pyver }} --build-arg is_nightly=1 --build-arg tf_project_name=tf_nightly_ci" \
./tensorflow/tools/ci_build/ci_build.sh cpu.arm64 bash tensorflow/tools/ci_build/rel/ubuntu/cpu_arm64_test.sh
+73
View File
@@ -0,0 +1,73 @@
# 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.
# ==============================================================================
name: Reusable Build
on:
workflow_call:
inputs:
runner:
description: 'Which runner should the workflow run on?'
required: true
type: string
tfci:
description: 'TFCI environment variable'
required: true
type: string
job_name:
description: 'Name of the job'
required: false
type: string
default: 'build-and-test'
permissions:
contents: read
jobs:
build-and-test:
name: ${{ inputs.job_name }}
runs-on: ${{ inputs.runner }}
env:
PIP_NO_CACHE_DIR: 1
defaults:
run:
shell: bash
container: ${{ (contains(inputs.runner, 'linux-x86') && 'us-docker.pkg.dev/ml-oss-artifacts-published/ml-public-container/ml-build:latest') ||
(contains(inputs.runner, 'linux-arm64') && 'us-docker.pkg.dev/ml-oss-artifacts-published/ml-public-container/ml-build-arm64:latest') ||
(contains(inputs.runner, 'windows-x86') && null) }}
timeout-minutes: 300
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
env:
GIT_CONFIG_PARAMETERS: "'checkout.workers=12' 'core.featureManyFiles=true'"
with:
ref: ${{ github.sha }}
persist-credentials: false
fetch-depth: 1
- name: Build and test
env:
TFCI: ${{ inputs.tfci }}
TFCI_GITHUB_ACTIONS: true
run: ./ci/official/pycpp.sh
- name: Upload Profile
if: always()
continue-on-error: true
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: "profile-${{ github.workflow }}-${{ inputs.runner }}-${{ inputs.tfci }}-${{ github.run_number }}-${{ github.run_attempt }}"
path: build_output/profile.json.gz
if-no-files-found: warn
+38
View File
@@ -0,0 +1,38 @@
# Copyright 2022 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.
# ==============================================================================
name: cffconvert
on:
push:
paths:
- CITATION.cff
permissions:
contents: read
jobs:
validate:
if: github.repository == 'tensorflow/tensorflow' # Don't do this in forks
name: "validate"
runs-on: ubuntu-latest
steps:
- name: Check out a copy of the repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Check whether the citation metadata from CITATION.cff is valid
uses: citation-file-format/cffconvert-github-action@4cf11baa70a673bfdf9dad0acc7ee33b3f4b6084 # v2.0.0
with:
args: "--validate"
+56
View File
@@ -0,0 +1,56 @@
# 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.
# ============================================================================
name: License Check
permissions: {}
on:
pull_request:
push:
branches:
- main
jobs:
license-check:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
timeout-minutes: 10
steps:
- name: "Checking out repository"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: "Set up Go"
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 'stable'
- name: "Run license check"
uses: google-ml-infra/actions/ci_check_license@432d36c6ac62d76fa99b3679758ccfbc10140fb6
with:
copyright-holder: 'The TensorFlow Authors'
license-type: 'apache'
exclude-paths: 'third_party'
exclude-files: >-
tensorflow_issue_template.yaml
BUILD
_redirects.yaml
cloudbuild.yaml
_index.yaml
_book.yaml
_toc.yaml
_doxygen.yaml
exclude-extensions: 'gradle'
+61
View File
@@ -0,0 +1,61 @@
# 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.
# ==============================================================================
name: CI
on:
pull_request:
branches:
- master
- r2.**
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
# Don't cancel in-progress jobs for master branches.
cancel-in-progress: ${{ github.ref != 'master' }}
jobs:
build-linux-x86-cpu:
uses: ./.github/workflows/build-reusable.yml
with:
runner: 'linux-x86-n2-16'
tfci: 'py313,linux_x86,rbe,no_docker'
build-linux-x86-cuda:
uses: ./.github/workflows/build-reusable.yml
with:
runner: 'linux-x86-n2-16'
tfci: 'py313,linux_x86_cuda,rbe,no_docker'
build-linux-x86-cuda13:
uses: ./.github/workflows/build-reusable.yml
with:
runner: 'linux-x86-n2-16'
tfci: 'py313,linux_x86_cuda13_nvcc,rbe,no_docker'
build-arm64:
uses: ./.github/workflows/build-reusable.yml
with:
runner: 'linux-x86-n2-16'
tfci: 'py313,linux_arm64_cross_compile,rbe,no_docker,enable_pycpp_build'
job_name: 'build-only'
build-windows-x86:
uses: ./.github/workflows/build-reusable.yml
with:
runner: 'windows-x86-n2-16'
tfci: 'py313,windows_x86_ml_actions,rbe'
+64
View File
@@ -0,0 +1,64 @@
/**
* @license
* Copyright 2021 Google LLC. 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.
* =============================================================================
*/
/** Extracts PR from commit message and creates a GitHub Issue on Rollback of PR
Created issue is assigned to original PR owner and reviewer.
@param {!object}
github enables querying for PR and also create issue using rest endpoint
context has the commit message details in the payload
@return {string} Returns the issue number and title
*/
module.exports = async ({github, context}) => {
const rollback_commit = context.payload.head_commit.id;
const pr_match_groups = context.payload.head_commit.message.match(/\Rollback of PR #(\d+).*/) || [];
if (pr_match_groups.length != 2) {
console.log(`PR Number not found in ${context.payload.head_commit.message}`);
throw "Error extracting PR Number from commit message";
}
const pr_number = parseInt(pr_match_groups[1]);
const owner = context.payload.repository.owner.name;
const repo = context.payload.repository.name;
console.log(`Original PR: ${pr_number} and Rollback Commit: ${rollback_commit}`);
// Get the Original PR Details
const pr_resp = await github.rest.pulls.get({
owner,
repo,
pull_number: pr_number
});
if (pr_resp.status != 200 || pr_resp.data.state != 'closed') {
console.log(`PR:{pr_number} is not found or closed. Not a valid condition to create an issue.`);
console.log(pr_resp);
throw `PR:{pr_number} needs to be valid and closed (merged)`;
}
const pr_title = pr_resp.data.title;
// Assign to PR owner and reviewers
const assignees = pr_resp.data.assignees.concat(pr_resp.data.requested_reviewers);
let assignee_logins = assignees.map(x => x.login);
assignee_logins.push(pr_resp.data.user.login);
console.log(assignee_logins);
// Create an new GH Issue and reference the Original PR
const resp = await github.rest.issues.create({
owner,
repo,
assignees: assignee_logins,
title: `Issue created for Rollback of PR #${pr_number}: ${pr_title}`,
body: `Merged PR #${pr_number} is rolled back in ${rollback_commit}.
Please follow up with the reviewer and close this issue once its resolved.`
});
return `Issue created: ${resp.data.number} with Title: ${resp.data.title}`;
};
+39
View File
@@ -0,0 +1,39 @@
# 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.
# ==============================================================================
name: Gemini PR Review
on:
pull_request:
types: [labeled]
permissions:
pull-requests: write
contents: read
jobs:
gemini-review:
if: github.event.label.name == 'Needs Review'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate Gemini Review Trigger
run: |
echo "Needs Review label detected successfully."
echo "Gemini enterprise review pipeline triggered."
echo "Using style guide from .gemini/styleguide.md"
@@ -0,0 +1,43 @@
# Copyright 2021 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.
# ==============================================================================
name: Creates a GitHub Issue when a PR Rolled back via Commit to Master
on:
push:
branches:
- master
permissions: {}
jobs:
create-issue-on-pr-rollback:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
pull-requests: read
if: |
github.repository == 'tensorflow/tensorflow' &&
startsWith(github.event.head_commit.message, 'Rollback of PR #')
steps:
- name: Checkout repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Create a new Github Issue
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const script = require('./.github/workflows/create_issue.js')
console.log(await script({github, context}))
@@ -0,0 +1,40 @@
# Copyright 2023 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.
# ==============================================================================
name: OSV-Scanner Scheduled Scan
on:
schedule:
- cron: 0 4 * * 1
permissions:
# Require writing security events to upload SARIF file to security tab
security-events: write
# Only need to read contents
contents: read
jobs:
scan-scheduled:
if: github.repository == 'tensorflow/tensorflow'
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@v2.3.1"
with:
scan-args: |-
--lockfile=requirements.txt:./requirements_lock_3_9.txt
--lockfile=requirements.txt:./requirements_lock_3_10.txt
--lockfile=requirements.txt:./requirements_lock_3_11.txt
--lockfile=requirements.txt:./requirements_lock_3_12.txt
--lockfile=requirements.txt:./ci/official/containers/linux_arm64/devel.requirements.txt
--lockfile=requirements.txt:./ci/official/containers/linux_arm64/jax.requirements.txt
--lockfile=requirements.txt:./ci/official/containers/linux_arm64/devel.usertools/test.requirements.txt
+50
View File
@@ -0,0 +1,50 @@
# Copyright 2021 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.
# ==============================================================================
name: PyLint
on:
pull_request:
paths:
- '**.py'
permissions:
contents: read
jobs:
build:
name: PyLint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Get file changes
id: get_file_changes
uses: trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b # v1.2.4
with:
output: ' '
- name: Report list of changed files
run: |
echo Changed files: ${{ steps.get_file_changes.outputs.files }}
- name: Set up Python 3.9
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: "3.9"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pylint==2.13.9 numpy wheel
- name: Run PyLint on changed files
run: |
echo "${{ steps.get_file_changes.outputs.files}}" | tr " " "\n" | grep ".py$" | xargs pylint --rcfile=tensorflow/tools/ci_build/pylintrc
@@ -0,0 +1,71 @@
# Copyright 2022 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.
# ==============================================================================
# Usage: Go to
# https://github.com/tensorflow/tensorflow/actions/workflows/release-branch-cherrypick.yml
# and click "Run Workflow." Leave "Use Workflow From" set to "master", then
# input the branch name and paste the cherry-pick commit and click Run. A PR
# will be created.
name: Release Branch Cherrypick
on:
workflow_dispatch:
inputs:
# We use this instead of the "run on branch" argument because GitHub looks
# on that branch for a workflow.yml file, and we'd have to cherry-pick
# this file into those branches.
release_branch:
description: 'Release branch name (e.g. r2.9)'
required: true
type: string
git_commit:
description: 'Git commit to cherry-pick'
required: true
type: string
permissions:
contents: read
jobs:
cherrypick:
name: Cherrypick to ${{ github.event.inputs.release_branch}} - ${{ github.event.inputs.git_commit }}
runs-on: ubuntu-latest
if: github.repository == 'tensorflow/tensorflow' # Don't do this in forks
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ github.event.inputs.release_branch }}
- name: Get some helpful info for formatting
id: cherrypick
run: |
git config --global user.name "TensorFlow Release Automation"
git config --global user.email "jenkins@tensorflow.org"
git fetch origin master
git cherry-pick ${{ github.event.inputs.git_commit }}
echo "SHORTSHA=$(git log -1 ${{ github.event.inputs.git_commit }} --format="%h")" >> "$GITHUB_OUTPUT"
echo "TITLE=$(git log -1 ${{ github.event.inputs.git_commit }} --format="%s")" >> "$GITHUB_OUTPUT"
- name: Create Pull Request with changes
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
with:
title: '${{ github.event.inputs.release_branch }} cherry-pick: ${{ steps.cherrypick.outputs.SHORTSHA }} "${{ steps.cherrypick.outputs.TITLE }}"'
committer: TensorFlow Release Automation <jenkins@tensorflow.org>
token: ${{ secrets.JENKINS_TOKEN }}
base: ${{ github.event.inputs.release_branch }}
branch: ${{ github.event.inputs.release_branch }}-${{ steps.cherrypick.outputs.SHORTSHA }}
reviewers: learning-to-play
body: |
Refer to the original commit: https://github.com/tensorflow/tensorflow/commit/${{ github.event.inputs.git_commit }}
+69
View File
@@ -0,0 +1,69 @@
# Copyright 2022 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.
# ============================================================================
name: Scorecards supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '26 3 * * 2'
push:
branches: [ "master" ]
# Declare default permissions as read only.
permissions: read-all
jobs:
analysis:
if: github.repository == 'tensorflow/tensorflow' # Don't do this in forks
name: Scorecards analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
steps:
- name: "Checkout code"
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
with:
results_file: results.sarif
results_format: sarif
publish_results: true
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5
with:
sarif_file: results.sarif
+83
View File
@@ -0,0 +1,83 @@
# Copyright 2023 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.
# ============================================================================
name: Close inactive issues
on:
schedule:
- cron: "30 1 * * *"
permissions:
contents: read
jobs:
close-issues:
# Don't do this in forks
if: github.repository == 'tensorflow/tensorflow'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Awaiting response issues
uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1
with:
#Comma separated list of labels that can be assigned to issues to exclude them from being marked as stale
exempt-issue-labels: 'override-stale'
#Comma separated list of labels that can be assigned to PRs to exclude them from being marked as stale
exempt-pr-labels: "override-stale"
#Limit the No. of API calls in one run default value is 30.
operations-per-run: 1000
days-before-issue-stale: 7
days-before-issue-close: 7
stale-issue-label: "stale"
# reason for closed the issue default value is not_planned
close-issue-reason: completed
# List of labels to remove when issues/PRs unstale.
labels-to-remove-when-unstale: 'stat:awaiting response'
only-labels: "stat:awaiting response"
stale-issue-message: >
This issue is stale because it has been open for 7 days with no activity.
It will be closed if no further activity occurs. Thank you.
close-issue-message: >
This issue was closed because it has been inactive for 7 days since being marked as stale.
Please reopen if you'd like to work on this further.
days-before-pr-stale: 14
days-before-pr-close: 14
stale-pr-message: "This PR is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you."
close-pr-message: "This PR was closed because it has been inactive for 14 days since being marked as stale. Please reopen if you'd like to work on this further."
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Contribution issues
uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1
with:
#Comma separated list of labels that can be assigned to issues to exclude them from being marked as stale
exempt-issue-labels: 'override-stale'
#Comma separated list of labels that can be assigned to PRs to exclude them from being marked as stale
exempt-pr-labels: "override-stale"
#Limit the No. of API calls in one run default value is 30.
operations-per-run: 1000
days-before-issue-stale: 180
days-before-issue-close: 365
stale-issue-label: "stale"
# reason for closed the issue default value is not_planned
close-issue-reason: completed
# List of labels to remove when issues/PRs unstale.
labels-to-remove-when-unstale: "stat:contribution welcome,stat:good first issue"
any-of-labels: "stat:contribution welcome,stat:good first issue"
stale-issue-message: >
This issue is stale because it has been open for 180 days with no activity.
It will be closed if no further activity occurs. Thank you.
close-issue-message: >
This issue was closed because it has been inactive for 1 year.
repo-token: ${{ secrets.GITHUB_TOKEN }}
+34
View File
@@ -0,0 +1,34 @@
# 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.
# ============================================================================
on:
workflow_dispatch: # Allow manual triggers
schedule:
- cron: 0 4 * * * # 4am UTC is 9pm PDT and 8pm PST
name: Set nightly branch to master HEAD
permissions: {}
jobs:
master-to-nightly:
if: github.repository == 'tensorflow/tensorflow' # Don't do this in forks
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: zofrex/mirror-branch@0be56f4c8077a288a635a491b306ba0bb1c810e6 # v1.0.4
name: Set nightly branch to master HEAD
with:
target-branch: 'nightly'
+143
View File
@@ -0,0 +1,143 @@
# Copyright 2022 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.
# ==============================================================================
# This Workflow updates tensorflow/tools/toolchains/remote_config/configs.bzl
# to reference the most recent versions of the SIG Build Docker images.
name: Update RBE Configs
on:
workflow_dispatch:
permissions:
contents: read
jobs:
rbe:
name: Update RBE Configs
runs-on: ubuntu-latest
if: github.repository == 'tensorflow/tensorflow' # Don't do this in forks
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Update the RBE Configs
run: |
function map() {
# The "digest" that allows us to pull an image is not the digest as
# returned by the API, but a sha256sum of the entire chunk of image
# metadata. gcr.io helpfully includes it in the header of the response
# as docker-content-digest: sha256:[digest]. Note we use egrep to
# match exactly sha256:<hash> because curl may include a ^M symbol at
# the end of the line.
# See https://cloud.google.com/architecture/using-container-images#exploring_image_manifests_digests_and_tags
echo -n "Trying to map name $1 to tag $2... "
digest=$(curl -s --head "https://gcr.io/v2/tensorflow-sigs/build/manifests/$2" | egrep -o "sha256:[[:alnum:]]*")
# Find the line matching the regex "sigbuild-r2.9" (with quotes) and
# replace just the digest portion in it
sed -i"" "/\"$1\"/ s/sha256:[[:alnum:]]*/$digest/g" tensorflow/tools/toolchains/remote_config/configs.bzl
echo "success."
}
# See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/toolchains/remote_config/configs.bzl
# This is a mapping of name_container_map keys under sigbuild_tf_configs
# to tag names on gcr.io/tensorflow-sigs/build.
# TF 2.9
map sigbuild-r2.9 2.9-python3.9
map sigbuild-r2.9-python3.8 2.9-python3.8
map sigbuild-r2.9-python3.9 2.9-python3.9
map sigbuild-r2.9-python3.10 2.9-python3.10
# TF 2.10
map sigbuild-r2.10 2.10-python3.9
map sigbuild-r2.10-python3.8 2.10-python3.8
map sigbuild-r2.10-python3.9 2.10-python3.9
map sigbuild-r2.10-python3.10 2.10-python3.10
# TF 2.11
map sigbuild-r2.11 2.11-python3.9
map sigbuild-r2.11-python3.8 2.11-python3.8
map sigbuild-r2.11-python3.9 2.11-python3.9
map sigbuild-r2.11-python3.10 2.11-python3.10
# WIP Clang Containers, used by TVCs
map sigbuild-57469 57469-python3.9
map sigbuild-57469-python3.8 57469-python3.8
map sigbuild-57469-python3.9 57469-python3.9
map sigbuild-57469-python3.10 57469-python3.10
# TF 2.12
map sigbuild-r2.12 2.12-python3.9
map sigbuild-r2.12-python3.8 2.12-python3.8
map sigbuild-r2.12-python3.9 2.12-python3.9
map sigbuild-r2.12-python3.10 2.12-python3.10
map sigbuild-r2.12-python3.11 2.12-python3.11
# TF 2.12 + Clang (containers are the same, but env vars in configs.bzl are different)
map sigbuild-r2.12-clang 2.12-python3.9
map sigbuild-r2.12-clang-python3.8 2.12-python3.8
map sigbuild-r2.12-clang-python3.9 2.12-python3.9
map sigbuild-r2.12-clang-python3.10 2.12-python3.10
map sigbuild-r2.12-clang-python3.11 2.12-python3.11
# TF 2.13
map sigbuild-r2.13 2.13-python3.9
map sigbuild-r2.13-python3.8 2.13-python3.8
map sigbuild-r2.13-python3.9 2.13-python3.9
map sigbuild-r2.13-python3.10 2.13-python3.10
map sigbuild-r2.13-python3.11 2.13-python3.11
# TF 2.13 + Clang (containers are the same, but env vars in configs.bzl are different)
map sigbuild-r2.13-clang 2.13-python3.9
map sigbuild-r2.13-clang-python3.8 2.13-python3.8
map sigbuild-r2.13-clang-python3.9 2.13-python3.9
map sigbuild-r2.13-clang-python3.10 2.13-python3.10
map sigbuild-r2.13-clang-python3.11 2.13-python3.11
# TF 2.14
map sigbuild-r2.14 2.14-python3.9
map sigbuild-r2.14-python3.9 2.14-python3.9
map sigbuild-r2.14-python3.10 2.14-python3.10
map sigbuild-r2.14-python3.11 2.14-python3.11
# TF 2.14 + Clang (containers are the same, but env vars in configs.bzl are different)
map sigbuild-r2.14-clang 2.14-python3.9
map sigbuild-r2.14-clang-python3.9 2.14-python3.9
map sigbuild-r2.14-clang-python3.10 2.14-python3.10
map sigbuild-r2.14-clang-python3.11 2.14-python3.11
# TF 2.16
map sigbuild-r2.16 2.16-python3.11
map sigbuild-r2.16-python3.9 2.16-python3.9
map sigbuild-r2.16-python3.10 2.16-python3.10
map sigbuild-r2.16-python3.11 2.16-python3.11
map sigbuild-r2.16-python3.12 2.16-python3.12
# TF 2.16 + Clang (containers are the same, but env vars in configs.bzl are different)
map sigbuild-r2.16-clang 2.16-python3.11
map sigbuild-r2.16-clang-python3.9 2.16-python3.9
map sigbuild-r2.16-clang-python3.10 2.16-python3.10
map sigbuild-r2.16-clang-python3.11 2.16-python3.11
map sigbuild-r2.16-clang-python3.12 2.16-python3.12
# TF 2.17
map sigbuild-r2.17 2.17-python3.11
map sigbuild-r2.17-python3.9 2.17-python3.9
map sigbuild-r2.17-python3.10 2.17-python3.10
map sigbuild-r2.17-python3.11 2.17-python3.11
map sigbuild-r2.17-python3.12 2.17-python3.12
# TF 2.17 + Clang (containers are the same, but env vars in configs.bzl are different)
map sigbuild-r2.17-clang 2.17-python3.11
map sigbuild-r2.17-clang-python3.9 2.17-python3.9
map sigbuild-r2.17-clang-python3.10 2.17-python3.10
map sigbuild-r2.17-clang-python3.11 2.17-python3.11
map sigbuild-r2.17-clang-python3.12 2.17-python3.12
- name: Create Pull Request with changes
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
with:
title: Update the RBE images to the latest container versions
committer: TensorFlow Release Automation <jenkins@tensorflow.org>
token: ${{ secrets.JENKINS_TOKEN }}
reviewers: mihaimaruseac,learning-to-play,nitins17
body: |
This PR was created by a GitHub Actions workflow to update all the SIG Build-based RBE containers to the most recent containers. See:
- https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/toolchains/remote_config/configs.bzl
- https://github.com/tensorflow/tensorflow/blob/master/.github/workflows/update-rbe.yml