install_whl.sh 6.8 KB
Newer Older
W
wangjiawei04 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/bin/bash

# Copyright (c) 2020 PaddlePaddle 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.

SERVING_VERSION=$1
PADDLE_VERSION=$2
RUN_ENV=$3 # cpu/10.1 10.2
PYTHON_VERSION=$4
B
bjjwwang 已提交
21
serving_release=
W
wangjiawei04 已提交
22 23
client_release="paddle-serving-client==$SERVING_VERSION"
app_release="paddle-serving-app==0.3.1"
B
bjjwwang 已提交
24 25 26

if [[ $PYTHON_VERSION == "3.6" ]];then
    CPYTHON="36"
T
TeslaZhao 已提交
27
    CPYTHON_PADDLE="36m"
B
bjjwwang 已提交
28 29
elif [[ $PYTHON_VERSION == "3.7" ]];then
    CPYTHON="37"
T
TeslaZhao 已提交
30
    CPYTHON_PADDLE="37m"
B
bjjwwang 已提交
31 32
elif [[ $PYTHON_VERSION == "3.8" ]];then
    CPYTHON="38"
T
TeslaZhao 已提交
33
    CPYTHON_PADDLE="38"
B
bjjwwang 已提交
34 35 36 37 38
fi

if [[ $SERVING_VERSION == "0.5.0" ]]; then
    if [[ "$RUN_ENV" == "cpu" ]];then
        server_release="paddle-serving-server==$SERVING_VERSION"
T
TeslaZhao 已提交
39 40
        serving_bin="https://paddle-serving.bj.bcebos.com/bin/serving-cpu-avx-mkl-${SERVING_VERSION}.tar.gz"
        paddle_whl="https://paddle-wheel.bj.bcebos.com/$PADDLE_VERSION-cpu-avx-mkl/paddlepaddle-$PADDLE_VERSION-cp$CPYTHON-cp$CPYTHON_PADDLE-linux_x86_64.whl"
B
bjjwwang 已提交
41 42 43
    elif [[ "$RUN_ENV" == "cuda10.1" ]];then
        server_release="paddle-serving-server-gpu==$SERVING_VERSION.post101"
        serving_bin="https://paddle-serving.bj.bcebos.com/bin/serving-gpu-101-${SERVING_VERSION}.tar.gz"
T
TeslaZhao 已提交
44
        paddle_whl="https://paddle-wheel.bj.bcebos.com/with-trt/$PADDLE_VERSION-gpu-cuda10.1-cudnn7-mkl-gcc8.2/paddlepaddle_gpu-$PADDLE_VERSION.post101-cp$CPYTHON-cp$CPYTHON_PADDLE-linux_x86_64.whl"
B
bjjwwang 已提交
45 46 47
    elif [[ "$RUN_ENV" == "cuda10.2" ]];then
        server_release="paddle-serving-server-gpu==$SERVING_VERSION.post102"
        serving_bin="https://paddle-serving.bj.bcebos.com/bin/serving-gpu-102-${SERVING_VERSION}.tar.gz"
T
TeslaZhao 已提交
48
        paddle_whl="https://paddle-wheel.bj.bcebos.com/with-trt/$PADDLE_VERSION-gpu-cuda10.2-cudnn8-mkl-gcc8.2/paddlepaddle_gpu-$PADDLE_VERSION-cp$CPYTHON-cp$CPYTHON_PADDLE-linux_x86_64.whl"
B
bjjwwang 已提交
49 50
    elif [[ "$RUN_ENV" == "cuda11" ]];then
        server_release="paddle-serving-server-gpu==$SERVING_VERSION.post11"
T
TeslaZhao 已提交
51
        serving_bin="https://paddle-serving.bj.bcebos.com/bin/serving-gpu-cuda11-${SERVING_VERSION}.tar.gz"
