Upload docker image
Browse files- SaprotHubImage.tar +3 -0
- WindowsDeploy.bat +59 -0
SaprotHubImage.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:953c5737ab89f998bf0fc32bc1da0c90da41d1c3bb174c1b32a8af73840aa7e9
|
| 3 |
+
size 16224627712
|
WindowsDeploy.bat
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@echo off
|
| 2 |
+
|
| 3 |
+
:: Define variables
|
| 4 |
+
set IMAGE_NAME=SaprotHubImage.tar
|
| 5 |
+
set CONTAINER_NAME=SaprotHubLocal
|
| 6 |
+
set PORT=12315
|
| 7 |
+
set DIRECTORY_PATH=/root/SaprotHub/local_server
|
| 8 |
+
set IMAGE_TAG=saprothub_image
|
| 9 |
+
|
| 10 |
+
:: Check if Docker image exists
|
| 11 |
+
echo Checking if Docker image exists...
|
| 12 |
+
docker images | findstr %IMAGE_TAG% >nul
|
| 13 |
+
if errorlevel 1 (
|
| 14 |
+
echo The image does not exist, importing the image...
|
| 15 |
+
docker load -i %IMAGE_NAME%
|
| 16 |
+
if errorlevel 1 (
|
| 17 |
+
echo Failed to import Docker image.
|
| 18 |
+
pause
|
| 19 |
+
exit /b
|
| 20 |
+
)
|
| 21 |
+
) else (
|
| 22 |
+
echo The image already exists.
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
:: Check if Docker container exists
|
| 26 |
+
echo Checking if Docker container exists...
|
| 27 |
+
docker ps -a | findstr %CONTAINER_NAME% >nul
|
| 28 |
+
if errorlevel 1 (
|
| 29 |
+
echo The container does not exist, creating and starting the container...
|
| 30 |
+
docker run -d --name %CONTAINER_NAME% --gpus all -p %PORT%:12315 %IMAGE_TAG% /bin/bash -c "while true; do sleep 1000; done"
|
| 31 |
+
if errorlevel 1 (
|
| 32 |
+
echo Failed to create and start Docker container.
|
| 33 |
+
pause
|
| 34 |
+
exit /b
|
| 35 |
+
)
|
| 36 |
+
) else (
|
| 37 |
+
echo The container already exists, starting the container...
|
| 38 |
+
docker start %CONTAINER_NAME%
|
| 39 |
+
if errorlevel 1 (
|
| 40 |
+
echo Failed to start Docker container.
|
| 41 |
+
pause
|
| 42 |
+
exit /b
|
| 43 |
+
)
|
| 44 |
+
)
|
| 45 |
+
|
| 46 |
+
:: Enter the Docker container and start a bash shell
|
| 47 |
+
echo Entering the Docker container and starting bash shell...
|
| 48 |
+
docker exec -it %CONTAINER_NAME% /bin/bash
|
| 49 |
+
if errorlevel 1 (
|
| 50 |
+
echo Failed to start bash shell inside the Docker container.
|
| 51 |
+
pause
|
| 52 |
+
exit /b
|
| 53 |
+
)
|
| 54 |
+
|
| 55 |
+
echo Now inside the Docker container. Run the following commands manually:
|
| 56 |
+
echo chmod +x %DIRECTORY_PATH%/run.sh
|
| 57 |
+
echo cd %DIRECTORY_PATH%
|
| 58 |
+
echo ./run.sh
|
| 59 |
+
pause
|