Skip to content

Commit

Permalink
added run.sh file
Browse files Browse the repository at this point in the history
  • Loading branch information
linkchw committed Aug 14, 2024
1 parent 04d932d commit 7ff4d24
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions train/code/run.sh
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."

0 comments on commit 7ff4d24

Please sign in to comment.