T
TeslaZhao 已提交
52
        paddle_whl="https://paddle-wheel.bj.bcebos.com/with-trt/$PADDLE_VERSION-gpu-cuda11.0-cudnn8-mkl-gcc8.2/paddlepaddle_gpu-$PADDLE_VERSION.post110-cp$CPYTHON-cp$CPYTHON_PADDLE-linux_x86_64.whl"
B
bjjwwang 已提交
53 54 55
    fi
    client_release="paddle-serving-client==$SERVING_VERSION"
    app_release="paddle-serving-app==0.3.1"
56
else 
B
bjjwwang 已提交
57 58
    if [[ "$RUN_ENV" == "cpu" ]];then
        server_release="https://paddle-serving.bj.bcebos.com/test-dev/whl/paddle_serving_server-$SERVING_VERSION-py3-none-any.whl"
T
TeslaZhao 已提交
59 60
        serving_bin="https://paddle-serving.bj.bcebos.com/test-dev/bin/serving-cpu-avx-mkl-$SERVING_VERSION.tar.gz"
        paddle_whl="https://paddle-wheel.bj.bcebos.com/$PADDLE_VERSION-cpu-avx-mkl/paddlepaddle-$PADDLE_VERSION-cp$CPYTHON-cp$CPYTHON_PADDLE-linux_x86_64.whl"
B
bjjwwang 已提交
61 62 63
    elif [[ "$RUN_ENV" == "cuda10.1" ]];then
        server_release="https://paddle-serving.bj.bcebos.com/test-dev/whl/paddle_serving_server_gpu-$SERVING_VERSION.post101-py3-none-any.whl"
        serving_bin="https://paddle-serving.bj.bcebos.com/test-dev/bin/serving-gpu-101-$SERVING_VERSION.tar.gz"
T
TeslaZhao 已提交
64
        paddle_whl="https://paddle-wheel.bj.bcebos.com/with-trt/$PADDLE_VERSION-gpu-cuda10.1-cudnn7-mkl-gcc8.2/paddlepaddle_gpu-$PADDLE_VERSION.post101-cp$CPYTHON-cp$CPYTHON_PADDLE-linux_x86_64.whl"
B
bjjwwang 已提交
65 66 67
    elif [[ "$RUN_ENV" == "cuda10.2" ]];then
        server_release="https://paddle-serving.bj.bcebos.com/test-dev/whl/paddle_serving_server_gpu-$SERVING_VERSION.post102-py3-none-any.whl"
        serving_bin="https://paddle-serving.bj.bcebos.com/test-dev/bin/serving-gpu-102-$SERVING_VERSION.tar.gz"
T
TeslaZhao 已提交
68
        paddle_whl="https://paddle-wheel.bj.bcebos.com/with-trt/$PADDLE_VERSION-gpu-cuda10.2-cudnn8-mkl-gcc8.2/paddlepaddle_gpu-$PADDLE_VERSION-cp$CPYTHON-cp$CPYTHON_PADDLE-linux_x86_64.whl"
B
bjjwwang 已提交
69 70
    elif [[ "$RUN_ENV" == "cuda11" ]];then
        server_release="https://paddle-serving.bj.bcebos.com/test-dev/whl/paddle_serving_server_gpu-$SERVING_VERSION.post11-py3-none-any.whl"
T
TeslaZhao 已提交
71
        serving_bin="https://paddle-serving.bj.bcebos.com/test-dev/bin/serving-gpu-cuda11-$SERVING_VERSION.tar.gz"
T
TeslaZhao 已提交
72
        paddle_whl="https://paddle-wheel.bj.bcebos.com/with-trt/$PADDLE_VERSION-gpu-cuda11.0-cudnn8-mkl-gcc8.2/paddlepaddle_gpu-$PADDLE_VERSION.post110-cp$CPYTHON-cp$CPYTHON_PADDLE-linux_x86_64.whl"
