-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
1 changed file
with
32 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,32 @@ | ||
#!/bin/bash | ||
|
||
echo "Cloning the repository..." | ||
git clone https://github.com/viraweb123/name-family.git | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Failed to clone repository." | ||
exit 1 | ||
fi | ||
|
||
cd name-family/ || { echo "Failed to change directory to 'name-family'."; exit 1; } | ||
|
||
echo "Building the Docker image..." | ||
docker build -t train:v1 . | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Failed to build Docker image." | ||
exit 1 | ||
fi | ||
|
||
echo "Setting permissions for 'train/' directory..." | ||
chmod 777 train/ | ||
|
||
echo "Running the Docker container..." | ||
docker run --gpus all --rm -u $(id -u):$(id -g) -v $(pwd)/train:/train train:v1 | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Failed to run Docker container." | ||
exit 1 | ||
fi | ||
|
||
echo "Script completed successfully." |