-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_experiment.sh
executable file
·40 lines (30 loc) · 1.22 KB
/
run_experiment.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
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
EXPERIMENT_NAME=$1
# Fetching the branch
git clone https://github.com/TIXFeniks/babelSolution "$EXPERIMENT_NAME"
cd "$EXPERIMENT_NAME"
git checkout "$EXPERIMENT_NAME"
# Running experiment
# 1. Build docker image
sudo nvidia-docker build -t "donotstealsubs/$EXPERIMENT_NAME" .
# 2. OPTIONAL: Testing locally on small data
# 2.1. Creating output dir
OUTPUT_DIR="/home/user32878/data/outputs/output_$EXPERIMENT_NAME"
rm -rf "$OUTPUT_DIR" # Cleaning directory
mkdir "$OUTPUT_DIR"
# 2.2 Running experiment locally on small data
sudo nvidia-docker run -v /home/user32878/data/test_data2/:/data -v "$OUTPUT_DIR":/output -it "donotstealsubs/$EXPERIMENT_NAME" /nmt/run_lm_fused.sh
# 3. Pushing to docker hub
sudo docker push "donotstealsubs/$EXPERIMENT_NAME"
# Let's cat metadata.json which can be copypasted
METADATA="{\"image\": \"donotstealsubs/$EXPERIMENT_NAME\", \"entry_point\": \"/nmt/run_lm_fused.sh\"}"
echo $METADATA
cd ..
rm -rf "$EXPERIMENT_NAME"
# In case of there are too many docker containers
# sudo docker stop $(sudo docker ps -a -q) && sudo docker rm $(sudo docker ps -a -q)
# Metadata json should look like this
# {
# "image": "donotstealsubs/"$EXPERIMENT_NAME"",
# "entry_point": "/nmt/run_lm_fused.sh"
# }