Skip to content

Commit cb7e102

Browse files
Zeref996heliqi
andauthored
Fix serving/scripts build.sh (#1053)
* fix serving/scripts build.sh * Update build.sh support: ``` bash build.sh --docker_name=test ``` * Update build.sh Co-authored-by: heliqi <1101791222@qq.com>
1 parent 78a8c9a commit cb7e102

File tree

1 file changed

+37
-3
lines changed

1 file changed

+37
-3
lines changed

serving/scripts/build.sh

+37-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,41 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
WITH_GPU=${1:-ON}
15+
16+
ARGS=`getopt -a -o w:n:h:hs -l WITH_GPU:,docker_name:,http_proxy:,https_proxy: -- "$@"`
17+
18+
eval set -- "${ARGS}"
19+
echo "parse start"
20+
21+
while true
22+
do
23+
case "$1" in
24+
-w|--WITH_GPU)
25+
WITH_GPU="$2"
26+
shift;;
27+
-n|--docker_name)
28+
docker_name="$2"
29+
shift;;
30+
-h|--http_proxy)
31+
http_proxy="$2"
32+
shift;;
33+
-hs|--https_proxy)
34+
https_proxy="$2"
35+
shift;;
36+
--)
37+
shift
38+
break;;
39+
esac
40+
shift
41+
done
42+
43+
if [ -z $WITH_GPU ];then
44+
WITH_GPU="ON"
45+
fi
46+
47+
if [ -z $docker_name ];then
48+
docker_name="build_fd"
49+
fi
1650

1751
if [ $WITH_GPU == "ON" ]; then
1852

@@ -30,7 +64,7 @@ if [ ! -d "./TensorRT-8.4.1.5/" ]; then
3064
rm -rf TensorRT-8.4.1.5.Linux.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz
3165
fi
3266

33-
nvidia-docker run -i --rm --name build_fd \
67+
nvidia-docker run -i --rm --name ${docker_name} \
3468
-v`pwd`/..:/workspace/fastdeploy \
3569
-e "http_proxy=${http_proxy}" \
3670
-e "https_proxy=${https_proxy}" \
@@ -68,7 +102,7 @@ else
68102

69103
echo "start build FD CPU library"
70104

71-
docker run -i --rm --name build_fd \
105+
docker run -i --rm --name ${docker_name} \
72106
-v`pwd`/..:/workspace/fastdeploy \
73107
-e "http_proxy=${http_proxy}" \
74108
-e "https_proxy=${https_proxy}" \

0 commit comments

Comments
 (0)