-
Notifications
You must be signed in to change notification settings - Fork 408
/
setup_host_and_run_model.sh
executable file
·27 lines (19 loc) · 1.14 KB
/
setup_host_and_run_model.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# This will stop execution when any command will have non-zero status.
set -e
cd "$HOME/github/gcsfuse/perfmetrics/scripts"
echo "Setting up the machine with Docker and Nvidia Driver..."
DRIVER_VERSION="450.172.01"
source ml_tests/setup_host.sh $DRIVER_VERSION
cd "$HOME/github/gcsfuse/"
mkdir container_artifacts && mkdir container_artifacts/logs && mkdir container_artifacts/output
echo "Building tf DLC docker image containing all tensorflow libraries..."
sudo docker build . -f perfmetrics/scripts/ml_tests/tf/resnet/Dockerfile -t tf-dlc-gcsfuse --build-arg DLC_IMAGE_NAME=tf-gpu.2-13
echo "Running the docker image build in the previous step..."
sudo docker run --gpus all --name tf_model_container --privileged -d \
-v $HOME/github/gcsfuse/container_artifacts/logs:/home/logs:rw,rshared \
-v $HOME/github/gcsfuse/container_artifacts/output:/home/output:rw,rshared --shm-size=24g tf-dlc-gcsfuse:latest
# Setup the log_rotation.
source perfmetrics/scripts/ml_tests/setup_log_rotation.sh $HOME/github/gcsfuse/container_artifacts/logs/gcsfuse.log
# Wait for the script completion as well as logs output.
sudo docker logs -f tf_model_container