From d95b111484c1dcdc80c4be7ebb188230b0e204c5 Mon Sep 17 00:00:00 2001 From: Quoc Truong Date: Fri, 21 Mar 2025 13:33:00 -0700 Subject: [PATCH] Remove GitHub Actions for building tensorflow sigs Dockerfile since we have migrated to the new ML build container. The new ML Build Container Dockerfile can be found under https://github.com/tensorflow/tensorflow/tree/master/ci/official/containers/ml_build PiperOrigin-RevId: 739282534 --- .github/workflows/sigbuild-docker-branch.yml | 86 -------------- .../workflows/sigbuild-docker-presubmit.yml | 108 ------------------ .github/workflows/sigbuild-docker.yml | 105 ----------------- 3 files changed, 299 deletions(-) delete mode 100644 .github/workflows/sigbuild-docker-branch.yml delete mode 100644 .github/workflows/sigbuild-docker-presubmit.yml delete mode 100644 .github/workflows/sigbuild-docker.yml diff --git a/.github/workflows/sigbuild-docker-branch.yml b/.github/workflows/sigbuild-docker-branch.yml deleted file mode 100644 index 35086f5d073..00000000000 --- a/.github/workflows/sigbuild-docker-branch.yml +++ /dev/null @@ -1,86 +0,0 @@ -# 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: Upload SIG Build docker containers modified for release branches - -on: - workflow_dispatch: - push: - paths: - - '.github/workflows/sigbuild-docker-branch.yml' - - 'tensorflow/tools/tf_sig_build_dockerfiles/**' - - '!tensorflow/tools/tf_sig_build_dockerfiles/README.md' - branches: - - "r[1-9].[0-9]+" - -permissions: - contents: read - -jobs: - docker: - if: github.repository == 'tensorflow/tensorflow' # Don't do this in forks - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [python3.9, python3.10, python3.11, python3.12] - steps: - - name: Delete unnecessary tools folder - run: rm -rf /opt/hostedtoolcache - - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 - - - name: Login to DockerHub - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Login to GCR - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 - with: - registry: gcr.io - username: _json_key - password: ${{ secrets.GCP_CREDS }} - - - name: Generate variables for cache busting and tag naming - run: | - echo "DATE=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" - # Converts r2.9 to just 2.9 - echo "REF=$(echo $GITHUB_REF_NAME | sed 's/r//g')" >> "$GITHUB_OUTPUT" - id: vars - - - name: Build and push - id: docker_build - uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0 - with: - push: true - context: ./tensorflow/tools/tf_sig_build_dockerfiles - target: devel - build-args: | - PYTHON_VERSION=${{ matrix.python-version }} - CACHEBUSTER=${{ steps.vars.outputs.DATE }} - tags: | - tensorflow/build:${{ steps.vars.outputs.REF }}-${{ matrix.python-version }} - gcr.io/tensorflow-sigs/build:${{ steps.vars.outputs.REF }}-${{ matrix.python-version }} - cache-from: type=registry,ref=tensorflow/build:${{ steps.vars.outputs.REF }}-${{ matrix.python-version }} - cache-to: type=inline - - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} - diff --git a/.github/workflows/sigbuild-docker-presubmit.yml b/.github/workflows/sigbuild-docker-presubmit.yml deleted file mode 100644 index 3a30dd849d2..00000000000 --- a/.github/workflows/sigbuild-docker-presubmit.yml +++ /dev/null @@ -1,108 +0,0 @@ -# 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: Build SIG Build containers as presubmits - -on: - pull_request: - types: [labeled, opened, synchronize, reopened] - paths: - - '.github/workflows/sigbuild-docker-presubmit.yml' - - 'tensorflow/tools/tf_sig_build_dockerfiles/**' - - '!tensorflow/tools/tf_sig_build_dockerfiles/README.md' - -permissions: - contents: read - -jobs: - docker: - if: github.repository == 'tensorflow/tensorflow' # Don't do this in forks - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [python3.9, python3.10, python3.11, python3.12] - permissions: - contents: read - pull-requests: write - steps: - - name: Delete unnecessary tools folder - run: | - df -h - rm -rf /opt/hostedtoolcache - df -h - - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 - - - name: Login to GCR - if: contains(github.event.pull_request.labels.*.name, 'build and push to gcr.io for staging') - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 - with: - registry: gcr.io - username: _json_key - password: ${{ secrets.GCP_CREDS }} - - - name: Login to AR - # Once this is verified, change the label's name. For now, we will piggyback on gcr.io actions. - if: contains(github.event.pull_request.labels.*.name, 'build and push to gcr.io for staging') - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 - with: - registry: us-central1-docker.pkg.dev - username: _json_key - password: ${{ secrets.GCP_CREDS }} - - - name: Grab the date to do cache busting (assumes same day OK to keep) - run: | - echo "DATE=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" - id: date - - - name: Build containers, and push to GCR only if the 'build and push to gcr.io for staging' label is applied - id: docker_build - uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0 - with: - push: ${{ contains(github.event.pull_request.labels.*.name, 'build and push to gcr.io for staging') }} - context: ./tensorflow/tools/tf_sig_build_dockerfiles - target: devel - build-args: | - PYTHON_VERSION=${{ matrix.python-version }} - CACHEBUSTER=${{ steps.date.outputs.DATE }} - tags: | - gcr.io/tensorflow-sigs/build:${{ github.event.number }}-${{ matrix.python-version }} - us-central1-docker.pkg.dev/tensorflow-sigs/tensorflow/build:${{ github.event.number }}-${{ matrix.python-version }} - cache-from: | - type=registry,ref=tensorflow/build:latest-${{ matrix.python-version }} - type=registry,ref=gcr.io/tensorflow-sigs/build:${{ github.event.number }}-${{ matrix.python-version }} - cache-to: type=inline - - - name: Add a comment with the pushed containers - uses: mshick/add-pr-comment@dd126dd8c253650d181ad9538d8b4fa218fc31e8 # v2 - if: contains(github.event.pull_request.labels.*.name, 'build and push to gcr.io for staging') - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - message: | - I pushed these containers: - - - `gcr.io/tensorflow-sigs/build:${{ github.event.number }}-python3.12` - - `gcr.io/tensorflow-sigs/build:${{ github.event.number }}-python3.11` - - `gcr.io/tensorflow-sigs/build:${{ github.event.number }}-python3.10` - - `gcr.io/tensorflow-sigs/build:${{ github.event.number }}-python3.9` - - Re-apply the `build and push to gcr.io for staging` label to rebuild and push again. This comment will only be posted once. - - - name: Print image digest - run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.github/workflows/sigbuild-docker.yml b/.github/workflows/sigbuild-docker.yml deleted file mode 100644 index 3b1026abfc6..00000000000 --- a/.github/workflows/sigbuild-docker.yml +++ /dev/null @@ -1,105 +0,0 @@ -# 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: Upload SIG Build docker containers regularly - -on: - workflow_dispatch: - schedule: - # Run once a week on Sunday at midnight. See http://crontab.guru - - cron: '0 0 * * 0' - push: - paths: - - '.github/workflows/sigbuild-docker.yml' - - 'tensorflow/tools/tf_sig_build_dockerfiles/**' - - '!tensorflow/tools/tf_sig_build_dockerfiles/README.md' - branches: - - master - -permissions: - contents: read - -jobs: - docker: - if: github.repository == 'tensorflow/tensorflow' # Don't do this in forks - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [python3.9, python3.10, python3.11, python3.12] - steps: - - name: Delete unnecessary tools folder - run: rm -rf /opt/hostedtoolcache - - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 - - - name: Login to DockerHub - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Login to GCR - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 - with: - registry: gcr.io - username: _json_key - password: ${{ secrets.GCP_CREDS }} - - - name: Login to AR - # Once this is verified, removed gcr.io actions. - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 - with: - registry: us-central1-docker.pkg.dev - username: _json_key - password: ${{ secrets.GCP_CREDS }} - - - name: Grab the upcoming TF version to tag this container - run: | - # [[:digit:]] searches for numbers and \+ joins them together - major_version=$(grep "^#define TF_MAJOR_VERSION" ./tensorflow/core/public/version.h | grep -o "[[:digit:]]\+") - minor_version=$(grep "^#define TF_MINOR_VERSION" ./tensorflow/core/public/version.h | grep -o "[[:digit:]]\+") - echo "TF_VERSION=${major_version}.${minor_version}" >> "$GITHUB_OUTPUT" - # Also get the current date to do cache busting. Assumes one day - # is an ok range for rebuilds - echo "DATE=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" - id: tf-version - - - name: Build and push - id: docker_build - uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0 - with: - push: true - context: ./tensorflow/tools/tf_sig_build_dockerfiles - target: devel - build-args: | - PYTHON_VERSION=${{ matrix.python-version }} - CACHEBUSTER=${{ steps.tf-version.outputs.DATE }} - tags: | - tensorflow/build:latest-${{ matrix.python-version }} - tensorflow/build:${{ steps.tf-version.outputs.TF_VERSION }}-${{ matrix.python-version }} - gcr.io/tensorflow-sigs/build:latest-${{ matrix.python-version }} - gcr.io/tensorflow-sigs/build:${{ steps.tf-version.outputs.TF_VERSION }}-${{ matrix.python-version }} - us-central1-docker.pkg.dev/tensorflow-sigs/tensorflow/build:latest-${{ matrix.python-version }} - us-central1-docker.pkg.dev/tensorflow-sigs/tensorflow/build:${{ steps.tf-version.outputs.TF_VERSION }}-${{ matrix.python-version }} - cache-from: type=registry,ref=tensorflow/build:latest-${{ matrix.python-version }} - cache-to: type=inline - - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} -