diff --git a/SPECS/python-tensorboard/0000-Use-system-package.patch b/SPECS/python-tensorboard/0000-Use-system-package.patch new file mode 100644 index 00000000000..a30a929f698 --- /dev/null +++ b/SPECS/python-tensorboard/0000-Use-system-package.patch @@ -0,0 +1,12 @@ +diff -urN tensorboard-2.16.2/tensorboard/pip_package/build_pip_package.sh tensorboard-2.16.2/tensorboard/pip_package/build_pip_package.sh +--- tensorboard-2.16.2/tensorboard/pip_package/build_pip_package.sh 2024-04-29 08:54:07.635971311 -0700 ++++ tensorboard-2.16.2/tensorboard/pip_package/build_pip_package.sh 2024-04-29 08:55:27.281331937 -0700 +@@ -103,8 +103,6 @@ + + virtualenv -q -p python3 venv + export VIRTUAL_ENV=venv +- export PATH="${PWD}/venv/bin:${PATH}" +- unset PYTHON_HOME + + # Require wheel for bdist_wheel command, and setuptools 36.2.0+ so that + # env markers are handled (https://github.com/pypa/setuptools/pull/1081) diff --git a/SPECS/python-tensorboard/dockerfile b/SPECS/python-tensorboard/dockerfile new file mode 100644 index 00000000000..d87f74c8685 --- /dev/null +++ b/SPECS/python-tensorboard/dockerfile @@ -0,0 +1,50 @@ +# Three things important for creating the cache +# i) Bazel version should match .bazelversion file +# ii) The Working directory should match the directory where this cache will be used. +# for example: In AZL3.0 tensorflow is built in "/usr/src/azl/BUILD/tensorflow-$version". +# iii) Python version should match the version in caching phase and the build phase + +FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 + +ARG TB_VERSION + +WORKDIR /root/ +# RUN tdnf -y install createrepo +# COPY RPMS /opt/rpms +# COPY custom.repo /etc/yum.repos.d + +# COPY toolchain_rpms /opt/rpms +# RUN createrepo /opt/rpms +#bazel version must match with the .bazelversion +RUN tdnf -y install build-essential git tar bazel python3-devel python3-numpy python3-pip python3-wheel python3-six python3-setuptools python3-virtualenv python3-protobuf python3-absl-py gcc zlib wget ca-certificates +RUN tdnf -y install which python3-werkzeug +# Create Working Directory +RUN wget https://github.com/tensorflow/tensorboard/archive/refs/tags/$TB_VERSION.tar.gz +RUN mkdir -p /usr/src/azl/BUILD +RUN tar -xvf $TB_VERSION.tar.gz -C /usr/src/azl/BUILD +WORKDIR /usr/src/azl/BUILD/tensorboard-$TB_VERSION +RUN ln -s /usr/bin/python3 /usr/bin/python + +RUN bazel --output_user_root=./tb_tmp fetch //tensorboard/pip_package:build_pip_package +# As compiling start we exit the command. This indicates all the dependencies has been downloaded +# should take 5-10 mins +RUN bazel --output_user_root=./tb_tmp build //tensorboard/pip_package:build_pip_package > /tmp/bazel_output.log 2>&1 & \ + pid=$! && \ + while true; do \ + if grep -q "Compiling" /tmp/bazel_output.log; then \ + echo "Compiling detected, exiting..." && \ + kill $pid && \ + exit 0; \ + fi; \ + sleep 1; \ + done + + +# clean up any compiled code +RUN bazel clean + +WORKDIR /usr/src/azl/BUILD +RUN tar -czf tensorboard-$TB_VERSION.tar.gz tensorboard-$TB_VERSION +RUN mv tensorboard-$TB_VERSION.tar.gz /root + +CMD ["bash"] diff --git a/SPECS/python-tensorboard/genereate_source_tarball.sh b/SPECS/python-tensorboard/genereate_source_tarball.sh new file mode 100644 index 00000000000..e09844ea8fa --- /dev/null +++ b/SPECS/python-tensorboard/genereate_source_tarball.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# output = tensorboard-$TB_VERSION.tar.gz +# Tensorboard version to use +TB_VERSION="2.16.2" + +docker build --build-arg TB_VERSION=$TB_VERSION -t tensorboard . + +CONTAINER_ID=$(docker run -d tensorboard) + +docker cp $CONTAINER_ID:/root/tensorboard-$TB_VERSION.tar.gz $PWD + +docker stop $CONTAINER_ID +docker rm $CONTAINER_ID diff --git a/SPECS/python-tensorboard/python-tensorboard.signatures.json b/SPECS/python-tensorboard/python-tensorboard.signatures.json index b0bfcd8446a..adea6a48847 100644 --- a/SPECS/python-tensorboard/python-tensorboard.signatures.json +++ b/SPECS/python-tensorboard/python-tensorboard.signatures.json @@ -1,6 +1,5 @@ { "Signatures": { - "python-tensorboard-2.11.0.tar.gz": "4045f3eca77ef335dcd70879ff9aecc2d2ba09e3fb5f39e501f868b4ab23c2b2", - "python-tensorboard-2.11.0-cache.tar.gz": "77b35869c63fc15b5cdeeff3dc6ac472e79a62739a69537bf60a38fa902b66a4" + "python-tensorboard-2.16.2.tar.gz": "9e69ad2243289a82500547271a213a4ee7a8be89fdebdd87372dac953e61b834" } - } +} diff --git a/SPECS/python-tensorboard/python-tensorboard.spec b/SPECS/python-tensorboard/python-tensorboard.spec index 3fd9c6f0742..1b8e7515d17 100644 --- a/SPECS/python-tensorboard/python-tensorboard.spec +++ b/SPECS/python-tensorboard/python-tensorboard.spec @@ -6,24 +6,31 @@ TensorBoard is a suite of web applications for inspecting and understanding your Summary: TensorBoard is a suite of web applications for inspecting and understanding your TensorFlow runs and graphs Name: python-%{pypi_name} -Version: 2.11.0 -Release: 4%{?dist} +Version: 2.16.2 +Release: 1%{?dist} License: ASL 2.0 Vendor: Microsoft Corporation Distribution: Azure Linux URL: https://github.com/tensorflow/tensorboard -Source0: https://github.com/tensorflow/tensorboard/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz -Source1: %{name}-%{version}-cache.tar.gz -BuildRequires: python3-setuptools -BuildRequires: python3-pip -BuildRequires: python3-wheel -BuildRequires: python3-six +# This source also contains the dependencies required for building tensorboard +Source0: %{_distro_sources_url}/%{name}-%{version}.tar.gz#/%{name}-%{version}.tar.gz + +Patch0: 0000-Use-system-package.patch BuildRequires: bazel -BuildRequires: gcc BuildRequires: build-essential -BuildRequires: protobuf -BuildRequires: zlib +BuildRequires: gcc +BuildRequires: git +BuildRequires: python3-absl-py +BuildRequires: python3-numpy +BuildRequires: python3-pip +BuildRequires: python3-protobuf +BuildRequires: python3-setuptools +BuildRequires: python3-six BuildRequires: python3-virtualenv +BuildRequires: python3-wheel +BuildRequires: python3-werkzeug +BuildRequires: which +BuildRequires: zlib ExclusiveArch: x86_64 @@ -56,10 +63,8 @@ Summary: %{summary} %autosetup -p1 -n tensorboard-%{version} %build -tar -xf %{SOURCE1} -C /root/ - -ln -s /usr/bin/python3 /usr/bin/python +ln -s %{_bindir}/python3 %{_bindir}/python #tensorboard-data-server pushd tensorboard/data/server/pip_package python3 setup.py -q bdist_wheel @@ -67,21 +72,10 @@ popd mkdir -p pyproject-wheeldir/ && cp tensorboard/data/server/pip_package/dist/*.whl pyproject-wheeldir/ #tensorboard built using bazel -bazel --batch build //tensorboard/pip_package:build_pip_package -#cache -# --------- -# steps to create the cache tar. network connection is required to create the cache. -#---------------------------------- -# bazel clean -# pushd /root -# tar -czvf %{name}-%{version}-cache.tar.gz .cache #creating the cache using the /root/.cache directory -# popd -# mv /root/%{name}-%{version}-cache.tar.gz /usr/ - -#tensorboard package build script build_pip_package.sh doesn't assign RUNFILES variable successfully. -sed -i 's/output="$1"/output="$1"\n \ RUNFILES="$(CDPATH="" cd -- "$0.runfiles" \&\& pwd)"/' bazel-bin/tensorboard/pip_package/build_pip_package +#tb_tmp contains all the dependencies for bazel build +bazel --batch --output_user_root=./tb_tmp build //tensorboard/pip_package:build_pip_package bazel-bin/tensorboard/pip_package/build_pip_package . -mv %{pypi_name}-%{version}-*.whl pyproject-wheeldir/ +mv %{pypi_name}-*.whl pyproject-wheeldir/ %install %{pyproject_install} @@ -100,6 +94,9 @@ mv %{pypi_name}-%{version}-*.whl pyproject-wheeldir/ %{python3_sitelib}/tensorboard_data_server* %changelog +* Thu Apr 25 2024 Riken Maharjan - 2.16.2-1 +- Upgrade tensorboard to 2.16.2. + * Tue Apr 23 2024 Andrew Phelps - 2.11.0-4 - Remove missing requirements `python3-tf-nightly` and `python3-tensorflow-estimator` diff --git a/SPECS/tensorflow/tensorflow.spec b/SPECS/tensorflow/tensorflow.spec index 9d70411b343..51b0bedc8c6 100644 --- a/SPECS/tensorflow/tensorflow.spec +++ b/SPECS/tensorflow/tensorflow.spec @@ -1,7 +1,7 @@ Summary: TensorFlow is an open source machine learning framework for everyone. Name: tensorflow Version: 2.16.1 -Release: 1%{?dist} +Release: 3%{?dist} License: ASL 2.0 Vendor: Microsoft Corporation Distribution: Azure Linux @@ -49,6 +49,7 @@ Requires: python3-requests Requires: python3-setuptools Requires: python3-six Requires: python3-termcolor +Requires: python3-tensorboard Requires: python3-typing-extensions Requires: python3-wrapt @@ -91,6 +92,9 @@ bazel --batch build //tensorflow/tools/pip_package:build_pip_package %{_bindir}/toco_from_protos %changelog +* Mon Apr 29 2024 Riken Maharjan - 2.16.1-3 +- Add tensorboard as runtime requirement + * Wed Mar 27 2024 Riken Maharjan - 2.16.1-2 - Remove Unnecessary requirements and add keras as runtime req diff --git a/cgmanifest.json b/cgmanifest.json index 376ad1e909c..6fc25dd105e 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -24533,8 +24533,8 @@ "type": "other", "other": { "name": "python-tensorboard", - "version": "2.11.0", - "downloadUrl": "https://github.com/tensorflow/tensorboard/archive/refs/tags/2.11.0.tar.gz" + "version": "2.16.2", + "downloadUrl": "https://cblmarinerstorage.blob.core.windows.net/sources/core/python-tensorboard-2.16.2.tar.gz" } } },