forked from tensorflow/tensorflow
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into develop-upstream-…
…sync-241204
- Loading branch information
Showing
2,746 changed files
with
102,769 additions
and
55,950 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
################################################################################ | ||
FROM ubuntu:20.04@sha256:8e5c4f0285ecbb4ead070431d29b576a530d3166df73ec44affc1cd27555141b as devel | ||
################################################################################ | ||
|
||
# Install devtoolset build dependencies | ||
COPY setup.sources.sh /setup.sources.sh | ||
COPY setup.packages.sh /setup.packages.sh | ||
COPY builder.packages.txt /builder.packages.txt | ||
|
||
RUN /setup.sources.sh && /setup.packages.sh /builder.packages.txt | ||
|
||
RUN update-ca-certificates | ||
# Install devtoolset-9 in /dt10 with glibc 2.17 and libstdc++ 4.8, for building | ||
# manylinux2014-compatible packages. | ||
COPY builder.devtoolset/fixlinks_aarch64.sh /fixlinks.sh | ||
COPY builder.devtoolset/rpm-patch.sh /rpm-patch.sh | ||
COPY builder.devtoolset/build_devtoolset.sh /build_devtoolset.sh | ||
COPY builder.devtoolset/gcc9-fixups.patch /gcc9-fixups.patch | ||
COPY builder.devtoolset/stringop_trunc.patch /stringop_trunc.patch | ||
|
||
RUN /build_devtoolset.sh devtoolset-10 /dt10 | ||
|
||
# Build later version of patchelf that is not so buggy | ||
RUN wget https://github.com/NixOS/patchelf/releases/download/0.18.0/patchelf-0.18.0-aarch64.tar.gz && tar -zxvf patchelf-0.18.0-aarch64.tar.gz -C /usr && rm -rf patchelf-0.18.0-aarch64.tar.gz | ||
|
||
RUN curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-arm.tar.gz | \ | ||
tar zxf - google-cloud-sdk && \ | ||
google-cloud-sdk/install.sh --quiet | ||
ENV PATH="$PATH:/google-cloud-sdk/bin/" | ||
|
||
# Install various tools. | ||
# - bats: bash unit testing framework | ||
# NOTE: v1.6.0 seems to have a bug that made "git" in setup_file break | ||
# - bazelisk: always use the correct bazel version | ||
# - buildifier: clean bazel build depshttps://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildifier-linux-arm64 | ||
# - buildozer: clean bazel build deps | ||
RUN git clone --branch v1.11.0 https://github.com/bats-core/bats-core.git && bats-core/install.sh /usr/local && rm -rf bats-core | ||
RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.21.0/bazelisk-linux-arm64 -O /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel | ||
RUN wget https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildifier-linux-arm64 -O /usr/local/bin/buildifier && chmod +x /usr/local/bin/buildifier | ||
RUN wget https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildozer-linux-arm64 -O /usr/local/bin/buildozer && chmod +x /usr/local/bin/buildozer | ||
|
||
RUN groupadd -g 1001 buildslave && useradd -m -u 1001 -g buildslave buildslave | ||
RUN mkdir -p /tf/venv | ||
RUN chown -R buildslave:buildslave /tf | ||
|
||
# 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 build and environment | ||
COPY devel.bashrc /root/.bashrc | ||
COPY ld.so.conf /dt10/etc/ | ||
|
||
# Make sure clang is on the path | ||
RUN ln -s /usr/lib/llvm-18/bin/clang /usr/bin/clang | ||
|
||
# Setup JAX Python environment. | ||
COPY requirements.txt /requirements.txt | ||
COPY setup.python.sh /setup.python.sh | ||
RUN /setup.python.sh python3.9 requirements.txt | ||
RUN /setup.python.sh python3.10 requirements.txt | ||
RUN /setup.python.sh python3.11 requirements.txt | ||
RUN /setup.python.sh python3.12 requirements.txt | ||
RUN /setup.python.sh python3.13 requirements.txt | ||
|
||
# Python commands by default run under 3.11 | ||
RUN ln -sf /usr/bin/python3.11 /usr/bin/python3 | ||
RUN ln -sf /usr/bin/python3.11 /usr/bin/python | ||
RUN ln -sf /usr/lib/python3.11 /usr/lib/tf_python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* 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. | ||
==============================================================================*/ | ||
APT::Default-Release "focal"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/bash | ||
# 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. | ||
# ============================================================================== | ||
|
||
# Builds the following Docker images for Linux ARM64. See the accompanying | ||
# Dockerfile for more details: | ||
# - us-central1-docker.pkg.dev/tensorflow-sigs/ml-build-arm64:latest-multi-python | ||
|
||
set -exo pipefail | ||
|
||
function is_continuous_or_release() { | ||
[[ "$KOKORO_JOB_TYPE" == "CONTINUOUS_INTEGRATION" ]] || [[ "$KOKORO_JOB_TYPE" == "RELEASE" ]] | ||
} | ||
|
||
# Move into the directory of the script | ||
cd "$(dirname "$0")" | ||
|
||
if is_continuous_or_release || [[ -z "$KOKORO_BUILD_ID" ]]; then | ||
# A continuous job is the only one to publish to latest | ||
TAG="latest" | ||
else | ||
TAG=$(head -n 1 "$KOKORO_PIPER_DIR/presubmit_request.txt" | grep -oP "^presubmit_changelist: +\K(\d+)") | ||
fi | ||
|
||
AR_IMAGE_PATH="us-central1-docker.pkg.dev/tensorflow-sigs/tensorflow/ml-build-arm64" | ||
|
||
# Build for both JAX and TF usage. We do these in one place because they share | ||
# almost all of the same cache layers | ||
export DOCKER_BUILDKIT=1 | ||
AR_IMAGE="$AR_IMAGE_PATH:$TAG" | ||
docker pull "$AR_IMAGE" || true | ||
# Due to some flakiness of resources pulled in the build, allow the docker | ||
# command to reattempt build a few times in the case of failure (b/302558736) | ||
set +e | ||
for i in $(seq 1 5) | ||
do | ||
docker build \ | ||
--build-arg REQUIREMENTS_FILE=jax.requirements.txt \ | ||
--cache-from "$AR_IMAGE" \ | ||
-t "$AR_IMAGE" . && break | ||
done | ||
final=$? | ||
if [ $final -ne 0 ]; then | ||
exit $final | ||
fi | ||
set -e | ||
|
||
INFRA_PUBLIC_TAG=infrastructure-public-image-$(docker images "$AR_IMAGE" --quiet) | ||
AR_IMAGE_INFRA_PUBLIC="$AR_IMAGE_PATH:$INFRA_PUBLIC_TAG" | ||
docker image tag "$AR_IMAGE" "$AR_IMAGE_INFRA_PUBLIC" | ||
|
||
gcloud auth configure-docker us-central1-docker.pkg.dev | ||
docker push "$AR_IMAGE_PATH" --all-tags |
Oops, something went wrong.