-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecd49af
commit fae987c
Showing
1 changed file
with
53 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env bash | ||
|
||
source /etc/profile | ||
BASEURL="https://gitee.com/Xiechengqi/scripts/raw/master" | ||
source <(curl -SsL $BASEURL/tool/common.sh) | ||
|
||
main() { | ||
|
||
export installPath="/data/fitsonchips-vllm" | ||
export IMAGE="squeezebits/fitsonchips-gpu-vllm:latest" | ||
mkdir -p ${installPath} | ||
|
||
export DEVICE_KEY=$1 | ||
[ ".${DEVICE_KEY}" = "." ] && ERROR "bash [DEVICE_KEY] [DEVICE]" | ||
|
||
INFO "docker pull ${IMAGE}" && docker pull ${IMAGE} || ERROR "Pull image fail ..." | ||
|
||
export DEVICE=$2 | ||
if [ ".${DEVICE}" = "." ] | ||
then | ||
cat > ${installPath}/docker-run.sh << EOF | ||
#!/usr/bin/env bash | ||
name="fitsonchips-vllm" | ||
docker rm -f \${name} | ||
docker run -itd \\ | ||
--restart=unless-stopped \\ | ||
--gpus all \\ | ||
-e DEVICE_KEY=${DEVICE_KEY} \\ | ||
--name \${name} \\ | ||
${IMAGE} \\ | ||
./start_worker.sh | ||
EOF | ||
eles | ||
cat > ${installPath}/docker-run.sh << EOF | ||
#!/usr/bin/env bash | ||
name="fitsonchips-vllm" | ||
docker run -itd \\ | ||
--restart=unless-stopped \\ | ||
--gpus '"device=0"' \\ | ||
-e DEVICE_KEY=${DEVICE_KEY} \\ | ||
--name \${name} \\ | ||
${IMAGE} \\ | ||
./start_worker.sh | ||
EOF | ||
fi | ||
EXEC "chmod +x ${installPath}/docker-run.sh" | ||
INFO "bash ${installPath}/docker-run.sh" && bash ${installPath}/docker-run.sh || ERROR "Run fail ..." | ||
|
||
} | ||
|
||
main $@ |