|
| 1 | +#!/usr/bin/env bash |
| 2 | +# Copyright 2018 The TensorFlow Authors. All Rights Reserved. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +# ============================================================================== |
| 16 | +set -e |
| 17 | +set -x |
| 18 | + |
| 19 | +# Release: |
| 20 | +# docker run -it -v ${PWD}:/working_dir -w /working_dir tensorflow/tensorflow:custom-op bash -x /working_dir/release.sh <2.7|3.4|3.5|3.6> |
| 21 | + |
| 22 | +PLATFORM="$(uname -s | tr 'A-Z' 'a-z')" |
| 23 | + |
| 24 | +if [[ -z "${1}" ]]; then |
| 25 | + echo "usage:" $0 "<2.7|3.4|3.5|3.6>" |
| 26 | + exit 1 |
| 27 | +fi |
| 28 | + |
| 29 | +PYTHON_VERSION=$1 |
| 30 | + |
| 31 | +if [[ "3.5" == "${PYTHON_VERSION}" ]] || [ "3.6" == "${PYTHON_VERSION}" ]; then |
| 32 | + # fkrull/deadsnakes is for Python3.5 |
| 33 | + add-apt-repository -y ppa:fkrull/deadsnakes |
| 34 | + apt-get update |
| 35 | + |
| 36 | + apt-get install -y --no-install-recommends python${PYTHON_VERSION} libpython${PYTHON_VERSION}-dev |
| 37 | + wget -q https://bootstrap.pypa.io/get-pip.py |
| 38 | + python${PYTHON_VERSION} get-pip.py |
| 39 | + rm -f get-pip.py |
| 40 | + pip${PYTHON_VERSION} install --upgrade pip |
| 41 | +fi |
| 42 | + |
| 43 | +rm -f /usr/bin/python /usr/bin/pip |
| 44 | +ln -s /usr/bin/python${PYTHON_VERSION} /usr/bin/python |
| 45 | +ln -s /usr/bin/pip${PYTHON_VERSION} /usr/bin/pip |
| 46 | + |
| 47 | +./configure.sh |
| 48 | + |
| 49 | +bazel build build_pip_pkg |
| 50 | + |
| 51 | +bazel-bin/build_pip_pkg artifacts |
| 52 | + |
| 53 | +exit 0 |
0 commit comments