Skip to content
Snippets Groups Projects
Commit f8be5fd3 authored by Austin Anderson's avatar Austin Anderson
Browse files

Add CACHEBUSTER to always get the latest pip packages

parent 42a61960
Branches
No related tags found
No related merge requests found
...@@ -29,6 +29,11 @@ jobs: ...@@ -29,6 +29,11 @@ jobs:
registry: gcr.io registry: gcr.io
username: _json_key username: _json_key
password: ${{ secrets.GCP_CREDS }} password: ${{ secrets.GCP_CREDS }}
-
name: Grab the date to do cache busting (assumes same day OK to keep)
run: |
echo "::set-output name=DATE::$(date +'%Y-%m-%d')"
id: date
- -
name: Build containers, and push to GCR only if the 'build and push to gcr.io for staging' label is applied name: Build containers, and push to GCR only if the 'build and push to gcr.io for staging' label is applied
id: docker_build id: docker_build
...@@ -39,6 +44,7 @@ jobs: ...@@ -39,6 +44,7 @@ jobs:
target: devel target: devel
build-args: | build-args: |
PYTHON_VERSION=${{ matrix.python-version }} PYTHON_VERSION=${{ matrix.python-version }}
CACHEBUSTER=${{ steps.date.outputs.DATE }}
tags: | tags: |
gcr.io/tensorflow-sigs/build:${{ github.event.number }}-${{ matrix.python-version }} gcr.io/tensorflow-sigs/build:${{ github.event.number }}-${{ matrix.python-version }}
cache-from: | cache-from: |
......
...@@ -50,6 +50,9 @@ jobs: ...@@ -50,6 +50,9 @@ jobs:
major_version=$(grep "^#define TF_MAJOR_VERSION" ./tensorflow/tensorflow/core/public/version.h | grep -o "[[:digit:]]\+") major_version=$(grep "^#define TF_MAJOR_VERSION" ./tensorflow/tensorflow/core/public/version.h | grep -o "[[:digit:]]\+")
minor_version=$(grep "^#define TF_MINOR_VERSION" ./tensorflow/tensorflow/core/public/version.h | grep -o "[[:digit:]]\+") minor_version=$(grep "^#define TF_MINOR_VERSION" ./tensorflow/tensorflow/core/public/version.h | grep -o "[[:digit:]]\+")
echo ::set-output name=TF_VERSION::${major_version}.${minor_version} echo ::set-output name=TF_VERSION::${major_version}.${minor_version}
# Also get the current date to do cache busting. Assumes one day
# is an ok range for rebuilds
echo "::set-output name=DATE::$(date +'%Y-%m-%d')"
id: tf-version id: tf-version
- -
name: Build and push name: Build and push
...@@ -61,6 +64,7 @@ jobs: ...@@ -61,6 +64,7 @@ jobs:
target: devel target: devel
build-args: | build-args: |
PYTHON_VERSION=${{ matrix.python-version }} PYTHON_VERSION=${{ matrix.python-version }}
CACHEBUSTER=${{ steps.tf-version.outputs.DATE }}
tags: | tags: |
tensorflow/build:latest-${{ matrix.python-version }} tensorflow/build:latest-${{ matrix.python-version }}
tensorflow/build:${{ steps.tf-version.outputs.TF_VERSION }}-${{ matrix.python-version }} tensorflow/build:${{ steps.tf-version.outputs.TF_VERSION }}-${{ matrix.python-version }}
......
...@@ -41,6 +41,12 @@ RUN curl -sSL https://sdk.cloud.google.com > /tmp/gcl && bash /tmp/gcl --install ...@@ -41,6 +41,12 @@ RUN curl -sSL https://sdk.cloud.google.com > /tmp/gcl && bash /tmp/gcl --install
# RUN wget https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz -O /clang.tar.xz && tar xf /clang.tar.xz clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-format && mv ./clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-format /usr/local/bin/clang-format && rm -rf ./clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu.tar.xz ./clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu # RUN wget https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz -O /clang.tar.xz && tar xf /clang.tar.xz clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-format && mv ./clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-format /usr/local/bin/clang-format && rm -rf ./clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu.tar.xz ./clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu
# All lines past this point are reset when $CACHEBUSTER is set. We need this
# for Python specifically because we install some nightly packages which are
# likely to change daily.
ARG CACHEBUSTER=0
RUN echo $CACHEBUSTER
# Setup Python environment. PYTHON_VERSION is e.g. "python3.8" # Setup Python environment. PYTHON_VERSION is e.g. "python3.8"
ARG PYTHON_VERSION ARG PYTHON_VERSION
COPY setup.python.sh /setup.python.sh COPY setup.python.sh /setup.python.sh
......
...@@ -27,7 +27,8 @@ gast == 0.4.0 ...@@ -27,7 +27,8 @@ gast == 0.4.0
# Note that here we want the latest version that matches TF major.minor version # Note that here we want the latest version that matches TF major.minor version
# Note that we must use nightly here as these are used in nightly jobs # Note that we must use nightly here as these are used in nightly jobs
# For release jobs, we will pin these on the release branch # For release jobs, we will pin these on the release branch
# TODO(angerson) We need to somehow invalidate the cache on these regularly # Note that the CACHEBUSTER variable, set in the CI builds, will force these to
# be the latest version.
keras-nightly ~= 2.9.0.dev keras-nightly ~= 2.9.0.dev
tb-nightly ~= 2.9.0.a tb-nightly ~= 2.9.0.a
tf-estimator-nightly ~= 2.9.0.dev tf-estimator-nightly ~= 2.9.0.dev
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment