Skip to content

Commit

Permalink
docker bash
Browse files Browse the repository at this point in the history
  • Loading branch information
linkchw committed Aug 14, 2024
1 parent f3f4f28 commit 6658b57
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM 139.99.239.192:5000/nvcr.io/nvidia/pytorch:23.12-py3

RUN pip3 install --no-cache-dir transformers[torch]
RUN pip3 install --no-cache-dir transformers[torch]
24 changes: 16 additions & 8 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,27 @@ else
cd "$REPO_DIR" || { echo "Failed to change directory to '$REPO_DIR'."; exit 1; }
fi

echo "Building the Docker image..."
docker build -t train:v1 .
# echo "Building the Docker image..."
# docker build -t train:v1 .

if [ $? -ne 0 ]; then
echo "Failed to build Docker image."
exit 1
fi
# if [ $? -ne 0 ]; then
# echo "Failed to build Docker image."
# exit 1
# fi

echo "Setting permissions for 'train/' directory..."
chmod 777 train/
chmod -fR 777 train/

echo "Running the Docker container..."
docker run --gpus all --rm -u $(id -u):$(id -g) -v $(pwd)/train:/train train:v1
docker run \
--gpus all \
--rm \
-u $(id -u):$(id -g) \
-v $(pwd)/train:/train \
-e HF_HOME=/train/.cache/huggingface \
-w "/train/code" \
train:latest \
python3 main.py

if [ $? -ne 0 ]; then
echo "Failed to run Docker container."
Expand Down

0 comments on commit 6658b57

Please sign in to comment.