B
bjjwwang 已提交
73 74 75 76 77
    fi
    client_release="https://paddle-serving.bj.bcebos.com/test-dev/whl/paddle_serving_client-$SERVING_VERSION-cp$CPYTHON-none-any.whl"
    app_release="https://paddle-serving.bj.bcebos.com/test-dev/whl/paddle_serving_app-$SERVING_VERSION-py3-none-any.whl"
fi

W
wangjiawei04 已提交
78 79
if [[ "$RUN_ENV" == "cpu" ]];then
    python$PYTHON_VERSION -m pip install $client_release $app_release $server_release
T
TeslaZhao 已提交
80
    python$PYTHON_VERSION -m pip install $paddle_whl
W
wangjiawei04 已提交
81
    cd /usr/local/
B
bjjwwang 已提交
82
    wget $serving_bin 
83 84
    tar xf serving-cpu-avx-mkl-${SERVING_VERSION}.tar.gz
    mv $PWD/serving-cpu-avx-mkl-${SERVING_VERSION} $PWD/serving_bin
B
bjjwwang 已提交
85
    echo "export SERVING_BIN=$PWD/serving_bin/serving">>/root/.bashrc
86
    rm -rf serving-cpu-avx-mkl-${SERVING_VERSION}.tar.gz
W
wangjiawei04 已提交
87 88 89
    cd -
elif [[ "$RUN_ENV" == "cuda10.1" ]];then
    python$PYTHON_VERSION -m pip install $client_release $app_release $server_release
T
TeslaZhao 已提交
90
    python$PYTHON_VERSION -m pip install $paddle_whl
W
wangjiawei04 已提交
91
    cd /usr/local/
B
bjjwwang 已提交
92
    wget $serving_bin
W
wangjiawei04 已提交
93
    tar xf serving-gpu-101-${SERVING_VERSION}.tar.gz
B
bjjwwang 已提交
94 95
    mv $PWD/serving-gpu-101-${SERVING_VERSION} $PWD/serving_bin
    echo "export SERVING_BIN=$PWD/serving_bin/serving">>/root/.bashrc
W
wangjiawei04 已提交
96 97 98 99
    rm -rf serving-gpu-101-${SERVING_VERSION}.tar.gz
    cd -
elif [[ "$RUN_ENV" == "cuda10.2" ]];then
    python$PYTHON_VERSION -m pip install $client_release $app_release $server_release
T
TeslaZhao 已提交
100
    python$PYTHON_VERSION -m pip install $paddle_whl
W
wangjiawei04 已提交
101
    cd /usr/local/
B
bjjwwang 已提交
102
    wget $serving_bin
W
wangjiawei04 已提交
103
    tar xf serving-gpu-102-${SERVING_VERSION}.tar.gz
B
bjjwwang 已提交
104 105
    mv $PWD/serving-gpu-102-${SERVING_VERSION} $PWD/serving_bin
    echo "export SERVING_BIN=$PWD/serving_bin/serving">>/root/.bashrc
W
wangjiawei04 已提交
106 107
    rm -rf serving-gpu-102-${SERVING_VERSION}.tar.gz
    cd -
B
bjjwwang 已提交
108 109
elif [[ "$RUN_ENV" == "cuda11" ]];then
    python$PYTHON_VERSION -m pip install $client_release $app_release $server_release
T
TeslaZhao 已提交
110
    python$PYTHON_VERSION -m pip install $paddle_whl
B
bjjwwang 已提交
111 112
    cd /usr/local/
    wget $serving_bin
T
TeslaZhao 已提交
113 114
    tar xf serving-gpu-cuda11-${SERVING_VERSION}.tar.gz
    mv $PWD/serving-gpu-cuda11-${SERVING_VERSION} $PWD/serving_bin
B
bjjwwang 已提交
115
    echo "export SERVING_BIN=$PWD/serving_bin/serving">>/root/.bashrc
T
TeslaZhao 已提交
116
    rm -rf serving-gpu-cuda11-${SERVING_VERSION}.tar.gz
B
bjjwwang 已提交
117
    cd -
W
wangjiawei04 已提交
118 119 120
fi